Skip to content

Commit f3da767

Browse files
fix(extensions): preserve pagination state on search and add i18n support (#2979)
* fix(extensions): preserve pagination state on search and add i18n support Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * updating api report Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * retaining state even after opening drwaer Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * fixing author filter Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * adding changeset Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> --------- Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
1 parent 3d2854b commit f3da767

13 files changed

Lines changed: 73 additions & 11 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-extensions': patch
3+
---
4+
5+
Fix pagination state reset when searching in the Installed Packages table, add localization support for pagination labels, fix table state being lost when opening package drawer, and fix author filter appearing cleared when clicking author link in plugin drawer.

workspaces/extensions/plugins/extensions/report-alpha.api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ const extensionsPlugin: OverridableFrontendPlugin<
144144
>;
145145
catalogTabRouteRef: SubRouteRef<undefined>;
146146
installedTabRouteRef: SubRouteRef<undefined>;
147+
installedPackageRouteRef: SubRouteRef<
148+
PathParams<'/installed-packages/:namespace/:name'>
149+
>;
147150
},
148151
{},
149152
{
@@ -361,6 +364,8 @@ export const extensionsTranslationRef: TranslationRef<
361364
readonly 'installedPackages.table.tooltips.disablePackage': string;
362365
readonly 'installedPackages.table.emptyMessages.noResults': string;
363366
readonly 'installedPackages.table.emptyMessages.noRecords': string;
367+
readonly 'installedPackages.table.pagination.labelRowsPerPage': string;
368+
readonly 'installedPackages.table.pagination.labelDisplayedRows': string;
364369
readonly 'button.update': string;
365370
readonly 'button.install': string;
366371
readonly 'button.uninstall': string;

workspaces/extensions/plugins/extensions/report.api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export const extensionsPlugin: BackstagePlugin<
4949
>;
5050
catalogTabRouteRef: SubRouteRef<undefined>;
5151
installedTabRouteRef: SubRouteRef<undefined>;
52+
installedPackageRouteRef: SubRouteRef<
53+
PathParams<'/installed-packages/:namespace/:name'>
54+
>;
5255
},
5356
{},
5457
{}
@@ -88,6 +91,9 @@ export const marketplacePlugin: BackstagePlugin<
8891
>;
8992
catalogTabRouteRef: SubRouteRef<undefined>;
9093
installedTabRouteRef: SubRouteRef<undefined>;
94+
installedPackageRouteRef: SubRouteRef<
95+
PathParams<'/installed-packages/:namespace/:name'>
96+
>;
9197
},
9298
{},
9399
{}

workspaces/extensions/plugins/extensions/src/alpha/translations/de.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ const extensionsTranslationDe = createTranslationMessages({
176176
'Keine Ergebnisse gefunden. Versuchen Sie es mit einem anderen Suchbegriff.',
177177
'installedPackages.table.emptyMessages.noRecords':
178178
'Keine Datensätze zum Anzeigen vorhanden',
179+
'installedPackages.table.pagination.labelRowsPerPage': 'Zeilen',
180+
'installedPackages.table.pagination.labelDisplayedRows':
181+
'{from}-{to} von {count}',
179182
'actions.install': 'Installieren',
180183
'actions.view': 'Anzeigen',
181184
'actions.edit': 'Bearbeiten',

workspaces/extensions/plugins/extensions/src/alpha/translations/es.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ const extensionsTranslationEs = createTranslationMessages({
177177
'No se encontraron resultados. Pruebe con un término de búsqueda diferente.',
178178
'installedPackages.table.emptyMessages.noRecords':
179179
'No hay registros para mostrar',
180+
'installedPackages.table.pagination.labelRowsPerPage': 'filas',
181+
'installedPackages.table.pagination.labelDisplayedRows':
182+
'{from}-{to} de {count}',
180183
'actions.install': 'Instalar',
181184
'actions.view': 'Ver',
182185
'actions.edit': 'Modificar',

workspaces/extensions/plugins/extensions/src/alpha/translations/fr.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ const extensionsTranslationFr = createTranslationMessages({
176176
'Aucun résultat trouvé. Essayez un autre terme de recherche.',
177177
'installedPackages.table.emptyMessages.noRecords':
178178
'Aucun enregistrement à afficher',
179+
'installedPackages.table.pagination.labelRowsPerPage': 'lignes',
180+
'installedPackages.table.pagination.labelDisplayedRows':
181+
'{from}-{to} sur {count}',
179182
'actions.install': 'Installer',
180183
'actions.view': 'Voir',
181184
'actions.edit': 'Modifier',

workspaces/extensions/plugins/extensions/src/alpha/translations/it.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ const extensionsTranslationIt = createTranslationMessages({
179179
'Nessun risultato trovato. Provare un termine di ricerca diverso.',
180180
'installedPackages.table.emptyMessages.noRecords':
181181
'Nessun record da visualizzare',
182+
'installedPackages.table.pagination.labelRowsPerPage': 'righe',
183+
'installedPackages.table.pagination.labelDisplayedRows':
184+
'{from}-{to} di {count}',
182185
'actions.install': 'Installa',
183186
'actions.view': 'Visualizza',
184187
'actions.edit': 'Modifica',

workspaces/extensions/plugins/extensions/src/alpha/translations/ja.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ const extensionsTranslationJa = createTranslationMessages({
177177
'結果が見つかりません。別の検索語句を試してください。',
178178
'installedPackages.table.emptyMessages.noRecords':
179179
'表示するレコードがありません',
180+
'installedPackages.table.pagination.labelRowsPerPage': '行',
181+
'installedPackages.table.pagination.labelDisplayedRows':
182+
'{from}-{to} / {count}',
180183
'actions.install': 'インストール',
181184
'actions.view': '表示',
182185
'actions.edit': '編集',

workspaces/extensions/plugins/extensions/src/alpha/translations/ref.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ export const extensionsMessages = {
222222
noResults: 'No results found. Try a different search term.',
223223
noRecords: 'No records to display',
224224
},
225+
pagination: {
226+
labelRowsPerPage: 'rows',
227+
labelDisplayedRows: '{from}-{to} of {count}',
228+
},
225229
},
226230
},
227231

workspaces/extensions/plugins/extensions/src/components/ExtensionsPluginContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ export const ExtensionsPluginContent = ({
586586
{index > 0 ? t('metadata.comma') : t('metadata.by')}
587587
<Link
588588
key={author.name}
589-
to={withFilter('spec.authors.name', author.name)}
589+
to={withFilter('author', author.name)}
590590
color="primary"
591591
onClick={e => e.stopPropagation()}
592592
>
@@ -604,7 +604,7 @@ export const ExtensionsPluginContent = ({
604604
{t('metadata.by')}{' '}
605605
<Link
606606
key={plugin.spec?.author}
607-
to={withFilter('spec.author', plugin.spec?.author)}
607+
to={withFilter('author', plugin.spec?.author)}
608608
color="primary"
609609
onClick={e => e.stopPropagation()}
610610
>

0 commit comments

Comments
 (0)