From b948788ed9799fade087906126994fe43a172425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Tue, 2 Jul 2024 11:25:40 -0300 Subject: [PATCH] refactor: create search-manager feature --- .../LibraryAuthoringPage.test.tsx | 2 +- .../LibraryAuthoringPage.tsx | 12 ++-- src/library-authoring/LibraryHome.tsx | 2 +- .../components/LibraryComponents.test.tsx | 8 +-- .../components/LibraryComponents.tsx | 2 +- .../BlockTypeLabel.tsx | 0 .../ClearFiltersButton.tsx | 2 +- .../FilterByBlockType.tsx | 2 +- .../FilterByTags.tsx | 2 +- .../SearchFilterWidget.tsx | 0 .../SearchKeywordsField.tsx | 2 +- .../SearchManager.ts | 4 +- .../data/api.ts | 10 +-- .../data/apiHooks.ts | 0 src/search-manager/index.ts | 8 +++ src/search-manager/messages.ts | 70 +++++++++++++++++++ src/search-modal/EmptyStates.tsx | 2 +- src/search-modal/Highlight.tsx | 8 +-- src/search-modal/SearchModal.test.tsx | 2 +- src/search-modal/SearchResult.tsx | 9 +-- src/search-modal/SearchResults.tsx | 2 +- src/search-modal/SearchUI.test.tsx | 2 +- src/search-modal/SearchUI.tsx | 12 ++-- src/search-modal/Stats.tsx | 2 +- src/search-modal/index.js | 3 - src/search-modal/index.ts | 2 + src/search-modal/messages.ts | 60 ---------------- 27 files changed, 126 insertions(+), 104 deletions(-) rename src/{search-modal => search-manager}/BlockTypeLabel.tsx (100%) rename src/{search-modal => search-manager}/ClearFiltersButton.tsx (91%) rename src/{search-modal => search-manager}/FilterByBlockType.tsx (98%) rename src/{search-modal => search-manager}/FilterByTags.tsx (99%) rename src/{search-modal => search-manager}/SearchFilterWidget.tsx (100%) rename src/{search-modal => search-manager}/SearchKeywordsField.tsx (94%) rename src/{search-modal/manager => search-manager}/SearchManager.ts (97%) rename src/{search-modal => search-manager}/data/api.ts (98%) rename src/{search-modal => search-manager}/data/apiHooks.ts (100%) create mode 100644 src/search-manager/index.ts create mode 100644 src/search-manager/messages.ts delete mode 100644 src/search-modal/index.js create mode 100644 src/search-modal/index.ts diff --git a/src/library-authoring/LibraryAuthoringPage.test.tsx b/src/library-authoring/LibraryAuthoringPage.test.tsx index b14dc19d78..ccb1e87c42 100644 --- a/src/library-authoring/LibraryAuthoringPage.test.tsx +++ b/src/library-authoring/LibraryAuthoringPage.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; import fetchMock from 'fetch-mock-jest'; import initializeStore from '../store'; -import { getContentSearchConfigUrl } from '../search-modal/data/api'; +import { getContentSearchConfigUrl } from '../search-manager/data/api'; import mockResult from '../search-modal/__mocks__/search-result.json'; import mockEmptyResult from '../search-modal/__mocks__/empty-search-result.json'; import LibraryAuthoringPage from './LibraryAuthoringPage'; diff --git a/src/library-authoring/LibraryAuthoringPage.tsx b/src/library-authoring/LibraryAuthoringPage.tsx index 44fe073027..ab4af5048b 100644 --- a/src/library-authoring/LibraryAuthoringPage.tsx +++ b/src/library-authoring/LibraryAuthoringPage.tsx @@ -13,11 +13,13 @@ import Loading from '../generic/Loading'; import SubHeader from '../generic/sub-header/SubHeader'; import Header from '../header'; import NotFoundAlert from '../generic/NotFoundAlert'; -import { SearchContextProvider } from '../search-modal/manager/SearchManager'; -import SearchKeywordsField from '../search-modal/SearchKeywordsField'; -import ClearFiltersButton from '../search-modal/ClearFiltersButton'; -import FilterByBlockType from '../search-modal/FilterByBlockType'; -import FilterByTags from '../search-modal/FilterByTags'; +import { + ClearFiltersButton, + FilterByBlockType, + FilterByTags, + SearchContextProvider, + SearchKeywordsField, +} from '../search-manager'; import Stats from '../search-modal/Stats'; import LibraryComponents from './components/LibraryComponents'; import LibraryCollections from './LibraryCollections'; diff --git a/src/library-authoring/LibraryHome.tsx b/src/library-authoring/LibraryHome.tsx index c21cfb300b..3b50df12c3 100644 --- a/src/library-authoring/LibraryHome.tsx +++ b/src/library-authoring/LibraryHome.tsx @@ -5,7 +5,7 @@ import { } from '@openedx/paragon'; import { NoComponents, NoSearchResults } from './EmptyStates'; -import { useSearchContext } from '../search-modal/manager/SearchManager'; +import { useSearchContext } from '../search-manager'; import LibraryCollections from './LibraryCollections'; import LibraryComponents from './components/LibraryComponents'; import messages from './messages'; diff --git a/src/library-authoring/components/LibraryComponents.test.tsx b/src/library-authoring/components/LibraryComponents.test.tsx index 5dc689cb14..54f10adbe5 100644 --- a/src/library-authoring/components/LibraryComponents.test.tsx +++ b/src/library-authoring/components/LibraryComponents.test.tsx @@ -9,9 +9,9 @@ import MockAdapter from 'axios-mock-adapter'; import fetchMock from 'fetch-mock-jest'; import type { Store } from 'redux'; -import { getContentSearchConfigUrl } from '../../search-modal/data/api'; +import { getContentSearchConfigUrl } from '../../search-manager/data/api'; +import { SearchContextProvider } from '../../search-manager/SearchManager'; import mockEmptyResult from '../../search-modal/__mocks__/empty-search-result.json'; -import { SearchContextProvider } from '../../search-modal/manager/SearchManager'; import initializeStore from '../../store'; import { libraryComponentsMock } from '../__mocks__'; import LibraryComponents from './LibraryComponents'; @@ -76,8 +76,8 @@ jest.mock('../data/apiHook', () => ({ useLibraryBlockTypes: () => mockUseLibraryBlockTypes(), })); -jest.mock('../../search-modal/manager/SearchManager', () => ({ - ...jest.requireActual('../../search-modal/manager/SearchManager'), +jest.mock('../../search-manager', () => ({ + ...jest.requireActual('../../search-manager'), useSearchContext: () => mockUseSearchContext(), })); diff --git a/src/library-authoring/components/LibraryComponents.tsx b/src/library-authoring/components/LibraryComponents.tsx index 372dbb7226..48288946b3 100644 --- a/src/library-authoring/components/LibraryComponents.tsx +++ b/src/library-authoring/components/LibraryComponents.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo } from 'react'; import { CardGrid } from '@openedx/paragon'; -import { useSearchContext } from '../../search-modal/manager/SearchManager'; +import { useSearchContext } from '../../search-manager'; import { NoComponents, NoSearchResults } from '../EmptyStates'; import { useLibraryBlockTypes } from '../data/apiHook'; import { ComponentCard, ComponentCardLoading } from './ComponentCard'; diff --git a/src/search-modal/BlockTypeLabel.tsx b/src/search-manager/BlockTypeLabel.tsx similarity index 100% rename from src/search-modal/BlockTypeLabel.tsx rename to src/search-manager/BlockTypeLabel.tsx diff --git a/src/search-modal/ClearFiltersButton.tsx b/src/search-manager/ClearFiltersButton.tsx similarity index 91% rename from src/search-modal/ClearFiltersButton.tsx rename to src/search-manager/ClearFiltersButton.tsx index 7a29e51722..eeae127381 100644 --- a/src/search-modal/ClearFiltersButton.tsx +++ b/src/search-manager/ClearFiltersButton.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { FormattedMessage } from '@edx/frontend-platform/i18n'; import { Button } from '@openedx/paragon'; import messages from './messages'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from './SearchManager'; /** * A button that appears when at least one filter is active, and will clear the filters when clicked. diff --git a/src/search-modal/FilterByBlockType.tsx b/src/search-manager/FilterByBlockType.tsx similarity index 98% rename from src/search-modal/FilterByBlockType.tsx rename to src/search-manager/FilterByBlockType.tsx index 5aba1bc7df..ed16e2b059 100644 --- a/src/search-modal/FilterByBlockType.tsx +++ b/src/search-manager/FilterByBlockType.tsx @@ -9,7 +9,7 @@ import { import SearchFilterWidget from './SearchFilterWidget'; import messages from './messages'; import BlockTypeLabel from './BlockTypeLabel'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from './SearchManager'; /** * A button with a dropdown that allows filtering the current search by component type (XBlock type) diff --git a/src/search-modal/FilterByTags.tsx b/src/search-manager/FilterByTags.tsx similarity index 99% rename from src/search-modal/FilterByTags.tsx rename to src/search-manager/FilterByTags.tsx index d827713fcf..afdb440394 100644 --- a/src/search-modal/FilterByTags.tsx +++ b/src/search-manager/FilterByTags.tsx @@ -13,7 +13,7 @@ import { import { ArrowDropDown, ArrowDropUp, Warning } from '@openedx/paragon/icons'; import SearchFilterWidget from './SearchFilterWidget'; import messages from './messages'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from './SearchManager'; import { useTagFilterOptions } from './data/apiHooks'; import { LoadingSpinner } from '../generic/Loading'; import { TAG_SEP } from './data/api'; diff --git a/src/search-modal/SearchFilterWidget.tsx b/src/search-manager/SearchFilterWidget.tsx similarity index 100% rename from src/search-modal/SearchFilterWidget.tsx rename to src/search-manager/SearchFilterWidget.tsx diff --git a/src/search-modal/SearchKeywordsField.tsx b/src/search-manager/SearchKeywordsField.tsx similarity index 94% rename from src/search-modal/SearchKeywordsField.tsx rename to src/search-manager/SearchKeywordsField.tsx index e63d0eb59e..78bb3d9cd6 100644 --- a/src/search-modal/SearchKeywordsField.tsx +++ b/src/search-manager/SearchKeywordsField.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { useIntl } from '@edx/frontend-platform/i18n'; import { SearchField } from '@openedx/paragon'; import messages from './messages'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from './SearchManager'; /** * The "main" input field where users type in search keywords. The search happens as they type (no need to press enter). diff --git a/src/search-modal/manager/SearchManager.ts b/src/search-manager/SearchManager.ts similarity index 97% rename from src/search-modal/manager/SearchManager.ts rename to src/search-manager/SearchManager.ts index eed267b46c..6db1d6031f 100644 --- a/src/search-modal/manager/SearchManager.ts +++ b/src/search-manager/SearchManager.ts @@ -8,8 +8,8 @@ import React from 'react'; import { MeiliSearch, type Filter } from 'meilisearch'; -import { ContentHit } from '../data/api'; -import { useContentSearchConnection, useContentSearchResults } from '../data/apiHooks'; +import { ContentHit } from './data/api'; +import { useContentSearchConnection, useContentSearchResults } from './data/apiHooks'; export interface SearchContextData { client?: MeiliSearch; diff --git a/src/search-modal/data/api.ts b/src/search-manager/data/api.ts similarity index 98% rename from src/search-modal/data/api.ts rename to src/search-manager/data/api.ts index 1511c78ec1..d13ef2641b 100644 --- a/src/search-modal/data/api.ts +++ b/src/search-manager/data/api.ts @@ -7,12 +7,12 @@ export const getContentSearchConfigUrl = () => new URL( getConfig().STUDIO_BASE_URL, ).href; +export const HIGHLIGHT_PRE_TAG = '__meili-highlight__'; // Indicate the start of a highlighted (matching) term +export const HIGHLIGHT_POST_TAG = '__/meili-highlight__'; // Indicate the end of a highlighted (matching) term + /** The separator used for hierarchical tags in the search index, e.g. tags.level1 = "Subject > Math > Calculus" */ export const TAG_SEP = ' > '; -export const highlightPreTag = '__meili-highlight__'; // Indicate the start of a highlighted (matching) term -export const highlightPostTag = '__/meili-highlight__'; // Indicate the end of a highlighted (matching) term - /** * Get the content search configuration from the CMS. */ @@ -160,8 +160,8 @@ export async function fetchSearchResults({ ...tagsFilterFormatted, ], attributesToHighlight: ['display_name', 'content'], - highlightPreTag, - highlightPostTag, + highlightPreTag: HIGHLIGHT_PRE_TAG, + highlightPostTag: HIGHLIGHT_POST_TAG, attributesToCrop: ['content'], cropLength: 20, offset, diff --git a/src/search-modal/data/apiHooks.ts b/src/search-manager/data/apiHooks.ts similarity index 100% rename from src/search-modal/data/apiHooks.ts rename to src/search-manager/data/apiHooks.ts diff --git a/src/search-manager/index.ts b/src/search-manager/index.ts new file mode 100644 index 0000000000..96396a7e70 --- /dev/null +++ b/src/search-manager/index.ts @@ -0,0 +1,8 @@ +export { SearchContextProvider, useSearchContext } from './SearchManager'; +export { default as ClearFiltersButton } from './ClearFiltersButton'; +export { default as FilterByBlockType } from './FilterByBlockType'; +export { default as FilterByTags } from './FilterByTags'; +export { default as SearchKeywordsField } from './SearchKeywordsField'; +export { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from './data/api'; + +export type { ContentHit } from './data/api'; diff --git a/src/search-manager/messages.ts b/src/search-manager/messages.ts new file mode 100644 index 0000000000..73addfdfb1 --- /dev/null +++ b/src/search-manager/messages.ts @@ -0,0 +1,70 @@ +import { defineMessages as _defineMessages } from '@edx/frontend-platform/i18n'; +import type { defineMessages as defineMessagesType } from 'react-intl'; + +// frontend-platform currently doesn't provide types... do it ourselves. +const defineMessages = _defineMessages as typeof defineMessagesType; + +const messages = defineMessages({ + clearFilters: { + id: 'course-authoring.search-manager.clearFilters', + defaultMessage: 'Clear Filters', + description: 'Label for the button that removes all applied search filters', + }, + inputPlaceholder: { + id: 'course-authoring.search-manager.inputPlaceholder', + defaultMessage: 'Search', + description: 'Placeholder text shown in the keyword input field when the user has not yet entered a keyword', + }, + blockTypeFilter: { + id: 'course-authoring.search-manager.blockTypeFilter', + defaultMessage: 'Type', + description: 'Label for the filter that allows limiting results to a specific component type', + }, + 'blockTypeFilter.empty': { + id: 'course-authoring.search-manager.blockTypeFilter.empty', + defaultMessage: 'No matching components', + description: 'Label shown when there are no options available to filter by component type', + }, + childTagsExpand: { + id: 'course-authoring.search-manager.child-tags-expand', + defaultMessage: 'Expand to show child tags of "{tagName}"', + description: 'This text describes the ▼ expand toggle button to non-visual users.', + }, + childTagsCollapse: { + id: 'course-authoring.search-manager.child-tags-collapse', + defaultMessage: 'Collapse to hide child tags of "{tagName}"', + description: 'This text describes the ▲ collapse toggle button to non-visual users.', + }, + 'blockTagsFilter.empty': { + id: 'course-authoring.search-manager.blockTagsFilter.empty', + defaultMessage: 'No tags in current results', + description: 'Label shown when there are no options available to filter by tags', + }, + 'blockTagsFilter.error': { + id: 'course-authoring.search-manager.blockTagsFilter.error', + defaultMessage: 'Error loading tags', + description: 'Label shown when the tags could not be loaded', + }, + 'blockTagsFilter.incomplete': { + id: 'course-authoring.search-manager.blockTagsFilter.incomplete', + defaultMessage: 'Sorry, not all tags could be loaded', + description: 'Label shown when the system is not able to display all of the available tag options.', + }, + blockTagsFilter: { + id: 'course-authoring.search-manager.blockTagsFilter', + defaultMessage: 'Tags', + description: 'Label for the filter that allows finding components with specific tags', + }, + searchTagsByKeywordPlaceholder: { + id: 'course-authoring.search-manager.searchTagsByKeywordPlaceholder', + defaultMessage: 'Search tags', + description: 'Placeholder text shown in the input field that allows searching through the available tags', + }, + submitSearchTagsByKeyword: { + id: 'course-authoring.search-manager.submitSearchTagsByKeyword', + defaultMessage: 'Submit tag keyword search', + description: 'Text shown to screen reader users for the search button on the tags keyword search', + }, +}); + +export default messages; diff --git a/src/search-modal/EmptyStates.tsx b/src/search-modal/EmptyStates.tsx index a63abdb29c..901aae5b98 100644 --- a/src/search-modal/EmptyStates.tsx +++ b/src/search-modal/EmptyStates.tsx @@ -3,7 +3,7 @@ import { FormattedMessage } from '@edx/frontend-platform/i18n'; import type { MessageDescriptor } from 'react-intl'; import { Alert, Stack } from '@openedx/paragon'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from '../search-manager'; import EmptySearchImage from './images/empty-search.svg'; import NoResultImage from './images/no-results.svg'; import messages from './messages'; diff --git a/src/search-modal/Highlight.tsx b/src/search-modal/Highlight.tsx index 078344bbf9..00c867ba62 100644 --- a/src/search-modal/Highlight.tsx +++ b/src/search-modal/Highlight.tsx @@ -1,21 +1,21 @@ /* eslint-disable react/no-array-index-key */ import React from 'react'; -import { highlightPostTag, highlightPreTag } from './data/api'; +import { HIGHLIGHT_POST_TAG, HIGHLIGHT_PRE_TAG } from '../search-manager'; /** * Render some text that contains matching words which should be highlighted */ const Highlight: React.FC<{ text: string }> = ({ text }) => { - const parts = text.split(highlightPreTag); + const parts = text.split(HIGHLIGHT_PRE_TAG); return ( {parts.map((part, idx) => { if (idx === 0) { return {part}; } - const endIdx = part.indexOf(highlightPostTag); + const endIdx = part.indexOf(HIGHLIGHT_POST_TAG); if (endIdx === -1) { return {part}; } const highLightPart = part.substring(0, endIdx); - const otherPart = part.substring(endIdx + highlightPostTag.length); + const otherPart = part.substring(endIdx + HIGHLIGHT_POST_TAG.length); return {highLightPart}{otherPart}; })} diff --git a/src/search-modal/SearchModal.test.tsx b/src/search-modal/SearchModal.test.tsx index 18c970f9e0..ef35726395 100644 --- a/src/search-modal/SearchModal.test.tsx +++ b/src/search-modal/SearchModal.test.tsx @@ -11,7 +11,7 @@ import MockAdapter from 'axios-mock-adapter'; import initializeStore from '../store'; import SearchModal from './SearchModal'; -import { getContentSearchConfigUrl } from './data/api'; +import { getContentSearchConfigUrl } from '../search-manager/data/api'; let store: Store; let axiosMock: MockAdapter; diff --git a/src/search-modal/SearchResult.tsx b/src/search-modal/SearchResult.tsx index 33a9fc7e33..cfd817cd50 100644 --- a/src/search-modal/SearchResult.tsx +++ b/src/search-modal/SearchResult.tsx @@ -10,13 +10,14 @@ import { OpenInNew } from '@openedx/paragon/icons'; import { useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; -import { constructLibraryAuthoringURL } from '../utils'; +import { getItemIcon } from '../generic/block-type-utils'; +import { useSearchContext } from '../search-manager'; import { getStudioHomeData } from '../studio-home/data/selectors'; -import { useSearchContext } from './manager/SearchManager'; -import type { ContentHit } from './data/api'; +import { constructLibraryAuthoringURL } from '../utils'; import Highlight from './Highlight'; import messages from './messages'; -import { getItemIcon } from '../generic/block-type-utils'; + +import type { ContentHit } from '../search-manager'; /** * Returns the URL Suffix for library/library component hit diff --git a/src/search-modal/SearchResults.tsx b/src/search-modal/SearchResults.tsx index bbe271ffd9..7c741e9ce2 100644 --- a/src/search-modal/SearchResults.tsx +++ b/src/search-modal/SearchResults.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StatefulButton } from '@openedx/paragon'; import { useIntl } from '@edx/frontend-platform/i18n'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from '../search-manager'; import SearchResult from './SearchResult'; import messages from './messages'; diff --git a/src/search-modal/SearchUI.test.tsx b/src/search-modal/SearchUI.test.tsx index 7a62193e6d..b566730baa 100644 --- a/src/search-modal/SearchUI.test.tsx +++ b/src/search-modal/SearchUI.test.tsx @@ -28,7 +28,7 @@ import mockTagsFacetResultLevel0 from './__mocks__/facet-search-level0.json'; import mockTagsFacetResultLevel1 from './__mocks__/facet-search-level1.json'; import mockTagsKeywordSearchResult from './__mocks__/tags-keyword-search.json'; import SearchUI from './SearchUI'; -import { getContentSearchConfigUrl } from './data/api'; +import { getContentSearchConfigUrl } from '../search-manager/data/api'; // mockResult contains only a single result - this one: const mockResultDisplayName = 'Test HTML Block'; diff --git a/src/search-modal/SearchUI.tsx b/src/search-modal/SearchUI.tsx index 1ce23a8dbd..1e6305b47a 100644 --- a/src/search-modal/SearchUI.tsx +++ b/src/search-modal/SearchUI.tsx @@ -8,14 +8,16 @@ import { import { Check } from '@openedx/paragon/icons'; import { FormattedMessage } from '@edx/frontend-platform/i18n'; -import ClearFiltersButton from './ClearFiltersButton'; +import { + ClearFiltersButton, + FilterByBlockType, + FilterByTags, + SearchContextProvider, + SearchKeywordsField +} from '../search-manager'; import EmptyStates from './EmptyStates'; import SearchResults from './SearchResults'; -import SearchKeywordsField from './SearchKeywordsField'; -import FilterByBlockType from './FilterByBlockType'; -import FilterByTags from './FilterByTags'; import Stats from './Stats'; -import { SearchContextProvider } from './manager/SearchManager'; import messages from './messages'; const SearchUI: React.FC<{ courseId: string, closeSearchModal?: () => void }> = (props) => { diff --git a/src/search-modal/Stats.tsx b/src/search-modal/Stats.tsx index b172a864bd..239a9ea0b0 100644 --- a/src/search-modal/Stats.tsx +++ b/src/search-modal/Stats.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { FormattedMessage } from '@edx/frontend-platform/i18n'; import messages from './messages'; -import { useSearchContext } from './manager/SearchManager'; +import { useSearchContext } from '../search-manager'; /** * Simple component that displays the # of matching results diff --git a/src/search-modal/index.js b/src/search-modal/index.js deleted file mode 100644 index 190635618d..0000000000 --- a/src/search-modal/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-check -export { default as SearchModal } from './SearchModal'; -export { useContentSearchConnection, useContentSearchResults } from './data/apiHooks'; diff --git a/src/search-modal/index.ts b/src/search-modal/index.ts new file mode 100644 index 0000000000..d1f988e149 --- /dev/null +++ b/src/search-modal/index.ts @@ -0,0 +1,2 @@ +// eslint-disable-next-line import/prefer-default-export +export { default as SearchModal } from './SearchModal'; diff --git a/src/search-modal/messages.ts b/src/search-modal/messages.ts index 66e6f041c5..400f3cca00 100644 --- a/src/search-modal/messages.ts +++ b/src/search-modal/messages.ts @@ -5,36 +5,6 @@ import type { defineMessages as defineMessagesType } from 'react-intl'; const defineMessages = _defineMessages as typeof defineMessagesType; const messages = defineMessages({ - blockTypeFilter: { - id: 'course-authoring.course-search.blockTypeFilter', - defaultMessage: 'Type', - description: 'Label for the filter that allows limiting results to a specific component type', - }, - 'blockTypeFilter.empty': { - id: 'course-authoring.course-search.blockTypeFilter.empty', - defaultMessage: 'No matching components', - description: 'Label shown when there are no options available to filter by component type', - }, - blockTagsFilter: { - id: 'course-authoring.course-search.blockTagsFilter', - defaultMessage: 'Tags', - description: 'Label for the filter that allows finding components with specific tags', - }, - 'blockTagsFilter.empty': { - id: 'course-authoring.course-search.blockTagsFilter.empty', - defaultMessage: 'No tags in current results', - description: 'Label shown when there are no options available to filter by tags', - }, - 'blockTagsFilter.error': { - id: 'course-authoring.course-search.blockTagsFilter.error', - defaultMessage: 'Error loading tags', - description: 'Label shown when the tags could not be loaded', - }, - 'blockTagsFilter.incomplete': { - id: 'course-authoring.course-search.blockTagsFilter.incomplete', - defaultMessage: 'Sorry, not all tags could be loaded', - description: 'Label shown when the system is not able to display all of the available tag options.', - }, 'blockType.annotatable': { id: 'course-authoring.course-search.blockType.annotatable', defaultMessage: 'Annotation', @@ -90,21 +60,6 @@ const messages = defineMessages({ defaultMessage: 'Video', description: 'Name of the "Video" component type in Studio', }, - childTagsExpand: { - id: 'course-authoring.course-search.child-tags-expand', - defaultMessage: 'Expand to show child tags of "{tagName}"', - description: 'This text describes the ▼ expand toggle button to non-visual users.', - }, - childTagsCollapse: { - id: 'course-authoring.course-search.child-tags-collapse', - defaultMessage: 'Collapse to hide child tags of "{tagName}"', - description: 'This text describes the ▲ collapse toggle button to non-visual users.', - }, - clearFilters: { - id: 'course-authoring.course-search.clearFilters', - defaultMessage: 'Clear Filters', - description: 'Label for the button that removes all applied search filters', - }, numResults: { id: 'course-authoring.course-search.num-results', defaultMessage: '{numResults, plural, one {# result} other {# results}} found', @@ -125,21 +80,6 @@ const messages = defineMessages({ defaultMessage: 'Search', description: 'Title for the course search dialog', }, - inputPlaceholder: { - id: 'course-authoring.course-search.inputPlaceholder', - defaultMessage: 'Search', - description: 'Placeholder text shown in the keyword input field when the user has not yet entered a keyword', - }, - searchTagsByKeywordPlaceholder: { - id: 'course-authoring.course-search.searchTagsByKeywordPlaceholder', - defaultMessage: 'Search tags', - description: 'Placeholder text shown in the input field that allows searching through the available tags', - }, - submitSearchTagsByKeyword: { - id: 'course-authoring.course-search.submitSearchTagsByKeyword', - defaultMessage: 'Submit tag keyword search', - description: 'Text shown to screen reader users for the search button on the tags keyword search', - }, showMore: { id: 'course-authoring.course-search.showMore', defaultMessage: 'Show more',