From 61b705f0e6b52d6ac1282cf7954404d2ff345c45 Mon Sep 17 00:00:00 2001 From: Guy McAuliffe <38873380+gmcauliffe@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:47:37 -0800 Subject: [PATCH 1/5] Add testids to DashboardTiles etc --- src/components/Dashboard/DashboardPresentation.js | 9 ++++++++- .../DashboardCategories/DashboardCategoriesData.js | 1 + .../DashboardCreate/DashboardCreateData.js | 9 +++++++++ src/components/DashboardEdit/DashboardEditData.js | 14 +++++++++++++- .../DashboardGalleries/DashboardGalleriesData.js | 1 + .../DashboardMedia/DashboardMediaData.js | 3 +++ .../DashboardPages/DashboardPagesData.js | 2 ++ .../DashboardReports/DashboardReportsData.js | 8 ++++++++ .../DashboardSpeakers/DashboardSpeakersData.js | 1 + .../DashboardTiles/DashboardTilesPresentation.js | 7 ++++++- .../DashboardWidgets/DashboardWidgetsData.js | 1 + src/components/NavBar/NavBarPresentation.js | 2 +- src/components/NavBar/NavBarPresentationMenu.js | 8 +++----- src/components/NavBar/NavBarPresentationMobile.js | 8 ++++---- src/components/Song/SongPresentationDrawer.js | 1 + .../SongsAndStories/SongsAndStoriesGrid.js | 2 +- .../SongsAndStories/SongsAndStoriesList.js | 4 ++-- src/components/Story/StoryPresentationDrawer.js | 1 + src/components/UserMenu/UserMenuPresentation.js | 12 +++++++++--- .../WidgetContactUs/WidgetContactUsPresentation.js | 2 +- 20 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/components/Dashboard/DashboardPresentation.js b/src/components/Dashboard/DashboardPresentation.js index 6d43bb96..4482a2ec 100644 --- a/src/components/Dashboard/DashboardPresentation.js +++ b/src/components/Dashboard/DashboardPresentation.js @@ -66,30 +66,35 @@ function DashboardPresentation({ children, currentUser, site, logout }) { const primaryNavigationItems = (currentSitename) => { const navigation = [ { + testid: 'dashboard-home-link', name: 'Dashboard', href: `/${currentSitename}/dashboard`, icon: 'Dashboard', auth: MEMBER, }, { + testid: 'dashboard-create-link', name: 'Create', href: `/${currentSitename}/dashboard/create`, icon: 'Create', auth: ASSISTANT, }, { + testid: 'dashboard-edit-link', name: 'Edit', href: `/${currentSitename}/dashboard/edit`, icon: 'Pencil', auth: ASSISTANT, }, { + testid: 'dashboard-media-link', name: 'Media', href: `/${currentSitename}/dashboard/media`, icon: 'Microphone', auth: ASSISTANT, }, { + testid: 'dashboard-reports-link', name: 'Reports', href: `/${currentSitename}/dashboard/reports`, icon: 'Reports', @@ -104,7 +109,7 @@ const primaryNavigationItems = (currentSitename) => { return ( { if (sites?.length > 0) { sites.forEach((site) => secondaryNavigation.push({ + testid: `${site?.sitename}-link`, name: `${site?.title} site`, href: `/${site?.sitename}`, icon: 'BackArrow', @@ -154,6 +160,7 @@ const secondaryNavigationItems = (sites) => { {secondaryNavigation.map((item) => ( diff --git a/src/components/DashboardCategories/DashboardCategoriesData.js b/src/components/DashboardCategories/DashboardCategoriesData.js index a75f1dcb..b2269fcd 100644 --- a/src/components/DashboardCategories/DashboardCategoriesData.js +++ b/src/components/DashboardCategories/DashboardCategoriesData.js @@ -15,6 +15,7 @@ function DashboardCategoriesData() { const tileContent = [ { + testid: 'create-category-link', icon: 'Create', name: 'Add a Category', description: 'Add a new category to your dictionary', diff --git a/src/components/DashboardCreate/DashboardCreateData.js b/src/components/DashboardCreate/DashboardCreateData.js index 1e6a0ff5..2256a932 100644 --- a/src/components/DashboardCreate/DashboardCreateData.js +++ b/src/components/DashboardCreate/DashboardCreateData.js @@ -15,6 +15,7 @@ function DashboardCreateData({ urlPrefix = '' }) { const createTiles = { WORD: { + testid: 'create-word-link', icon: 'Word', name: 'Create a word', description: 'Add a new word to your dictionary', @@ -23,6 +24,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, PHRASE: { + testid: 'create-phrase-link', icon: 'Phrase', name: 'Create a phrase', description: 'Add a new phrase to your dictionary', @@ -31,6 +33,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, SONG: { + testid: 'create-song-link', icon: 'Song', name: 'Create a song', description: 'Add a new song to your site', @@ -39,6 +42,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, STORY: { + testid: 'create-story-link', icon: 'Story', name: 'Create a story', description: 'Add a new story to your site', @@ -47,6 +51,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, SPEAKER: { + testid: 'create-speaker-link', icon: 'Speak', name: 'Add a speaker', description: 'Add a new speaker to your site', @@ -55,6 +60,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: EDITOR, }, CATEGORY: { + testid: 'create-category-link', icon: 'Category', name: 'Add a category', description: 'Add a new category to your dictionary', @@ -63,6 +69,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, WIDGET: { + testid: 'create-widget-link', icon: 'Widget', name: 'Create a widget', description: "Add a new widget to your site's collection", @@ -71,6 +78,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, PAGE: { + testid: 'create-page-link', icon: 'WebPages', name: 'Create a custom page', description: 'Add a new page to your site', @@ -79,6 +87,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, GALLERY: { + testid: 'create-gallery-link', icon: 'Images', name: 'Create a gallery', description: 'Add a new image gallery to your site', diff --git a/src/components/DashboardEdit/DashboardEditData.js b/src/components/DashboardEdit/DashboardEditData.js index 32368e93..36cffede 100644 --- a/src/components/DashboardEdit/DashboardEditData.js +++ b/src/components/DashboardEdit/DashboardEditData.js @@ -29,6 +29,7 @@ function DashboardEditData({ urlPrefix = '' }) { const editTiles = { WORDS: { + testid: 'edit-words-link', icon: 'Word', name: 'Edit words', description: 'Edit the words in your dictionary', @@ -43,6 +44,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, PHRASES: { + testid: 'edit-phrases-link', icon: 'Phrase', name: 'Edit phrases', description: 'Edit the phrases in your dictionary', @@ -57,6 +59,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, SONGS: { + testid: 'edit-songs-link', icon: 'Song', name: 'Edit songs', description: 'Edit the songs on your site', @@ -71,6 +74,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, STORIES: { + testid: 'edit-stories-link', icon: 'Story', name: 'Edit stories', description: 'Edit the stories on your site', @@ -85,6 +89,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, SPEAKERS: { + testid: 'edit-speakers-link', icon: 'Speak', name: 'Edit speakers', description: 'Edit the speakers on your site', @@ -93,6 +98,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: EDITOR, }, CATEGORIES: { + testid: 'edit-categories-link', icon: 'Categories', name: 'Edit categories', description: @@ -102,6 +108,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, WIDGETS: { + testid: 'edit-widgets-link', icon: 'Widget', name: 'Edit widgets', description: 'Manage and edit the widgets on your site', @@ -110,6 +117,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, PAGES: { + testid: 'edit-pages-link', icon: 'WebPages', name: 'Edit custom pages', description: 'Manage and edit the custom pages on your site', @@ -118,6 +126,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, HOMEPAGE: { + testid: 'edit-homepage-link', icon: 'Home', name: 'Edit homepage', description: 'Edit the main homepage for your site', @@ -126,6 +135,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, ALPHABET: { + testid: 'edit-alphabet-link', icon: 'Alphabet', name: 'Edit alphabet', description: @@ -135,6 +145,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, IMMERSION: { + testid: 'edit-immersion-link', icon: 'Translate', name: 'Edit Immersion Labels', description: 'Update the labels used in immersion mode on your site', @@ -143,8 +154,9 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, GALLERY: { + testid: 'edit-galleries-link', icon: 'Images', - name: 'Edit a gallery', + name: 'Edit galleries', description: 'Edit an image gallery on your site', href: addUrlPrefix('galleries'), iconColor: 'blumine-900', diff --git a/src/components/DashboardGalleries/DashboardGalleriesData.js b/src/components/DashboardGalleries/DashboardGalleriesData.js index 293c9501..c1231a4a 100644 --- a/src/components/DashboardGalleries/DashboardGalleriesData.js +++ b/src/components/DashboardGalleries/DashboardGalleriesData.js @@ -14,6 +14,7 @@ function DashboardGalleriesData() { const tileContent = [ { + testid: 'create-gallery-link', icon: 'Create', name: 'Create a Gallery', description: 'Add a new image gallery to your site', diff --git a/src/components/DashboardMedia/DashboardMediaData.js b/src/components/DashboardMedia/DashboardMediaData.js index d4de914c..c6ac3354 100644 --- a/src/components/DashboardMedia/DashboardMediaData.js +++ b/src/components/DashboardMedia/DashboardMediaData.js @@ -6,6 +6,7 @@ function DashboardMediaData() { const tileContent = [ { + testid: 'dashboard-audio-link', icon: 'Microphone', name: 'Audio', description: 'Manage your audio files', @@ -13,6 +14,7 @@ function DashboardMediaData() { iconColor: 'scarlet-900', }, { + testid: 'dashboard-images-link', icon: 'Images', name: 'Images', description: 'Manage your images', @@ -20,6 +22,7 @@ function DashboardMediaData() { iconColor: 'blumine-800', }, { + testid: 'dashboard-videos-link', icon: 'Video', name: 'Videos', description: 'Manage your videos', diff --git a/src/components/DashboardPages/DashboardPagesData.js b/src/components/DashboardPages/DashboardPagesData.js index 8cc7972e..ae41d498 100644 --- a/src/components/DashboardPages/DashboardPagesData.js +++ b/src/components/DashboardPages/DashboardPagesData.js @@ -14,6 +14,7 @@ function DashboardPagesData() { const tileContent = [ { + testid: 'edit-homepage-link', icon: 'Home', name: 'Edit Homepage', description: 'Edit the main homepage for your site', @@ -22,6 +23,7 @@ function DashboardPagesData() { auth: LANGUAGE_ADMIN, }, { + testid: 'create-page-link', icon: 'Create', name: 'Create a Custom Page', description: 'Add a new page to your site', diff --git a/src/components/DashboardReports/DashboardReportsData.js b/src/components/DashboardReports/DashboardReportsData.js index 3b0b3352..2569a41a 100644 --- a/src/components/DashboardReports/DashboardReportsData.js +++ b/src/components/DashboardReports/DashboardReportsData.js @@ -21,6 +21,7 @@ function DashboardReportsData() { const tileContent = [ { + testid: 'advanced-search-link', icon: 'Wrench', name: 'Build your own', description: 'Use the advanced search filters to create your own report', @@ -32,6 +33,7 @@ function DashboardReportsData() { const reportTiles = [ { + testid: 'report-created-link', icon: 'Star', name: 'Recently created', description: 'New words and phrases at the top', @@ -40,6 +42,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-modified-link', icon: 'Pencil', name: 'Recently modified', description: 'Recently edited words and phrases at the top', @@ -48,6 +51,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-no-audio-link', icon: 'MicrophoneOff', name: 'No audio', description: 'Words and phrases without audio files', @@ -56,6 +60,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-no-images-link', icon: 'ImagesNone', name: 'No images', description: 'Words and phrases without images', @@ -64,6 +69,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-team-link', icon: 'Team', name: 'Team content', description: 'Content only available to the language team', @@ -72,6 +78,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-members-link', icon: 'Members', name: 'Members only content', description: 'Content only available to site members', @@ -80,6 +87,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-public-link', icon: 'Public', name: 'Public content', description: 'Content available to the general public', diff --git a/src/components/DashboardSpeakers/DashboardSpeakersData.js b/src/components/DashboardSpeakers/DashboardSpeakersData.js index 92c353f2..091d7ed2 100644 --- a/src/components/DashboardSpeakers/DashboardSpeakersData.js +++ b/src/components/DashboardSpeakers/DashboardSpeakersData.js @@ -12,6 +12,7 @@ function DashboardSpeakersData() { const tileContent = [ { + testid: 'create-speaker-link', icon: 'Create', name: 'Add a Speaker', description: 'Add a new speaker to your site', diff --git a/src/components/DashboardTiles/DashboardTilesPresentation.js b/src/components/DashboardTiles/DashboardTilesPresentation.js index 057e887d..13d83917 100644 --- a/src/components/DashboardTiles/DashboardTilesPresentation.js +++ b/src/components/DashboardTiles/DashboardTilesPresentation.js @@ -63,6 +63,7 @@ function DashboardTilesPresentation({ tileContent }) {

{tile?.externalLink ? ( ) : ( - + {/* Extend touch target to entire panel */}