diff --git a/api-goldens/element-ng/translate/index.api.md b/api-goldens/element-ng/translate/index.api.md index 308e5ff6e..c7550743a 100644 --- a/api-goldens/element-ng/translate/index.api.md +++ b/api-goldens/element-ng/translate/index.api.md @@ -292,6 +292,8 @@ export interface SiTranslatableKeys { // (undocumented) 'SI_LANGUAGE_SWITCHER.LABEL'?: string; // (undocumented) + 'SI_LAUNCHPAD.ADD_FAVORITE'?: string; + // (undocumented) 'SI_LAUNCHPAD.CLOSE'?: string; // (undocumented) 'SI_LAUNCHPAD.DEFAULT_CATEGORY_TITLE'?: string; @@ -300,6 +302,8 @@ export interface SiTranslatableKeys { // (undocumented) 'SI_LAUNCHPAD.FAVORITE_APPS'?: string; // (undocumented) + 'SI_LAUNCHPAD.REMOVE_FAVORITE'?: string; + // (undocumented) 'SI_LAUNCHPAD.SHOW_LESS'?: string; // (undocumented) 'SI_LAUNCHPAD.SHOW_MORE'?: string; diff --git a/playwright/snapshots/navbar-launchpad.spec.ts-snapshots/si-navbar--si-navbar-launchpad-categories.yaml b/playwright/snapshots/navbar-launchpad.spec.ts-snapshots/si-navbar--si-navbar-launchpad-categories.yaml index 169c35542..1f5dfa802 100644 --- a/playwright/snapshots/navbar-launchpad.spec.ts-snapshots/si-navbar--si-navbar-launchpad-categories.yaml +++ b/playwright/snapshots/navbar-launchpad.spec.ts-snapshots/si-navbar--si-navbar-launchpad-categories.yaml @@ -14,18 +14,23 @@ - paragraph: Access all your apps - button "Close launchpad" - text: Favorites -- link "Water": +- link "Water Remove from favorites": - /url: . + - text: "" - button "Show less" - text: Phishing Apps -- link "Water": +- link "Water Remove from favorites": - /url: . + - text: "" - text: Other Apps -- link "Assets": +- link "Assets Add to favorites": - /url: . -- link "Rocket": + - text: "" +- link "Rocket Add to favorites": - /url: . -- link "Statistics": + - text: "" +- link "Statistics Add to favorites": - /url: . + - text: "" - link "Add more": - /url: https://example.org \ No newline at end of file diff --git a/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--mobile.yaml b/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--mobile.yaml index 29bdb8f94..a3cabc85b 100644 --- a/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--mobile.yaml +++ b/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--mobile.yaml @@ -5,50 +5,67 @@ - paragraph: Switch applications - button "Close launchpad" - text: Favorites -- link "Assets System name": +- link "Assets System name Remove from favorites": - /url: . -- link "Fischbach System name": + - text: "" +- link "Fischbach System name Remove from favorites": - /url: . -- link "Statistics System name": + - text: "" +- link "Statistics System name Remove from favorites": - /url: "#/viewer/viewer/stats" -- link "Rocket System name": + - text: "" +- link "Rocket System name Remove from favorites": - /url: . + - text: "" - button "Show less" -- link "Assets System name": +- link "Assets System name Remove from favorites": - /url: . -- link "Fischbach System name": + - text: "" +- link "Fischbach System name Remove from favorites": - /url: . -- link "Statistics System name": + - text: "" +- link "Statistics System name Remove from favorites": - /url: "#/viewer/viewer/stats" -- link "Rocket System name": + - text: "" +- link "Rocket System name Remove from favorites": - /url: . -- link "This is a really long name External application System name": + - text: "" +- link "This is a really long name External application System name Add to favorites": - /url: . - text: "" -- link "App name 1 External application System name": +- link "App name 1 External application System name Add to favorites": - /url: . - text: "" -- link "App name 2 System name": +- link "App name 2 System name Add to favorites": - /url: . -- link "App name 3 System name": + - text: "" +- link "App name 3 System name Add to favorites": - /url: . -- link "This is a really long name External application System name": + - text: "" +- link "This is a really long name External application System name Add to favorites": - /url: . - text: "" -- link "App name 4 System name": +- link "App name 4 System name Add to favorites": - /url: . -- link "App name 5 System name": + - text: "" +- link "App name 5 System name Add to favorites": - /url: . -- link "App name 6 This is a really long name": + - text: "" +- link "App name 6 This is a really long name Add to favorites": - /url: . -- link "App name 7 System name": + - text: "" +- link "App name 7 System name Add to favorites": - /url: . -- link "App name 8 System name": + - text: "" +- link "App name 8 System name Add to favorites": - /url: . -- link "App name 9 System name": + - text: "" +- link "App name 9 System name Add to favorites": - /url: . -- link /App name \d+ System name/: + - text: "" +- link /App name \d+ System name Add to favorites/: - /url: . + - text: "" - heading "Launchpad Configuration" [level=2] - paragraph: Configure your launchpad settings and test different display modes. - text: Enable Favorites Show favorite apps at the top diff --git a/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--new-favorite.yaml b/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--new-favorite.yaml index b6f567695..efb28315e 100644 --- a/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--new-favorite.yaml +++ b/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad--new-favorite.yaml @@ -5,48 +5,64 @@ - paragraph: Switch applications - button "Close launchpad" - text: Favorites -- link "Assets System name": +- link "Assets System name Remove from favorites": - /url: . -- link "Statistics System name": + - text: "" +- link "Statistics System name Remove from favorites": - /url: "#/viewer/viewer/stats" -- link "Rocket System name": + - text: "" +- link "Rocket System name Remove from favorites": - /url: . + - text: "" - button "Show less" -- link "Assets System name": +- link "Assets System name Remove from favorites": - /url: . -- link "Fischbach System name": + - text: "" +- link "Fischbach System name Add to favorites": - /url: . -- link "Statistics System name": + - text: "" +- link "Statistics System name Remove from favorites": - /url: "#/viewer/viewer/stats" -- link "Rocket System name": + - text: "" +- link "Rocket System name Remove from favorites": - /url: . -- link "This is a really long name External application System name": + - text: "" +- link "This is a really long name External application System name Add to favorites": - /url: . - text: "" -- link "App name 1 External application System name": +- link "App name 1 External application System name Add to favorites": - /url: . - text: "" -- link "App name 2 System name": +- link "App name 2 System name Add to favorites": - /url: . -- link "App name 3 System name": + - text: "" +- link "App name 3 System name Add to favorites": - /url: . -- link "This is a really long name External application System name": + - text: "" +- link "This is a really long name External application System name Add to favorites": - /url: . - text: "" -- link "App name 4 System name": +- link "App name 4 System name Add to favorites": - /url: . -- link "App name 5 System name": + - text: "" +- link "App name 5 System name Add to favorites": - /url: . -- link "App name 6 This is a really long name": + - text: "" +- link "App name 6 This is a really long name Add to favorites": - /url: . -- link "App name 7 System name": + - text: "" +- link "App name 7 System name Add to favorites": - /url: . -- link "App name 8 System name": + - text: "" +- link "App name 8 System name Add to favorites": - /url: . -- link "App name 9 System name": + - text: "" +- link "App name 9 System name Add to favorites": - /url: . -- link /App name \d+ System name/: + - text: "" +- link /App name \d+ System name Add to favorites/: - /url: . + - text: "" - heading "Launchpad Configuration" [level=2] - paragraph: Configure your launchpad settings and test different display modes. - text: Enable Favorites Show favorite apps at the top diff --git a/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad.yaml b/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad.yaml index 29bdb8f94..a3cabc85b 100644 --- a/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad.yaml +++ b/playwright/snapshots/si-launchpad.spec.ts-snapshots/si-application-header--si-launchpad.yaml @@ -5,50 +5,67 @@ - paragraph: Switch applications - button "Close launchpad" - text: Favorites -- link "Assets System name": +- link "Assets System name Remove from favorites": - /url: . -- link "Fischbach System name": + - text: "" +- link "Fischbach System name Remove from favorites": - /url: . -- link "Statistics System name": + - text: "" +- link "Statistics System name Remove from favorites": - /url: "#/viewer/viewer/stats" -- link "Rocket System name": + - text: "" +- link "Rocket System name Remove from favorites": - /url: . + - text: "" - button "Show less" -- link "Assets System name": +- link "Assets System name Remove from favorites": - /url: . -- link "Fischbach System name": + - text: "" +- link "Fischbach System name Remove from favorites": - /url: . -- link "Statistics System name": + - text: "" +- link "Statistics System name Remove from favorites": - /url: "#/viewer/viewer/stats" -- link "Rocket System name": + - text: "" +- link "Rocket System name Remove from favorites": - /url: . -- link "This is a really long name External application System name": + - text: "" +- link "This is a really long name External application System name Add to favorites": - /url: . - text: "" -- link "App name 1 External application System name": +- link "App name 1 External application System name Add to favorites": - /url: . - text: "" -- link "App name 2 System name": +- link "App name 2 System name Add to favorites": - /url: . -- link "App name 3 System name": + - text: "" +- link "App name 3 System name Add to favorites": - /url: . -- link "This is a really long name External application System name": + - text: "" +- link "This is a really long name External application System name Add to favorites": - /url: . - text: "" -- link "App name 4 System name": +- link "App name 4 System name Add to favorites": - /url: . -- link "App name 5 System name": + - text: "" +- link "App name 5 System name Add to favorites": - /url: . -- link "App name 6 This is a really long name": + - text: "" +- link "App name 6 This is a really long name Add to favorites": - /url: . -- link "App name 7 System name": + - text: "" +- link "App name 7 System name Add to favorites": - /url: . -- link "App name 8 System name": + - text: "" +- link "App name 8 System name Add to favorites": - /url: . -- link "App name 9 System name": + - text: "" +- link "App name 9 System name Add to favorites": - /url: . -- link /App name \d+ System name/: + - text: "" +- link /App name \d+ System name Add to favorites/: - /url: . + - text: "" - heading "Launchpad Configuration" [level=2] - paragraph: Configure your launchpad settings and test different display modes. - text: Enable Favorites Show favorite apps at the top diff --git a/projects/element-ng/application-header/launchpad/si-launchpad-app.component.html b/projects/element-ng/application-header/launchpad/si-launchpad-app.component.html index 9c63f5713..6cd7cab0b 100644 --- a/projects/element-ng/application-header/launchpad/si-launchpad-app.component.html +++ b/projects/element-ng/application-header/launchpad/si-launchpad-app.component.html @@ -25,6 +25,7 @@ class="favorite-icon" [class.is-favorite]="favorite()" [icon]="favorite() ? icons.elementFavoritesFilled : icons.elementFavorites" + [attr.aria-label]="(favorite() ? removeFavoriteText() : addFavoriteText()) | translate" (click)="favoriteClicked($event)" /> } diff --git a/projects/element-ng/application-header/launchpad/si-launchpad-app.component.ts b/projects/element-ng/application-header/launchpad/si-launchpad-app.component.ts index feb70e23b..3671d7246 100644 --- a/projects/element-ng/application-header/launchpad/si-launchpad-app.component.ts +++ b/projects/element-ng/application-header/launchpad/si-launchpad-app.component.ts @@ -60,6 +60,28 @@ export class SiLaunchpadAppComponent { readonly externalLinkText = input( t(() => $localize`:@@SI_LAUNCHPAD.EXTERNAL_LINK:External application`) ); + /** + * Aria-label for the favorite toggle icon when the app is marked as favorite. + * + * @defaultValue + * ``` + * t(() => $localize`:@@SI_LAUNCHPAD.REMOVE_FAVORITE:Remove from favorites`) + * ``` + */ + readonly removeFavoriteText = input( + t(() => $localize`:@@SI_LAUNCHPAD.REMOVE_FAVORITE:Remove from favorites`) + ); + /** + * Aria-label for the favorite toggle icon when the app is not marked as favorite. + * + * @defaultValue + * ``` + * t(() => $localize`:@@SI_LAUNCHPAD.ADD_FAVORITE:Add to favorites`) + * ``` + */ + readonly addFavoriteText = input( + t(() => $localize`:@@SI_LAUNCHPAD.ADD_FAVORITE:Add to favorites`) + ); protected readonly icons = addIcons({ elementExport, elementFavorites, elementFavoritesFilled }); diff --git a/projects/element-ng/translate/si-translatable-keys.interface.ts b/projects/element-ng/translate/si-translatable-keys.interface.ts index 65788a261..8d9431235 100644 --- a/projects/element-ng/translate/si-translatable-keys.interface.ts +++ b/projects/element-ng/translate/si-translatable-keys.interface.ts @@ -144,10 +144,12 @@ export interface SiTranslatableKeys { 'SI_ICON_STATUS.UNKNOWN'?: string; 'SI_ICON_STATUS.WARNING'?: string; 'SI_LANGUAGE_SWITCHER.LABEL'?: string; + 'SI_LAUNCHPAD.ADD_FAVORITE'?: string; 'SI_LAUNCHPAD.CLOSE'?: string; 'SI_LAUNCHPAD.DEFAULT_CATEGORY_TITLE'?: string; 'SI_LAUNCHPAD.EXTERNAL_LINK'?: string; 'SI_LAUNCHPAD.FAVORITE_APPS'?: string; + 'SI_LAUNCHPAD.REMOVE_FAVORITE'?: string; 'SI_LAUNCHPAD.SHOW_LESS'?: string; 'SI_LAUNCHPAD.SHOW_MORE'?: string; 'SI_LAUNCHPAD.SUB_TITLE'?: string;