diff --git a/package.json b/package.json index bd512c4590..fa4aaf0d50 100644 --- a/package.json +++ b/package.json @@ -45,15 +45,15 @@ "post-process-generated-graphql": "ts-node ./scripts/post-process-generated-graphql.ts" }, "devDependencies": { - "@babel/core": "^7.23.6", + "@babel/core": "^7.23.7", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-optional-chaining": "^7.21.0", - "@babel/preset-env": "^7.23.6", + "@babel/preset-env": "^7.23.7", "@babel/preset-react": "^7.23.3", "@babel/preset-typescript": "^7.23.3", - "@csstools/postcss-sass": "^5.0.1", + "@csstools/postcss-sass": "^5.1.1", "@cypress/browserify-preprocessor": "^3.0.2", - "@cypress/code-coverage": "^3.12.14", + "@cypress/code-coverage": "^3.12.15", "@graphql-codegen/add": "^3.1.1", "@graphql-codegen/cli": "^2.6.2", "@graphql-codegen/introspection": "^2.1.1", @@ -75,24 +75,24 @@ "@testing-library/react": "^14.1.2", "@testing-library/react-hooks": "^8.0.1", "@tsconfig/create-react-app": "^1.0.2", - "@types/node": "^20.10.5", - "@types/react": "^18.2.45", - "@types/react-dom": "^18.2.17", + "@types/node": "^20.10.6", + "@types/react": "^18.2.46", + "@types/react-dom": "^18.2.18", "@types/react-redux": "^7.1.24", "@typescript-eslint/eslint-plugin": "^5.23.0", - "@typescript-eslint/parser": "^6.14.0", - "@vitest/coverage-istanbul": "^1.0.4", + "@typescript-eslint/parser": "^6.16.0", + "@vitest/coverage-istanbul": "^1.1.1", "autoprefixer": "^10.4.16", "babel-loader": "^9.1.3", "babel-plugin-istanbul": "^6.1.1", "babel-plugin-lodash": "^3.3.4", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", - "caniuse-lite": "^1.0.30001570", + "caniuse-lite": "^1.0.30001572", "chokidar-cli": "^3.0.0", "concurrently": "^8.2.2", - "core-js": "^3.34.0", + "core-js": "^3.35.0", "css-loader": "^6.8.1", - "cssnano": "^6.0.1", + "cssnano": "^6.0.2", "cypress": "^9.6.1", "dotenv": "^16.3.1", "eslint": "^8.56.0", @@ -101,7 +101,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-loader": "^4.0.2", "eslint-plugin-cypress": "^2.12.1", - "eslint-plugin-import": "^2.29.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-no-only-tests": "^3.1.0", "eslint-plugin-prettier": "^4.0.0", @@ -117,11 +117,11 @@ "orval": "^6.8.1", "postcss": "^8.4.32", "postcss-cli": "^11.0.0", - "postcss-loader": "^7.3.3", + "postcss-loader": "^7.3.4", "postcss-scss": "^4.0.9", "prettier": "^2.6.2", "replace-in-file": "^6.3.2", - "sass": "^1.69.5", + "sass": "^1.69.6", "source-map-support": "^0.5.21", "style-loader": "^3.3.3", "stylelint": "^15.11.0", @@ -148,7 +148,7 @@ "@reach/dialog": "^0.18.0", "@reduxjs/toolkit": "^1.9.7", "@types/lodash": "^4.14.202", - "clsx": "^2.0.0", + "clsx": "^2.1.0", "dayjs": "^1.11.10", "downshift": "^6.1.7", "focus-trap-react": "^10.2.3", diff --git a/src/apps/advanced-search/AdvancedSearch.dev.tsx b/src/apps/advanced-search/AdvancedSearch.dev.tsx index c99f62d85e..c52bbb7c13 100644 --- a/src/apps/advanced-search/AdvancedSearch.dev.tsx +++ b/src/apps/advanced-search/AdvancedSearch.dev.tsx @@ -1,6 +1,7 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; import AdvancedSearchEntry, { AdvancedSearchEntryProps } from "./AdvancedSearch.entry"; @@ -10,6 +11,7 @@ export default { component: AdvancedSearchEntry, argTypes: { ...serviceUrlArgs, + ...globalTextArgs, pageSizeDesktop: { name: "Number of search result items on desktop", defaultValue: 50, @@ -96,28 +98,6 @@ export default { '[\n {\n "branchId":"DK-775120",\n "title":"Højbjerg"\n },\n {\n "branchId":"DK-775122",\n "title":"Beder-Malling"\n },\n {\n "branchId":"DK-775144",\n "title":"Gellerup"\n },\n {\n "branchId":"DK-775167",\n "title":"Lystrup"\n },\n {\n "branchId":"DK-775146",\n "title":"Harlev"\n },\n {\n "branchId":"DK-775168",\n "title":"Skødstrup"\n },\n {\n "branchId":"FBS-751010",\n "title":"Arresten"\n },\n {\n "branchId":"DK-775147",\n "title":"Hasle"\n },\n {\n "branchId":"FBS-751032",\n "title":"Må ikke benyttes"\n },\n {\n "branchId":"FBS-751031",\n "title":"Fjernlager 1"\n },\n {\n "branchId":"DK-775126",\n "title":"Solbjerg"\n },\n {\n "branchId":"FBS-751030",\n "title":"ITK"\n },\n {\n "branchId":"DK-775149",\n "title":"Sabro"\n },\n {\n "branchId":"DK-775127",\n "title":"Tranbjerg"\n },\n {\n "branchId":"DK-775160",\n "title":"Risskov"\n },\n {\n "branchId":"DK-775162",\n "title":"Hjortshøj"\n },\n {\n "branchId":"DK-775140",\n "title":"Åby"\n },\n {\n "branchId":"FBS-751009",\n "title":"Fjernlager 2"\n },\n {\n "branchId":"FBS-751029",\n "title":"Stadsarkivet"\n },\n {\n "branchId":"FBS-751027",\n "title":"Intern"\n },\n {\n "branchId":"FBS-751026",\n "title":"Fælles undervejs"\n },\n {\n "branchId":"FBS-751025",\n "title":"Fællessekretariatet"\n },\n {\n "branchId":"DK-775133",\n "title":"Bavnehøj"\n },\n {\n "branchId":"FBS-751024",\n "title":"Fjernlånte materialer"\n },\n {\n "branchId":"DK-775100",\n "title":"Hovedbiblioteket"\n },\n {\n "branchId":"DK-775170",\n "title":"Trige"\n },\n {\n "branchId":"DK-775150",\n "title":"Tilst"\n },\n {\n "branchId":"DK-775130",\n "title":"Viby"\n },\n {\n "branchId":"DK-775164",\n "title":"Egå"\n }\n]', control: { type: "text" } }, - addToFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Add @title to favorites list" - }, - removeFromFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Remove @title from favorites list" - }, - alertErrorCloseText: { - name: "Alert error close text", - defaultValue: "close", - control: { type: "text" } - }, - alertErrorMessageText: { - name: "Alert error message text", - defaultValue: "An error occurred", - control: { type: "text" } - }, loadingText: { name: "Loading", defaultValue: "Loading", @@ -357,11 +337,6 @@ export default { name: "Advanced search filter - non-fiction", defaultValue: "Non-fiction", control: { type: "text" } - }, - multiselectAllOptionText: { - name: "Multiselect - all option", - defaultValue: "All", - control: { type: "text" } } } } as ComponentMeta; diff --git a/src/apps/advanced-search/AdvancedSearch.entry.tsx b/src/apps/advanced-search/AdvancedSearch.entry.tsx index 04ec8a28fc..e0d748ef03 100644 --- a/src/apps/advanced-search/AdvancedSearch.entry.tsx +++ b/src/apps/advanced-search/AdvancedSearch.entry.tsx @@ -6,17 +6,14 @@ import { withText } from "../../core/utils/text"; import { withUrls } from "../../core/utils/url"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; import AdvancedSearch from "./AdvancedSearch"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; interface AdvancedSearchEntryTextProps { - addToFavoritesAriaLabelText: string; - alertErrorCloseText: string; - alertErrorMessageText: string; byAuthorText: string; etAlText: string; inSeriesText: string; loadingText: string; numberDescriptionText: string; - removeFromFavoritesAriaLabelText: string; resultPagerStatusText: string; noSearchResultText: string; showMoreText: string; @@ -67,7 +64,6 @@ interface AdvancedSearchEntryTextProps { advancedSearchFilterOnlineText: string; advancedSearchFilterFictionText: string; advancedSearchFilterNonFictionText: string; - multiselectAllOptionText: string; } interface AdvancedSearchEntryConfigProps { @@ -79,6 +75,7 @@ interface AdvancedSearchEntryConfigProps { export interface AdvancedSearchEntryProps extends GlobalUrlEntryPropsInterface, + GlobalEntryTextProps, AdvancedSearchEntryConfigProps, AdvancedSearchEntryTextProps { pageSizeDesktop?: number; diff --git a/src/apps/advanced-search/types.ts b/src/apps/advanced-search/types.ts index 17fb745f3c..817f0f7e3e 100644 --- a/src/apps/advanced-search/types.ts +++ b/src/apps/advanced-search/types.ts @@ -80,9 +80,9 @@ export const initialAdvancedSearchQuery: AdvancedSearchQuery = { { term: "", searchIndex: "all", clause: advancedSearchClauses[0], id: 1 } ], filters: { - materialTypes: [{ item: "All", value: "all" }], - fiction: [{ item: "All", value: "all" }], - accessibility: [{ item: "All", value: "all" }] + materialTypes: [{ item: "multiselectAllOptionText", value: "all" }], + fiction: [{ item: "multiselectAllOptionText", value: "all" }], + accessibility: [{ item: "multiselectAllOptionText", value: "all" }] } }; diff --git a/src/apps/create-patron-user-info/CreatePatron.dev.tsx b/src/apps/create-patron-user-info/CreatePatron.dev.tsx index fe73273eab..b592de2d79 100644 --- a/src/apps/create-patron-user-info/CreatePatron.dev.tsx +++ b/src/apps/create-patron-user-info/CreatePatron.dev.tsx @@ -3,6 +3,7 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import CreatePatron from "./CreatePatron.entry"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import pincodeArgs from "../../core/storybook/pincodeArgs"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Create patron", @@ -10,6 +11,7 @@ export default { argTypes: { ...serviceUrlArgs, ...pincodeArgs, + ...globalTextArgs, blacklistedPickupBranchesConfig: { defaultValue: "FBS-751032,FBS-751031,FBS-751009,FBS-751027,FBS-751024", control: { type: "text" } @@ -85,10 +87,6 @@ export default { defaultValue: "Phone number", control: { type: "text" } }, - patronContactInfoBodyText: { - defaultValue: "Please enter contact information below", - control: { type: "text" } - }, patronContactInfoHeaderText: { defaultValue: "Contact information", control: { type: "text" } @@ -108,11 +106,11 @@ export default { control: { type: "text" } }, createPatronChangePickupHeaderText: { - defaultValue: "", + defaultValue: "Create patron change pickup header text", control: { type: "text" } }, createPatronChangePickupBodyText: { - defaultValue: "", + defaultValue: "Create patron change pickup body text", control: { type: "text" } }, createPatronHeaderText: { diff --git a/src/apps/create-patron-user-info/CreatePatron.entry.tsx b/src/apps/create-patron-user-info/CreatePatron.entry.tsx index 4174257c1d..90377e064b 100644 --- a/src/apps/create-patron-user-info/CreatePatron.entry.tsx +++ b/src/apps/create-patron-user-info/CreatePatron.entry.tsx @@ -4,6 +4,7 @@ import { withText } from "../../core/utils/text"; import { withUrls } from "../../core/utils/url"; import CreatePatron from "./CreatePatron"; import { getToken, hasToken } from "../../core/token"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; interface CreatePatronConfigProps { agencyConfig: string; @@ -32,7 +33,6 @@ interface CreatePatronTextProps { createPatronInvalidSSNHeaderText: string; patronContactEmailCheckboxText: string; patronContactEmailLabelText: string; - patronContactInfoBodyText: string; patronContactInfoHeaderText: string; patronContactNameLabelText: string; patronContactPhoneCheckboxText: string; @@ -49,6 +49,7 @@ interface CreatePatronTextProps { export interface CreatePatronProps extends CreatePatronConfigProps, + GlobalEntryTextProps, CreatePatronUrlProps, CreatePatronTextProps {} diff --git a/src/apps/dashboard/dashboard.dev.tsx b/src/apps/dashboard/dashboard.dev.tsx index 47db9b98cd..34e78a5651 100644 --- a/src/apps/dashboard/dashboard.dev.tsx +++ b/src/apps/dashboard/dashboard.dev.tsx @@ -9,8 +9,8 @@ import reservationGroupModalArgs from "../../core/storybook/reservationGroupModa import reservationMaterialDetailsProps from "../../core/storybook/reservationMaterialDetailsArgs"; import materialDetailsModalArgs from "../../core/storybook/materialDetailsModalArgs"; import deleteReservationModalArgs from "../../core/storybook/deleteReservationModalArgs"; -import acceptModalArgs from "../../core/storybook/acceptFeesModalArgs"; import reservationListArgs from "../../core/storybook/reservationListArgs"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Dashboard", @@ -21,10 +21,10 @@ export default { ...renewalArgs, ...reservationGroupModalArgs, ...reservationMaterialDetailsProps, - ...acceptModalArgs, ...materialDetailsModalArgs, ...deleteReservationModalArgs, ...reservationListArgs, + ...globalTextArgs, // Urls physicalLoansUrl: { defaultValue: "/user/me/loans", @@ -74,10 +74,6 @@ export default { defaultValue: "To be returned soon", control: { type: "text" } }, - loansNotOverdueText: { - defaultValue: "Longer return time", - control: { type: "text" } - }, reservationsText: { defaultValue: "Reservations", control: { type: "text" } @@ -90,10 +86,6 @@ export default { defaultValue: "Ready for you", control: { type: "text" } }, - reservationsStillInQueueForText: { - defaultValue: "Still in queue", - control: { type: "text" } - }, noPhysicalLoansText: { defaultValue: "At the moment, you have 0 physical loans", control: { type: "text" } diff --git a/src/apps/dashboard/dashboard.entry.tsx b/src/apps/dashboard/dashboard.entry.tsx index 6b8cf4b95c..d667bf578f 100644 --- a/src/apps/dashboard/dashboard.entry.tsx +++ b/src/apps/dashboard/dashboard.entry.tsx @@ -10,8 +10,8 @@ import { ReservationMaterialDetailsProps } from "../../core/storybook/reservatio import { MaterialDetailsModalProps } from "../../core/storybook/materialDetailsModalArgs"; import { GroupModalReservationsProps } from "../../core/storybook/reservationGroupModalArgs"; import { DeleteReservationModalArgs } from "../../core/storybook/deleteReservationModalArgs"; -import { AcceptFeesModalEntryTextProps } from "../../core/storybook/acceptFeesModalArgs"; import { RenewalArgs } from "../../core/storybook/renewalArgs"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface DashBoardProps { // Url @@ -26,7 +26,6 @@ export interface DashBoardProps { expirationWarningDaysBeforeConfig: string; // Texts dashboardNumberInLineText: string; - deleteReservationModalButtonText: string; deleteReservationModalDeleteButtonText: string; deleteReservationModalDeleteProcessingText: string; deleteReservationModalErrorsStatusText: string; @@ -36,7 +35,6 @@ export interface DashBoardProps { etAlText: string; feesText: string; loanListMaterialDaysText: string; - loansNotOverdueText: string; loansOverdueText: string; loansSoonOverdueText: string; materialAndAuthorText: string; @@ -53,7 +51,6 @@ export interface DashBoardProps { readyForLoanText: string; reservationDetailsOthersInQueueText: string; reservationsReadyText: string; - reservationsStillInQueueForText: string; reservationsText: string; resultPagerStatusText: string; statusBadgeWarningText: string; @@ -67,11 +64,11 @@ const DashboardEntry: FC< GroupModalProps & GroupModalLoansProps & DeleteReservationModalArgs & - AcceptFeesModalEntryTextProps & GroupModalReservationsProps & RenewalArgs & ReservationMaterialDetailsProps & - MaterialDetailsModalProps + MaterialDetailsModalProps & + GlobalEntryTextProps > = ({ pageSizeDesktop, pageSizeMobile }) => { const pageSize = pageSizeGlobal( { diff --git a/src/apps/demo-modal/demo-modal.dev.tsx b/src/apps/demo-modal/demo-modal.dev.tsx index 8eb8725f53..f5cfad655c 100644 --- a/src/apps/demo-modal/demo-modal.dev.tsx +++ b/src/apps/demo-modal/demo-modal.dev.tsx @@ -2,6 +2,9 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import { withQuery } from "@storybook/addon-queryparams"; import DemoModal, { DemoModalEntryProps } from "./demo-modal.entry"; +import globalTextArgs, { + GlobalEntryTextProps +} from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Demo modal", @@ -13,6 +16,7 @@ export default { } }, argTypes: { + ...globalTextArgs, ariaLabelModalOneText: { defaultValue: "Luk dialog et" }, @@ -26,5 +30,5 @@ export default { } as ComponentMeta; export const App: ComponentStory = ( - props: DemoModalEntryProps + props: DemoModalEntryProps & GlobalEntryTextProps ) => ; diff --git a/src/apps/demo-modal/demo-modal.entry.tsx b/src/apps/demo-modal/demo-modal.entry.tsx index 07c3d3343a..93ecb96dc2 100644 --- a/src/apps/demo-modal/demo-modal.entry.tsx +++ b/src/apps/demo-modal/demo-modal.entry.tsx @@ -1,6 +1,7 @@ import React from "react"; import { withText } from "../../core/utils/text"; import DemoModal from "./demo-modal"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface DemoModalEntryProps { ariaLabelModalOneText: string; @@ -8,7 +9,7 @@ export interface DemoModalEntryProps { screenReaderModalDescriptionText: string; } -const DemoModalEntry: React.FC = ( +const DemoModalEntry: React.FC = ( props: DemoModalEntryProps ) => ; diff --git a/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.dev.tsx b/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.dev.tsx index 02e4b73ab3..a4be579590 100644 --- a/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.dev.tsx +++ b/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.dev.tsx @@ -3,6 +3,7 @@ import React from "react"; import { withQuery } from "@storybook/addon-queryparams"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import FavoritesListMaterialComponent from "./FavoritesListMaterialComponent.entry"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Favorites list material component", @@ -10,6 +11,7 @@ export default { decorators: [withQuery], argTypes: { ...serviceUrlArgs, + ...globalTextArgs, favoritesListMaterialComponentTitleText: { control: { type: "text" @@ -49,18 +51,6 @@ export default { type: "text" }, defaultValue: "https://unsplash.com/photos/wd6YQy0PJt8" // open source image of a red panda - }, - addToFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Add @title to favorites list" - }, - removeFromFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Remove @title from favorites list" } } } as ComponentMeta; diff --git a/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.entry.tsx b/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.entry.tsx index d009b0729e..82b0589d1a 100644 --- a/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.entry.tsx +++ b/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.entry.tsx @@ -3,7 +3,7 @@ import FavoritesListMaterialComponent from "./FavoritesListMaterialComponent"; import { withText } from "../../core/utils/text"; import { withConfig } from "../../core/utils/config"; import { withUrls } from "../../core/utils/url"; -import { FaustId } from "../../core/utils/types/ids"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface FavoritesListMaterialComponentProps { fbsBaseUrl: string; @@ -19,11 +19,11 @@ export interface FavoritesListMaterialComponentProps { etAlText: string; favoritesListMaterialComponentGoToListText: string; favoritesListMaterialComponentGoToListUrl: string; - addToFavoritesAriaLabelText: string; - removeFromFavoritesAriaLabelText: string; } -const SomethingSimilarEntry: FC = () => { +const SomethingSimilarEntry: FC< + FavoritesListMaterialComponentProps & GlobalEntryTextProps +> = () => { return ; }; diff --git a/src/apps/favorites-list/FavoritesList.dev.tsx b/src/apps/favorites-list/FavoritesList.dev.tsx index e7cf9ff239..0fc3e41df9 100644 --- a/src/apps/favorites-list/FavoritesList.dev.tsx +++ b/src/apps/favorites-list/FavoritesList.dev.tsx @@ -5,12 +5,14 @@ import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import FavoritesListEntry, { FavoritesListEntryProps } from "./FavoritesList.entry"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Favorite list", component: FavoritesListEntry, argTypes: { ...serviceUrlArgs, + ...globalTextArgs, pageSizeDesktop: { name: "Number of favorite items on desktop", defaultValue: 50, @@ -46,16 +48,6 @@ export default { defaultValue: "/work/:workid", control: { type: "text" } }, - availabilityAvailableText: { - name: "Availability: available text", - defaultValue: "Available", - control: { type: "text" } - }, - availabilityUnavailableText: { - name: "Availability: unavailable text", - defaultValue: "Unavailable", - control: { type: "text" } - }, favoritesListMaterialsText: { defaultValue: "@count materials", control: { type: "text" } diff --git a/src/apps/favorites-list/FavoritesList.entry.tsx b/src/apps/favorites-list/FavoritesList.entry.tsx index 0cb3ac5010..19f68103d5 100644 --- a/src/apps/favorites-list/FavoritesList.entry.tsx +++ b/src/apps/favorites-list/FavoritesList.entry.tsx @@ -5,14 +5,13 @@ import { withText } from "../../core/utils/text"; import { withUrls } from "../../core/utils/url"; import FavoritesList from "./FavoritesList"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; interface FavoritesListConfigEntryProps { blacklistedAvailabilityBranchesConfig: string; fbsBaseUrlConfig: string; } interface FavoritesListTextEntryProps { - availabilityAvailableText: string; - availabilityUnavailableText: string; favoritesListMaterialsText: string; favoritesListHeaderText: string; byAuthorText: string; @@ -27,6 +26,7 @@ interface FavoritesListTextEntryProps { export interface FavoritesListEntryProps extends FavoritesListConfigEntryProps, FavoritesListTextEntryProps, + GlobalEntryTextProps, GlobalUrlEntryPropsInterface { pageSizeDesktop?: number; pageSizeMobile?: number; diff --git a/src/apps/fee-list/FeeList.dev.tsx b/src/apps/fee-list/FeeList.dev.tsx index a13af6abd2..af7b75ba93 100644 --- a/src/apps/fee-list/FeeList.dev.tsx +++ b/src/apps/fee-list/FeeList.dev.tsx @@ -5,6 +5,7 @@ import blockedArgs from "../../core/storybook/blockedArgs"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import FeeList from "./FeeList.entry"; import { getModalIds } from "../../core/utils/helpers/modal-helpers"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Fee list", @@ -12,6 +13,7 @@ export default { argTypes: { ...serviceUrlArgs, ...blockedArgs, + ...globalTextArgs, feeListHeadlineText: { defaultValue: "Fees & Replacement costs", control: { type: "text" } diff --git a/src/apps/fee-list/FeeList.entry.tsx b/src/apps/fee-list/FeeList.entry.tsx index d314504afd..7c414105b3 100644 --- a/src/apps/fee-list/FeeList.entry.tsx +++ b/src/apps/fee-list/FeeList.entry.tsx @@ -6,6 +6,7 @@ import { withUrls } from "../../core/utils/url"; import FeeList from "./FeeList"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; import { withConfig } from "../../core/utils/config"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface IntermedateListEntryConfigProps { expirationWarningDaysBeforeConfig: string; @@ -50,6 +51,7 @@ const FeeListEntry: FC< FeeListProps & BlockedPatronEntryTextProps & IntermedateListEntryConfigProps & + GlobalEntryTextProps & GlobalUrlEntryPropsInterface > = () => ; diff --git a/src/apps/hello-world/hello-world.dev.tsx b/src/apps/hello-world/hello-world.dev.tsx index 2aa7812376..dc41ae2be0 100644 --- a/src/apps/hello-world/hello-world.dev.tsx +++ b/src/apps/hello-world/hello-world.dev.tsx @@ -1,11 +1,15 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import HelloWorld, { HelloWorldEntryProps } from "./hello-world.entry"; +import globalTextArgs, { + GlobalEntryTextProps +} from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Hello World", component: HelloWorld, argTypes: { + ...globalTextArgs, titleText: { defaultValue: "Greetings", control: { type: "text" } @@ -22,5 +26,5 @@ export default { } as ComponentMeta; export const App: ComponentStory = ( - args: HelloWorldEntryProps + args: HelloWorldEntryProps & GlobalEntryTextProps ) => ; diff --git a/src/apps/hello-world/hello-world.entry.tsx b/src/apps/hello-world/hello-world.entry.tsx index 36e6d69185..813e321b27 100644 --- a/src/apps/hello-world/hello-world.entry.tsx +++ b/src/apps/hello-world/hello-world.entry.tsx @@ -1,6 +1,7 @@ import React from "react"; import { withText } from "../../core/utils/text"; import HelloWorld from "./hello-world"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface HelloWorldEntryProps { titleText: string; @@ -8,6 +9,8 @@ export interface HelloWorldEntryProps { whatText: string; } -const HelloWorldEntry: React.FC = () => ; +const HelloWorldEntry: React.FC< + HelloWorldEntryProps & GlobalEntryTextProps +> = () => ; export default withText(HelloWorldEntry); diff --git a/src/apps/loan-list/list/loan-list.dev.tsx b/src/apps/loan-list/list/loan-list.dev.tsx index cda58523ff..743240f84c 100644 --- a/src/apps/loan-list/list/loan-list.dev.tsx +++ b/src/apps/loan-list/list/loan-list.dev.tsx @@ -3,10 +3,10 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import serviceUrlArgs from "../../../core/storybook/serviceUrlArgs"; import blockedArgs from "../../../core/storybook/blockedArgs"; +import globalTextArgs from "../../../core/storybook/globalTextArgs"; import LoanList from "./loan-list.entry"; import groupModalArgs from "../../../core/storybook/groupModalArgs"; import loanGroupModalArgs from "../../../core/storybook/loanGroupModalArgs"; -import acceptModalArgs from "../../../core/storybook/acceptFeesModalArgs"; import materialDetailsModalArgs from "../../../core/storybook/materialDetailsModalArgs"; import renewalArgs from "../../../core/storybook/renewalArgs"; import { getModalIds } from "../../../core/utils/helpers/modal-helpers"; @@ -17,9 +17,9 @@ export default { argTypes: { ...serviceUrlArgs, ...groupModalArgs, + ...globalTextArgs, ...loanGroupModalArgs, ...renewalArgs, - ...acceptModalArgs, ...materialDetailsModalArgs, ...blockedArgs, // Config @@ -207,10 +207,6 @@ export default { resultPagerStatusText: { defaultValue: "Showing @itemsShown out of @hitcount loans", control: { type: "text" } - }, - groupModalGoToMaterialAriaLabelText: { - defaultValue: "Go to @label material details", - control: { type: "text" } } }, decorators: [withQuery] diff --git a/src/apps/loan-list/list/loan-list.entry.tsx b/src/apps/loan-list/list/loan-list.entry.tsx index 0967eb30e0..768d05df26 100644 --- a/src/apps/loan-list/list/loan-list.entry.tsx +++ b/src/apps/loan-list/list/loan-list.entry.tsx @@ -11,7 +11,7 @@ import { GroupModalProps } from "../../../core/storybook/groupModalArgs"; import { GroupModalLoansProps } from "../../../core/storybook/loanGroupModalArgs"; import { RenewalArgs } from "../../../core/storybook/renewalArgs"; import { MaterialDetailsModalProps } from "../../../core/storybook/materialDetailsModalArgs"; -import { AcceptFeesModalEntryTextProps } from "../../../core/storybook/acceptFeesModalArgs"; +import { GlobalEntryTextProps } from "../../../core/storybook/globalTextArgs"; export interface LoanListEntryConfigProps { expirationWarningDaysBeforeConfig: string; @@ -21,7 +21,6 @@ export interface LoanListEntryUrlProps { } interface LoanListEntryTextProps { - groupModalGoToMaterialAriaLabelText: string; loanListAriaLabelListButtonText: string; loanListAriaLabelStackButtonText: string; loanListDigitalLoansEmptyListText: string; @@ -58,12 +57,12 @@ export interface LoanListEntryWithPageSizeProps extends BlockedPatronEntryTextProps, LoanListEntryTextProps, LoanListEntryConfigProps, + GlobalEntryTextProps, GroupModalProps, GroupModalLoansProps, RenewalArgs, LoanListEntryUrlProps, MaterialDetailsModalProps, - AcceptFeesModalEntryTextProps, GlobalUrlEntryPropsInterface {} const LoanListEntry: FC = ({ diff --git a/src/apps/material/material.dev.tsx b/src/apps/material/material.dev.tsx index 85dd317487..96a4575f1a 100644 --- a/src/apps/material/material.dev.tsx +++ b/src/apps/material/material.dev.tsx @@ -2,12 +2,14 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import MaterialEntry, { MaterialEntryProps } from "./material.entry"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Material", component: MaterialEntry, argTypes: { ...serviceUrlArgs, + ...globalTextArgs, searchUrl: { name: "Path to the search result page", defaultValue: "/search", @@ -52,16 +54,6 @@ export default { '[\n {\n "branchId":"DK-775120",\n "title":"Højbjerg"\n },\n {\n "branchId":"DK-775122",\n "title":"Beder-Malling"\n },\n {\n "branchId":"DK-775144",\n "title":"Gellerup"\n },\n {\n "branchId":"DK-775167",\n "title":"Lystrup"\n },\n {\n "branchId":"DK-775146",\n "title":"Harlev"\n },\n {\n "branchId":"DK-775168",\n "title":"Skødstrup"\n },\n {\n "branchId":"FBS-751010",\n "title":"Arresten"\n },\n {\n "branchId":"DK-775147",\n "title":"Hasle"\n },\n {\n "branchId":"FBS-751032",\n "title":"Må ikke benyttes"\n },\n {\n "branchId":"FBS-751031",\n "title":"Fjernlager 1"\n },\n {\n "branchId":"DK-775126",\n "title":"Solbjerg"\n },\n {\n "branchId":"FBS-751030",\n "title":"ITK"\n },\n {\n "branchId":"DK-775149",\n "title":"Sabro"\n },\n {\n "branchId":"DK-775127",\n "title":"Tranbjerg"\n },\n {\n "branchId":"DK-775160",\n "title":"Risskov"\n },\n {\n "branchId":"DK-775162",\n "title":"Hjortshøj"\n },\n {\n "branchId":"DK-775140",\n "title":"Åby"\n },\n {\n "branchId":"FBS-751009",\n "title":"Fjernlager 2"\n },\n {\n "branchId":"FBS-751029",\n "title":"Stadsarkivet"\n },\n {\n "branchId":"FBS-751027",\n "title":"Intern"\n },\n {\n "branchId":"FBS-751026",\n "title":"Fælles undervejs"\n },\n {\n "branchId":"FBS-751025",\n "title":"Fællessekretariatet"\n },\n {\n "branchId":"DK-775133",\n "title":"Bavnehøj"\n },\n {\n "branchId":"FBS-751024",\n "title":"Fjernlånte materialer"\n },\n {\n "branchId":"DK-775100",\n "title":"Hovedbiblioteket"\n },\n {\n "branchId":"DK-775170",\n "title":"Trige"\n },\n {\n "branchId":"DK-775150",\n "title":"Tilst"\n },\n {\n "branchId":"DK-775130",\n "title":"Viby"\n },\n {\n "branchId":"DK-775164",\n "title":"Egå"\n }\n]', control: { type: "text" } }, - availabilityAvailableText: { - name: "Availability: available text", - defaultValue: "Available", - control: { type: "text" } - }, - availabilityUnavailableText: { - name: "Availability: unavailable text", - defaultValue: "Unavailable", - control: { type: "text" } - }, materialHeaderAllEditionsText: { name: "Text for the fiction edition text", defaultValue: "All editions", @@ -305,11 +297,6 @@ export default { defaultValue: "Material is loaned out", control: { type: "text" } }, - findOnShelfExpandButtonExplanationText: { - name: "Find on shelf expand button explanation text", - defaultValue: "This button opens a modal", - control: { type: "text" } - }, materialIsIncludedText: { name: "Material is included", defaultValue: "This material doesn't count towards your loan quota", @@ -549,33 +536,11 @@ export default { "If you wish to change the pick-up location for your reservation, you can do it here.", control: { type: "text" } }, - modalReservationFormPickupLabelText: { - name: "Modal reservation form pickup branch input label", - defaultValue: "Change pickup location for your reservation.", - control: { type: "text" } - }, chooseOneText: { name: "Choose one text", defaultValue: "Choose one", control: { type: "text" } }, - modalReservationFormNoInterestAfterHeaderTitleText: { - name: "Modal reservation form no interest after header title", - defaultValue: "Change date of interest", - control: { type: "text" } - }, - modalReservationFormNoInterestAfterHeaderDescriptionText: { - name: "Modal reservation form no interest after header description", - defaultValue: - "If you wish to change the amount of time after which you're no longer interested in the material, you can do it here.", - control: { type: "text" } - }, - modalReservationFormNoInterestAfterLabelText: { - name: "Modal reservation form no interest after input label", - defaultValue: - "Change the amount of time after which you're no longer interested in this material.", - control: { type: "text" } - }, infomediaModalScreenReaderModalDescriptionText: { name: "Infomedia modal screen reader description", defaultValue: "Modal for infomedia", @@ -668,6 +633,31 @@ export default { defaultValue: "Close", control: { type: "text" } }, + orderDigitalCopyFeedbackBorchkUserBlockedByAgencyText: { + name: "Borchk user blocked by agency text", + defaultValue: "Borchk user blocked by agency", + control: { type: "text" } + }, + orderDigitalCopyFeedbackBorchkUserNotVerifiedText: { + name: "Borchk user not verified text", + defaultValue: "Borchk user not verified", + control: { type: "text" } + }, + orderDigitalCopyFeedbackBorchkUserNoLongerExistOnAgencyText: { + name: "Borchk user no longer exists on agency text", + defaultValue: "Borchk user no longer exists on agency", + control: { type: "text" } + }, + orderDigitalCopyFeedbackErrorMunicipalityagencyidNotFoundText: { + name: "Error municipality agency ID not found text", + defaultValue: "Error municipality agency ID not found", + control: { type: "text" } + }, + orderDigitalCopyFeedbackUnknownUserText: { + name: "Unknown user text", + defaultValue: "Unknown user", + control: { type: "text" } + }, orderDigitalCopyEmailLabelText: { name: "Order digital copy error email text", defaultValue: "Email", @@ -689,18 +679,6 @@ export default { defaultValue: "Unknown", control: { type: "text" } }, - addToFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Add @title to favorites list" - }, - removeFromFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Remove @title from favorites list" - }, firstAvailableEditionText: { name: "First available edition", defaultValue: "First available edition", @@ -711,31 +689,11 @@ export default { defaultValue: "Film adaptations", control: { type: "text" } }, - alertErrorCloseText: { - name: "Alert error close text", - defaultValue: "close", - control: { type: "text" } - }, - alertErrorMessageText: { - name: "Alert error message text", - defaultValue: "An error occurred", - control: { type: "text" } - }, expandMoreText: { name: "Expand more text", defaultValue: "Expand more", control: { type: "text" } }, - changeInterestPeriodText: { - name: "Change interest period text", - defaultValue: "Change interest period", - control: { type: "text" } - }, - changePickupLocationText: { - name: "Change pickup location text", - defaultValue: "Change pickup location", - control: { type: "text" } - }, changeSmsNumberText: { name: "Change sms number text", defaultValue: "Change sms number", @@ -746,46 +704,6 @@ export default { defaultValue: "Change email", control: { type: "text" } }, - screenReaderModalDescriptionInterestPeriodText: { - name: "Screen reader modal description for interest period", - defaultValue: "Change interest period modal", - control: { type: "text" } - }, - closeModalAriaLabelInterestPeriodText: { - name: "Close modal aria-label interest period ", - defaultValue: "Close interest period modal", - control: { type: "text" } - }, - screenReaderModalDescriptionPickupText: { - name: "Screen reader modal description for pickup", - defaultValue: "Change pickup location modal", - control: { type: "text" } - }, - closeModalAriaLabelPickupText: { - name: "Close modal aria-label pickup", - defaultValue: "Close pickup location modal", - control: { type: "text" } - }, - screenReaderModalDescriptionSmsText: { - name: "Screen reader modal description for sms", - defaultValue: "Change mobile number modal", - control: { type: "text" } - }, - closeModalAriaLabelSmsText: { - name: "Close modal aria-label sms", - defaultValue: "Close change mobile number modal", - control: { type: "text" } - }, - screenReaderModalDescriptionEmailText: { - name: "Screen reader modal description for email", - defaultValue: "Change email modal", - control: { type: "text" } - }, - closeModalAriaLabelEmailText: { - name: "Close modal aria-label email", - defaultValue: "Close change email modal", - control: { type: "text" } - }, instantLoanTitleText: { name: "Instant loan title", control: { type: "text" }, diff --git a/src/apps/material/material.entry.tsx b/src/apps/material/material.entry.tsx index 1295ffa494..1e4ae99a83 100644 --- a/src/apps/material/material.entry.tsx +++ b/src/apps/material/material.entry.tsx @@ -6,28 +6,18 @@ import { WorkId } from "../../core/utils/types/ids"; import { withUrls } from "../../core/utils/url"; import Material from "./material"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; interface MaterialEntryTextProps { - addToFavoritesAriaLabelText: string; - alertErrorCloseText: string; - alertErrorMessageText: string; alreadyReservedText: string; approveReservationText: string; - availabilityAvailableText: string; - availabilityUnavailableText: string; blockedButtonText: string; cantReserveText: string; cantViewReviewText: string; cantViewText: string; changeEmailText: string; - changeInterestPeriodText: string; - changePickupLocationText: string; changeSmsNumberText: string; chooseOneText: string; - closeModalAriaLabelEmailText: string; - closeModalAriaLabelInterestPeriodText: string; - closeModalAriaLabelPickupText: string; - closeModalAriaLabelSmsText: string; closeText: string; daysText: string; descriptionHeadlineText: string; @@ -54,7 +44,6 @@ interface MaterialEntryTextProps { fictionNonfictionText: string; filmAdaptationsText: string; findOnBookshelfText: string; - findOnShelfExpandButtonExplanationText: string; findOnShelfModalCloseModalAriaLabelText: string; findOnShelfModalListFindOnShelfText: string; findOnShelfModalListItemCountText: string; @@ -93,12 +82,8 @@ interface MaterialEntryTextProps { modalReservationFormEmailHeaderTitleText: string; modalReservationFormEmailInputFieldDescriptionText: string; modalReservationFormEmailInputFieldLabelText: string; - modalReservationFormNoInterestAfterHeaderDescriptionText: string; - modalReservationFormNoInterestAfterHeaderTitleText: string; - modalReservationFormNoInterestAfterLabelText: string; modalReservationFormPickupHeaderDescriptionText: string; modalReservationFormPickupHeaderTitleText: string; - modalReservationFormPickupLabelText: string; modalReservationFormSmsHeaderDescriptionText: string; modalReservationFormSmsHeaderTitleText: string; modalReservationFormSmsInputFieldDescriptionText: string; @@ -140,6 +125,11 @@ interface MaterialEntryTextProps { orderDigitalCopyFeedbackErrorUnauthenticatedUserText: string; orderDigitalCopyFeedbackOkText: string; orderDigitalCopyFeedbackTitleText: string; + orderDigitalCopyFeedbackBorchkUserBlockedByAgencyText: string; + orderDigitalCopyFeedbackBorchkUserNotVerifiedText: string; + orderDigitalCopyFeedbackBorchkUserNoLongerExistOnAgencyText: string; + orderDigitalCopyFeedbackErrorMunicipalityagencyidNotFoundText: string; + orderDigitalCopyFeedbackUnknownUserText: string; orderDigitalCopyModalCloseModalAriaLabelText: string; orderDigitalCopyModalScreenReaderModalDescriptionText: string; orderDigitalCopyTitleText: string; @@ -152,7 +142,6 @@ interface MaterialEntryTextProps { readArticleText: string; receiveEmailWhenMaterialReadyText: string; receiveSmsWhenMaterialReadyText: string; - removeFromFavoritesAriaLabelText: string; reservableFromAnotherLibraryText: string; reservationErrorsDescriptionText: string; reservationErrorsTitleText: string; @@ -165,10 +154,6 @@ interface MaterialEntryTextProps { reserveText: string; reviewsText: string; saveButtonText: string; - screenReaderModalDescriptionEmailText: string; - screenReaderModalDescriptionInterestPeriodText: string; - screenReaderModalDescriptionPickupText: string; - screenReaderModalDescriptionSmsText: string; seeOnlineText: string; shiftText: string; subjectNumberText: string; @@ -187,6 +172,7 @@ interface MaterialEntryConfigProps { export interface MaterialEntryProps extends GlobalUrlEntryPropsInterface, MaterialEntryTextProps, + GlobalEntryTextProps, MaterialEntryConfigProps { wid: WorkId; } diff --git a/src/apps/menu/menu.dev.tsx b/src/apps/menu/menu.dev.tsx index 2fe1605d5e..e85ae0cf5c 100644 --- a/src/apps/menu/menu.dev.tsx +++ b/src/apps/menu/menu.dev.tsx @@ -10,10 +10,17 @@ import reservationMaterialDetailsProps from "../../core/storybook/reservationMat import materialDetailsModalArgs from "../../core/storybook/materialDetailsModalArgs"; import deleteReservationModalArgs from "../../core/storybook/deleteReservationModalArgs"; import StoryHeader from "../../components/search-bar/story-header.dev.inc"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; +import { withText } from "../../core/utils/text"; +import { withUrls } from "../../core/utils/url"; +import { withConfig } from "../../core/utils/config"; + +const WrappedMenu = withText(withUrls(withConfig(Menu))); +const WrappedStoryHeader = withText(withUrls(withConfig(StoryHeader))); export default { title: "Apps / Header", - component: Menu, + component: WrappedMenu, argTypes: { ...serviceUrlArgs, ...groupModalArgs, @@ -23,6 +30,7 @@ export default { ...reservationGroupModalArgs, ...deleteReservationModalArgs, ...materialDetailsModalArgs, + ...globalTextArgs, materialAndAuthorText: { control: { type: "text" @@ -161,16 +169,15 @@ export default { control: { type: "text" } } } -} as ComponentMeta; +} as ComponentMeta; -export const UserMenu: ComponentStory = (args) => { - const menuEntryProps = args; - const menu = ; +export const UserMenu: ComponentStory = (args) => { + const menu = ; return ( // We use the Header component as context to the search bar. // It is the Header that creates the Search bar's design - // - without it, the Search bar loses its shape. - + ); }; diff --git a/src/apps/menu/menu.entry.tsx b/src/apps/menu/menu.entry.tsx index 7fd1f1c777..ada9517096 100644 --- a/src/apps/menu/menu.entry.tsx +++ b/src/apps/menu/menu.entry.tsx @@ -12,6 +12,7 @@ import { MaterialDetailsModalProps } from "../../core/storybook/materialDetailsM import { ReservationMaterialDetailsProps } from "../../core/storybook/reservationMaterialDetailsArgs"; import { DeleteReservationModalArgs } from "../../core/storybook/deleteReservationModalArgs"; import { RenewalArgs } from "../../core/storybook/renewalArgs"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface MenuProps { menuUserProfileUrlText: string; @@ -55,6 +56,7 @@ export interface MenuEntryProps DeleteReservationModalArgs, GroupModalReservationsProps, MaterialDetailsModalProps, + GlobalEntryTextProps, ReservationMaterialDetailsProps {} const MenuEntry: FC = ({ pageSizeDesktop, pageSizeMobile }) => { diff --git a/src/apps/patron-page/PatronPage.dev.tsx b/src/apps/patron-page/PatronPage.dev.tsx index 5977cb7329..fccf9eca60 100644 --- a/src/apps/patron-page/PatronPage.dev.tsx +++ b/src/apps/patron-page/PatronPage.dev.tsx @@ -4,6 +4,7 @@ import PatronPage from "./PatronPage.entry"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import pincodeArgs from "../../core/storybook/pincodeArgs"; import blockedArgs from "../../core/storybook/blockedArgs"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Patron page", @@ -12,6 +13,7 @@ export default { ...serviceUrlArgs, ...pincodeArgs, ...blockedArgs, + ...globalTextArgs, // Config pauseReservationStartDateConfig: { defaultValue: "2022-06-30", @@ -76,10 +78,6 @@ export default { defaultValue: "End date", control: { type: "text" } }, - pauseReservationModalBelowInputsTextText: { - defaultValue: "", - control: { type: "text" } - }, pauseReservationModalLinkText: { defaultValue: "Read more about pausing reservertions and what that means here", @@ -109,10 +107,6 @@ export default { defaultValue: "Contact information", control: { type: "text" } }, - patronContactInfoBodyText: { - defaultValue: "", - control: { type: "text" } - }, patronContactPhoneLabelText: { defaultValue: "Phone number", control: { type: "text" } @@ -161,7 +155,7 @@ export default { control: { type: "text" } }, patronPageChangePickupBodyText: { - defaultValue: "", + defaultValue: "Change pickup body text", control: { type: "text" } }, pickupBranchesDropdownLabelText: { @@ -177,7 +171,7 @@ export default { control: { type: "text" } }, patronPagePauseReservationsBodyText: { - defaultValue: "", + defaultValue: "Patron page pause reservations body text", control: { type: "text" } }, patronPageOpenPauseReservationsSectionText: { diff --git a/src/apps/patron-page/PatronPage.entry.tsx b/src/apps/patron-page/PatronPage.entry.tsx index 11a14c75b7..7b887476d5 100644 --- a/src/apps/patron-page/PatronPage.entry.tsx +++ b/src/apps/patron-page/PatronPage.entry.tsx @@ -6,6 +6,7 @@ import PatronPage from "./PatronPage"; import { BlockedPatronEntryTextProps } from "../../core/storybook/blockedArgs"; import withIsPatronBlockedHoc from "../../core/utils/withIsPatronBlockedHoc"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; interface PatronPageConfigProps { blacklistedPickupBranchesConfig: string; @@ -31,7 +32,6 @@ interface PatronPageTextProps { patronPinSavedSuccessText: string; dateInputsStartDateLabelText: string; dateInputsEndDateLabelText: string; - pauseReservationModalBelowInputsTextText: string; pauseReservationModalLinkText: string; pauseReservationModalSaveButtonLabelText: string; pauseReservationModalCancelButtonLabelText: string; @@ -39,7 +39,6 @@ interface PatronPageTextProps { patronPageBasicDetailsNameLabelText: string; patronPageBasicDetailsAddressLabelText: string; patronContactInfoHeaderText: string; - patronContactInfoBodyText: string; patronContactPhoneLabelText: string; patronContactPhoneCheckboxText: string; patronContactEmailLabelText: string; @@ -81,6 +80,7 @@ export interface PatronPageProps BlockedPatronEntryTextProps, PatronPageTextProps, PatronPageUrlProps, + GlobalEntryTextProps, GlobalUrlEntryPropsInterface {} const PatronPageEntry: FC = () => ; diff --git a/src/apps/recommender/Recommender.dev.tsx b/src/apps/recommender/Recommender.dev.tsx index ff65612926..faa2665962 100644 --- a/src/apps/recommender/Recommender.dev.tsx +++ b/src/apps/recommender/Recommender.dev.tsx @@ -2,12 +2,14 @@ import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import Recommender from "./Recommender.entry"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Recommender", component: Recommender, argTypes: { ...serviceUrlArgs, + ...globalTextArgs, emptyRecommenderSearchConfig: { defaultValue: "Mimbo jimbo", control: { type: "text" } @@ -48,18 +50,6 @@ export default { }, defaultValue: "For your inspiration" }, - addToFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Add @title to favorites list" - }, - removeFromFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Remove @title from favorites list" - }, materialUrl: { defaultValue: "/work/:workid", control: { type: "text" } diff --git a/src/apps/recommender/Recommender.entry.tsx b/src/apps/recommender/Recommender.entry.tsx index a5333a399c..a5eb7d87cf 100644 --- a/src/apps/recommender/Recommender.entry.tsx +++ b/src/apps/recommender/Recommender.entry.tsx @@ -5,6 +5,7 @@ import { withConfig } from "../../core/utils/config"; import { withUrls } from "../../core/utils/url"; import GuardedApp from "../../components/guarded-app"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface RecommenderProps { emptyRecommenderSearchConfig: string; @@ -14,12 +15,11 @@ export interface RecommenderProps { materialAndAuthorText: string; etAlText: string; recommenderTitleInspirationText: string; - addToFavoritesAriaLabelText: string; - removeFromFavoritesAriaLabelText: string; } export interface ReccommenderPropsInterface extends GlobalUrlEntryPropsInterface, + GlobalEntryTextProps, RecommenderProps { q?: string; pageSizeDesktop?: number; diff --git a/src/apps/reservation-list/list/reservation-list.dev.tsx b/src/apps/reservation-list/list/reservation-list.dev.tsx index 4f6f3ff491..28519ee3a0 100644 --- a/src/apps/reservation-list/list/reservation-list.dev.tsx +++ b/src/apps/reservation-list/list/reservation-list.dev.tsx @@ -8,6 +8,7 @@ import reservationMaterialDetailsProps from "../../../core/storybook/reservation import deleteReservationModalArgs from "../../../core/storybook/deleteReservationModalArgs"; import reservationListArgs from "../../../core/storybook/reservationListArgs"; import { getModalIds } from "../../../core/utils/helpers/modal-helpers"; +import globalTextArgs from "../../../core/storybook/globalTextArgs"; export default { title: "Apps / Reservation list", @@ -19,6 +20,7 @@ export default { ...reservationMaterialDetailsProps, ...blockedArgs, ...reservationListArgs, + ...globalTextArgs, blacklistedSearchBranchesConfig: { name: "Blacklisted branches", defaultValue: "FBS-751032,FBS-751031,FBS-751009,FBS-751027,FBS-751024", @@ -209,11 +211,6 @@ export default { defaultValue: "Settings", control: { type: "text" } }, - pauseReservationModalAriaDescriptionText: { - defaultValue: - "This modal makes it possible to pause your physical reservations", - control: { type: "text" } - }, pauseReservationModalHeaderText: { defaultValue: "Pause reservations on physical items", control: { type: "text" } @@ -235,10 +232,6 @@ export default { defaultValue: "End date", control: { type: "text" } }, - pauseReservationModalBelowInputsTextText: { - defaultValue: "", - control: { type: "text" } - }, pauseReservationModalLinkText: { defaultValue: "Read more about pausing reservertions and what that means here", diff --git a/src/apps/reservation-list/list/reservation-list.entry.tsx b/src/apps/reservation-list/list/reservation-list.entry.tsx index b378a3668e..3ef4de57cd 100644 --- a/src/apps/reservation-list/list/reservation-list.entry.tsx +++ b/src/apps/reservation-list/list/reservation-list.entry.tsx @@ -9,6 +9,7 @@ import { BlockedPatronEntryTextProps } from "../../../core/storybook/blockedArgs import GlobalUrlEntryPropsInterface from "../../../core/utils/types/global-url-props"; import { ReservationMaterialDetailsProps } from "../../../core/storybook/reservationMaterialDetailsArgs"; import { DeleteReservationModalArgs } from "../../../core/storybook/deleteReservationModalArgs"; +import { GlobalEntryTextProps } from "../../../core/storybook/globalTextArgs"; export interface ReservationListUrlProps { expirationWarningDaysBeforeConfig: string; @@ -51,13 +52,11 @@ export interface ReservationListTextProps { reservationListPauseReservationOnHoldText: string; reservationListOnHoldAriaText: string; reservationListPauseReservationAriaModalText: string; - pauseReservationModalAriaDescriptionText: string; pauseReservationModalHeaderText: string; pauseReservationModalBodyText: string; pauseReservationModalCloseModalText: string; dateInputsStartDateLabelText: string; dateInputsEndDateLabelText: string; - pauseReservationModalBelowInputsTextText: string; pauseReservationModalLinkText: string; pauseReservationModalSaveButtonLabelText: string; pauseReservationModalCancelButtonLabelText: string; @@ -77,6 +76,7 @@ export interface ReservationListEntryWithPageSizeProps ReservationListUrlProps, DeleteReservationModalArgs, ReservationMaterialDetailsProps, + GlobalEntryTextProps, GlobalUrlEntryPropsInterface { pageSizeDesktop?: number; pageSizeMobile?: number; diff --git a/src/apps/reservation-list/modal/pause-reservation/pause-reservation.tsx b/src/apps/reservation-list/modal/pause-reservation/pause-reservation.tsx index 673b67eb9e..f6477e474c 100644 --- a/src/apps/reservation-list/modal/pause-reservation/pause-reservation.tsx +++ b/src/apps/reservation-list/modal/pause-reservation/pause-reservation.tsx @@ -121,7 +121,7 @@ const PauseReservation: FC = ({ id, user }) => {

- {t("pauseReservationModalBelowInputsTextText")} + {t("pauseReservationModalBelowInputsText")} = () => { diff --git a/src/apps/search-result/search-result.dev.tsx b/src/apps/search-result/search-result.dev.tsx index 926d477a32..da55805351 100644 --- a/src/apps/search-result/search-result.dev.tsx +++ b/src/apps/search-result/search-result.dev.tsx @@ -4,12 +4,14 @@ import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import SearchResultEntry, { SearchResultEntryProps } from "./search-result.entry"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Search Result", component: SearchResultEntry, argTypes: { ...serviceUrlArgs, + ...globalTextArgs, q: { name: "Search string", defaultValue: "harry", @@ -156,6 +158,11 @@ export default { defaultValue: "Main languages", control: { type: "text" } }, + facetMaterialTypesText: { + name: "Material types text", + defaultValue: "Material types", + control: { type: "text" } + }, facetMaterialTypesGeneralText: { name: "Material types general text", defaultValue: "Material types general", @@ -196,28 +203,6 @@ export default { defaultValue: "+ more filters", control: { type: "text" } }, - addToFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Add @title to favorites list" - }, - removeFromFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Remove @title from favorites list" - }, - alertErrorCloseText: { - name: "Alert error close text", - defaultValue: "close", - control: { type: "text" } - }, - alertErrorMessageText: { - name: "Alert error message text", - defaultValue: "An error occurred", - control: { type: "text" } - }, loadingText: { name: "Loading", defaultValue: "Loading", diff --git a/src/apps/search-result/search-result.entry.tsx b/src/apps/search-result/search-result.entry.tsx index f67649694b..8c321a5d68 100644 --- a/src/apps/search-result/search-result.entry.tsx +++ b/src/apps/search-result/search-result.entry.tsx @@ -6,12 +6,10 @@ import { withText } from "../../core/utils/text"; import { withUrls } from "../../core/utils/url"; import SearchResult from "./search-result"; import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-props"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; interface SearchResultEntryTextProps { addMoreFiltersText: string; - addToFavoritesAriaLabelText: string; - alertErrorCloseText: string; - alertErrorMessageText: string; byAuthorText: string; etAlText: string; facetAccessTypesText: string; @@ -25,6 +23,7 @@ interface SearchResultEntryTextProps { facetFictionNonfictionText: string; facetGenreAndFormText: string; facetMainLanguagesText: string; + facetMaterialTypesText: string; facetMaterialTypesGeneralText: string; facetMaterialTypesSpecificText: string; facetSubjectsText: string; @@ -34,7 +33,6 @@ interface SearchResultEntryTextProps { inSeriesText: string; loadingText: string; numberDescriptionText: string; - removeFromFavoritesAriaLabelText: string; resultPagerStatusText: string; showingResultsForText: string; noSearchResultText: string; @@ -52,6 +50,7 @@ interface SearchResultEntryConfigProps { export interface SearchResultEntryProps extends GlobalUrlEntryPropsInterface, SearchResultEntryConfigProps, + GlobalEntryTextProps, SearchResultEntryTextProps { q?: string; pageSizeDesktop?: number; diff --git a/src/apps/something-similar/SomethingSimilar.dev.tsx b/src/apps/something-similar/SomethingSimilar.dev.tsx index d2b7174756..568a4dda03 100644 --- a/src/apps/something-similar/SomethingSimilar.dev.tsx +++ b/src/apps/something-similar/SomethingSimilar.dev.tsx @@ -3,6 +3,7 @@ import React from "react"; import { withQuery } from "@storybook/addon-queryparams"; import serviceUrlArgs from "../../core/storybook/serviceUrlArgs"; import SomethingSimilar from "./SomethingSimilar.entry"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; export default { title: "Apps / Something similar", @@ -10,6 +11,7 @@ export default { decorators: [withQuery], argTypes: { ...serviceUrlArgs, + ...globalTextArgs, somethingSimilarTitleText: { control: { type: "text" @@ -55,18 +57,6 @@ export default { type: "text" }, defaultValue: "Something similar" - }, - addToFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Add @title to favorites list" - }, - removeFromFavoritesAriaLabelText: { - control: { - type: "text" - }, - defaultValue: "Remove @title from favorites list" } } } as ComponentMeta; diff --git a/src/apps/something-similar/SomethingSimilar.entry.tsx b/src/apps/something-similar/SomethingSimilar.entry.tsx index 445ba00796..a9c83246ab 100644 --- a/src/apps/something-similar/SomethingSimilar.entry.tsx +++ b/src/apps/something-similar/SomethingSimilar.entry.tsx @@ -4,6 +4,7 @@ import { withText } from "../../core/utils/text"; import { withConfig } from "../../core/utils/config"; import { withUrls } from "../../core/utils/url"; import { FaustId } from "../../core/utils/types/ids"; +import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs"; export interface SomethingSimilarProps { fbsBaseUrl: string; @@ -19,12 +20,12 @@ export interface SomethingSimilarProps { etAlText: string; somethingSimilarByTheSameAuthorText: string; somethingSimilarSomethingSimilarAuthorText: string; - addToFavoritesAriaLabelText: string; - removeFromFavoritesAriaLabelText: string; faust: FaustId; } -const SomethingSimilarEntry: FC = ({ faust }) => { +const SomethingSimilarEntry: FC< + SomethingSimilarProps & GlobalEntryTextProps +> = ({ faust }) => { return ; }; diff --git a/src/components/availability-label/availability-label.dev.tsx b/src/components/availability-label/availability-label.dev.tsx index 27277e7f70..fd3a631898 100644 --- a/src/components/availability-label/availability-label.dev.tsx +++ b/src/components/availability-label/availability-label.dev.tsx @@ -9,6 +9,7 @@ import { AvailabilityLabelProps, AvailabilityLabel } from "./availability-label"; +import globalTextArgs from "../../core/storybook/globalTextArgs"; // The configuration below addresses the different variables, // their default values, and how they translate into storybook @@ -18,6 +19,7 @@ export default { component: AvailabilityLabel, argTypes: { ...serviceUrlArgs, + ...globalTextArgs, faustIds: { name: "Faust Ids", control: { type: "array" } diff --git a/src/components/blocked-patron/blocked-modal/BlockedModal.tsx b/src/components/blocked-patron/blocked-modal/BlockedModal.tsx index 6d2cd58c88..27dd479a64 100644 --- a/src/components/blocked-patron/blocked-modal/BlockedModal.tsx +++ b/src/components/blocked-patron/blocked-modal/BlockedModal.tsx @@ -17,6 +17,11 @@ const BlockedModal: FC = ({ blockedStatus }) => { const { blockedModal } = getModalIds(); + // If the user isn't actually blocked, don't render the modal. + if (!blockedStatus || blockedStatus === "") { + return null; + } + return ( = ({ {t("alertErrorMessageText")}