Skip to content

Commit e971137

Browse files
feat: add no result view
feat: add language switch
1 parent 1cb3953 commit e971137

File tree

5 files changed

+60
-1
lines changed

5 files changed

+60
-1
lines changed

src/Resources/app/administration/src/module/nuonic-plugin-installer/page/nuonic-plugin-installer-list/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ Component.register('nuonic-plugin-installer-list', {
127127
listFilters() {
128128
return this.filterFactory.create('nuonic_available_opensource_plugin', this.listFilterOptions);
129129
},
130+
131+
assetFilter() {
132+
return Shopware.Filter.getByName('asset');
133+
},
130134
},
131135

132136
methods: {
@@ -151,6 +155,10 @@ Component.register('nuonic-plugin-installer-list', {
151155
}
152156
},
153157

158+
onChangeLanguage() {
159+
this.getList();
160+
},
161+
154162
changePage({ page = 1, limit = 10 }) {
155163
this.page = page;
156164
this.limit = limit;

src/Resources/app/administration/src/module/nuonic-plugin-installer/page/nuonic-plugin-installer-list/nuonic-plugin-installer-list.html.twig

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,37 @@
33
<template #search-bar>
44
<sw-search-bar initial-search-type="nuonic_available_opensource_plugin" :placeholder="$tc('nuonic-plugin-installer.extension.listing.placeholderSearchBar')" @search="onSearch" />
55
</template>
6+
67
<template #smart-bar-header>
78
<h2>
8-
{{ $tc('nuonic-plugin-installer.list.title') }} ({{ total }})
9+
{{ $tc('nuonic-plugin-installer.list.title') }} ({{ availablePlugins.total }})
910
</h2>
1011
</template>
12+
13+
<template #language-switch>
14+
<sw-language-switch @on-change="onChangeLanguage" />
15+
</template>
16+
1117
<template #content>
1218
<div class="nuonic-plugin-installer-index">
1319
<sw-skeleton v-if="isLoading" :variant="skeletonVariant" />
20+
<sw-card
21+
v-else-if="!isLoading && availablePlugins.total === 0"
22+
class="nuonic-plugin-installer-index__no-results"
23+
>
24+
<img
25+
:src="assetFilter('administration/static/img/empty-states/extensions-empty-state.svg')"
26+
alt=""
27+
>
28+
29+
<h3>
30+
{{ $tc('nuonic-plugin-installer.list.filters.noResults.title') }}
31+
</h3>
32+
33+
<p>
34+
{{ $tc('nuonic-plugin-installer.list.filters.noResults.description') }}
35+
</p>
36+
</sw-card>
1437
<div v-else class="nuonic-plugin-installer-index__listing-grid">
1538
<template v-for="entry in availablePlugins" :key="entry.id">
1639
<component :is="'nuonic-extension-card'" :extension="entry" />
@@ -19,6 +42,7 @@
1942
</div>
2043
</div>
2144
</template>
45+
2246
<template #sidebar>
2347
<sw-sidebar class="sw-customer-list__sidebar">
2448
<sw-sidebar-item
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
.nuonic-plugin-installer-index {
22
padding: 1rem 0;
3+
}
4+
5+
.nuonic-plugin-installer-index__no-results {
6+
text-align: center;
7+
margin-top: 48px;
8+
padding: 56px 32px;
9+
background-color: #fff;
10+
.sw-card__content {
11+
h3 {
12+
font-size: 18px;
13+
font-weight: bold;
14+
}
15+
img {
16+
margin-bottom: 24px;
17+
}
18+
p {
19+
font-size: 14px;
20+
}
21+
}
322
}

src/Resources/app/administration/src/snippet/de-DE.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
},
3535
"lastCommitFilter": {
3636
"label": "Letztes Commit"
37+
},
38+
"noResults": {
39+
"title": "Kleine Plugins gefunden",
40+
"description": "Versuche deine Suche oder Filterkriterien zu ändern."
3741
}
3842
}
3943
},

src/Resources/app/administration/src/snippet/en-GB.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
},
3535
"lastCommitFilter": {
3636
"label": "Last commit"
37+
},
38+
"noResults": {
39+
"title": "No plugins found",
40+
"description": "Try changing your search or filter criteria."
3741
}
3842
}
3943
},

0 commit comments

Comments
 (0)