From 4452e58d6a88aacb8f40dafbf6a59dba4f79feac Mon Sep 17 00:00:00 2001 From: Ben Furber Date: Thu, 9 Jan 2025 13:08:14 +0000 Subject: [PATCH] chore: rename all library files --- .github/pr-labeler.config.yml | 4 +-- .../{icon-how-to.svg => icon-library.svg} | 0 .../src/UserStatistics/UserStatistics.tsx | 2 +- .../src/fixtures/{howto.ts => library.ts} | 0 .../{howto => library}/discussions.spec.ts | 2 +- .../{howto => library}/read.spec.ts | 0 .../{howto => library}/seo.spec.ts | 0 .../{howto => library}/write.spec.ts | 21 ++++---------- shared/mocks/data/index.ts | 2 +- shared/mocks/data/{howtos.ts => library.ts} | 0 .../{icon-how-to.svg => icon-library.svg} | 0 src/pages/Howto/Content/Common/index.ts | 19 ------------- src/pages/Howto/Content/Common/utils/index.ts | 1 - .../Content/Common/FormFieldWrapper.test.tsx | 2 +- .../Content/Common/FormFieldWrapper.tsx | 0 .../Content/Common/FormSettings.tsx | 0 .../Content/Common/Library.form.test.tsx} | 6 ++-- .../Content/Common/Library.form.tsx} | 28 +++++++++---------- .../Content/Common/LibraryButtonDraft.tsx} | 0 .../Content/Common/LibraryButtonPublish.tsx} | 0 .../Content/Common/LibraryCategory.field.tsx} | 6 ++-- .../Common/LibraryCategoryGuidance.test.tsx} | 6 ++-- .../Common/LibraryCategoryGuidance.tsx} | 0 .../Common/LibraryCoverImage.field.tsx} | 2 +- .../Common/LibraryCoverImageAlt.field.tsx} | 2 +- .../Common/LibraryDescription.field.test.tsx} | 4 +-- .../Common/LibraryDescription.field.tsx} | 2 +- .../Common/LibraryDifficulty.field.tsx} | 2 +- .../Content/Common/LibraryErrors.test.tsx} | 4 +-- .../Content/Common/LibraryErrors.tsx} | 2 +- .../Content/Common/LibraryFileLink.field.tsx} | 2 +- .../Common/LibraryFileUpload.field.tsx} | 2 +- .../Common/LibraryFiles.field.test.tsx} | 6 ++-- .../Content/Common/LibraryFiles.field.tsx} | 2 +- .../Content/Common/LibraryFormProvider.tsx} | 2 +- .../Common/LibraryPostingGuidelines.tsx} | 0 .../Common/LibraryStep.field.test.tsx} | 4 +-- .../Content/Common/LibraryStep.field.tsx} | 0 .../LibraryStepsContainer.field.test.tsx} | 4 +-- .../Common/LibraryStepsContainer.field.tsx} | 2 +- .../Content/Common/LibraryTags.field.tsx} | 2 +- .../Content/Common/LibraryTime.field.tsx} | 2 +- .../Common/LibraryTitle.field.test.tsx} | 12 ++++---- .../Content/Common/LibraryTitle.field.tsx} | 4 +-- .../Content/Common/SubmitStatus.tsx | 0 src/pages/Library/Content/Common/index.ts | 19 +++++++++++++ .../Content/List/LibraryCard.tsx} | 0 .../Content/List/LibraryList.tsx} | 8 +++--- .../Content/List/LibraryListHeader.tsx} | 6 ++-- .../Content/List/LibrarySortOptions.ts} | 0 .../Content/Page/Library.test.tsx} | 6 ++-- .../Content/Page/Library.tsx} | 6 ++-- .../Content/Page/LibraryDescription.tsx} | 4 +-- .../Content/Page/LibraryDiscussion.tsx} | 0 .../Content/Page/LibraryDownloads.tsx} | 2 +- .../Content/Page/LibraryStep.tsx} | 0 .../Content/utils}/downloadCooldown.ts | 0 src/pages/Library/Content/utils/index.ts | 1 + .../utils/transformLibraryErrors.test.ts} | 4 +-- .../Content/utils/transformLibraryErrors.ts} | 2 +- .../CreateLibrary.tsx} | 4 +-- .../CreateLibraryTemplate.tsx} | 0 .../EditHowto.tsx => Library/EditLibrary.tsx} | 2 +- .../EditLibraryTemplate.tsx} | 0 src/pages/{Howto => Library}/constants.ts | 0 src/pages/{Howto => Library}/labels.ts | 0 .../library.service.test.ts} | 2 +- .../library.service.ts} | 2 +- .../FormFields/QuestionCategory.field.tsx | 2 +- .../FormFields/QuestionDescription.field.tsx | 2 +- .../Common/FormFields/QuestionImage.field.tsx | 2 +- .../Common/FormFields/QuestionTags.field.tsx | 2 +- .../Common/FormFields/QuestionTitle.field.tsx | 2 +- .../content/sections/ChangeEmail.form.tsx | 2 +- .../content/sections/ChangePassword.form.tsx | 2 +- src/routes/_.library.$slug._index.tsx | 4 +-- src/routes/_.library.$slug.edit.tsx | 4 +-- src/routes/_.library._index.tsx | 2 +- src/routes/_.library.create.tsx | 2 +- .../library.store.test.ts} | 4 +-- .../library.store.tsx} | 0 src/stores/RootStore.tsx | 2 +- src/test/factories/{Howto.ts => Library.ts} | 0 src/utils/validators.ts | 2 +- 84 files changed, 127 insertions(+), 136 deletions(-) rename packages/components/assets/icons/{icon-how-to.svg => icon-library.svg} (100%) rename packages/cypress/src/fixtures/{howto.ts => library.ts} (100%) rename packages/cypress/src/integration/{howto => library}/discussions.spec.ts (98%) rename packages/cypress/src/integration/{howto => library}/read.spec.ts (100%) rename packages/cypress/src/integration/{howto => library}/seo.spec.ts (100%) rename packages/cypress/src/integration/{howto => library}/write.spec.ts (94%) rename shared/mocks/data/{howtos.ts => library.ts} (100%) rename src/assets/icons/{icon-how-to.svg => icon-library.svg} (100%) delete mode 100644 src/pages/Howto/Content/Common/index.ts delete mode 100644 src/pages/Howto/Content/Common/utils/index.ts rename src/pages/{Howto => Library}/Content/Common/FormFieldWrapper.test.tsx (94%) rename src/pages/{Howto => Library}/Content/Common/FormFieldWrapper.tsx (100%) rename src/pages/{Howto => Library}/Content/Common/FormSettings.tsx (100%) rename src/pages/{Howto/Content/Common/Howto.form.test.tsx => Library/Content/Common/Library.form.test.tsx} (96%) rename src/pages/{Howto/Content/Common/Howto.form.tsx => Library/Content/Common/Library.form.tsx} (91%) rename src/pages/{Howto/Content/Common/HowtoButtonDraft.tsx => Library/Content/Common/LibraryButtonDraft.tsx} (100%) rename src/pages/{Howto/Content/Common/HowtoButtonPublish.tsx => Library/Content/Common/LibraryButtonPublish.tsx} (100%) rename src/pages/{Howto/Content/Common/HowtoFieldCategory.tsx => Library/Content/Common/LibraryCategory.field.tsx} (89%) rename src/pages/{Howto/Content/Common/HowtoCategoryGuidance.test.tsx => Library/Content/Common/LibraryCategoryGuidance.test.tsx} (87%) rename src/pages/{Howto/Content/Common/HowtoCategoryGuidance.tsx => Library/Content/Common/LibraryCategoryGuidance.tsx} (100%) rename src/pages/{Howto/Content/Common/HowtoFieldCoverImage.tsx => Library/Content/Common/LibraryCoverImage.field.tsx} (91%) rename src/pages/{Howto/Content/Common/HowtoFieldCoverImageAlt.tsx => Library/Content/Common/LibraryCoverImageAlt.field.tsx} (88%) rename src/pages/{Howto/Content/Common/HowtoFieldDescription.test.tsx => Library/Content/Common/LibraryDescription.field.test.tsx} (76%) rename src/pages/{Howto/Content/Common/HowtoFieldDescription.tsx => Library/Content/Common/LibraryDescription.field.tsx} (92%) rename src/pages/{Howto/Content/Common/HowtoFieldDifficulty.tsx => Library/Content/Common/LibraryDifficulty.field.tsx} (91%) rename src/pages/{Howto/Content/Common/HowtoErrors.test.tsx => Library/Content/Common/LibraryErrors.test.tsx} (92%) rename src/pages/{Howto/Content/Common/HowtoErrors.tsx => Library/Content/Common/LibraryErrors.tsx} (93%) rename src/pages/{Howto/Content/Common/HowtoFieldFileLink.tsx => Library/Content/Common/LibraryFileLink.field.tsx} (91%) rename src/pages/{Howto/Content/Common/HowtoFieldFileUpload.tsx => Library/Content/Common/LibraryFileUpload.field.tsx} (93%) rename src/pages/{Howto/Content/Common/HowtoFieldFiles.test.tsx => Library/Content/Common/LibraryFiles.field.test.tsx} (91%) rename src/pages/{Howto/Content/Common/HowtoFieldFiles.tsx => Library/Content/Common/LibraryFiles.field.tsx} (98%) rename src/pages/{Howto/Content/Common/HowtoFormProvider.tsx => Library/Content/Common/LibraryFormProvider.tsx} (86%) rename src/pages/{Howto/Content/Common/HowtoPostingGuidelines.tsx => Library/Content/Common/LibraryPostingGuidelines.tsx} (100%) rename src/pages/{Howto/Content/Common/howtofieldstep.test.tsx => Library/Content/Common/LibraryStep.field.test.tsx} (80%) rename src/pages/{Howto/Content/Common/HowtoFieldStep.tsx => Library/Content/Common/LibraryStep.field.tsx} (100%) rename src/pages/{Howto/Content/Common/HowtoFieldStepsContainer.test.tsx => Library/Content/Common/LibraryStepsContainer.field.test.tsx} (75%) rename src/pages/{Howto/Content/Common/HowtoFieldStepsContainer.tsx => Library/Content/Common/LibraryStepsContainer.field.tsx} (97%) rename src/pages/{Howto/Content/Common/HowtoFieldTags.tsx => Library/Content/Common/LibraryTags.field.tsx} (84%) rename src/pages/{Howto/Content/Common/HowtoFieldTime.tsx => Library/Content/Common/LibraryTime.field.tsx} (91%) rename src/pages/{Howto/Content/Common/HowtoFieldTitle.test.tsx => Library/Content/Common/LibraryTitle.field.test.tsx} (61%) rename src/pages/{Howto/Content/Common/HowtoFieldTitle.tsx => Library/Content/Common/LibraryTitle.field.tsx} (93%) rename src/pages/{Howto => Library}/Content/Common/SubmitStatus.tsx (100%) create mode 100644 src/pages/Library/Content/Common/index.ts rename src/pages/{Howto/Content/HowtoList/HowToCard.tsx => Library/Content/List/LibraryCard.tsx} (100%) rename src/pages/{Howto/Content/HowtoList/HowtoList.tsx => Library/Content/List/LibraryList.tsx} (95%) rename src/pages/{Howto/Content/HowtoList/HowtoListHeader.tsx => Library/Content/List/LibraryListHeader.tsx} (96%) rename src/pages/{Howto/Content/HowtoList/HowtoSortOptions.ts => Library/Content/List/LibrarySortOptions.ts} (100%) rename src/pages/{Howto/Content/Howto/Howto.test.tsx => Library/Content/Page/Library.test.tsx} (98%) rename src/pages/{Howto/Content/Howto/Howto.tsx => Library/Content/Page/Library.tsx} (96%) rename src/pages/{Howto/Content/Howto/HowtoDescription/HowtoDescription.tsx => Library/Content/Page/LibraryDescription.tsx} (98%) rename src/pages/{Howto/Content/Howto/HowToDiscussion/HowToDiscussion.tsx => Library/Content/Page/LibraryDiscussion.tsx} (100%) rename src/pages/{Howto/Content/Howto/HowtoDownloads/HowtoDownloads.tsx => Library/Content/Page/LibraryDownloads.tsx} (97%) rename src/pages/{Howto/Content/Howto/Step/Step.tsx => Library/Content/Page/LibraryStep.tsx} (100%) rename src/pages/{Howto/Content/Howto/HowtoDownloads => Library/Content/utils}/downloadCooldown.ts (100%) create mode 100644 src/pages/Library/Content/utils/index.ts rename src/pages/{Howto/Content/Common/utils/transformHowtoErrors.test.ts => Library/Content/utils/transformLibraryErrors.test.ts} (91%) rename src/pages/{Howto/Content/Common/utils/transformHowtoErrors.ts => Library/Content/utils/transformLibraryErrors.ts} (98%) rename src/pages/{Howto/Content/CreateHowto/CreateHowto.tsx => Library/CreateLibrary.tsx} (72%) rename src/pages/{Howto/Content/CreateHowto/Template.tsx => Library/CreateLibraryTemplate.tsx} (100%) rename src/pages/{Howto/Content/EditHowto/EditHowto.tsx => Library/EditLibrary.tsx} (94%) rename src/pages/{Howto/Content/EditHowto/Template.tsx => Library/EditLibraryTemplate.tsx} (100%) rename src/pages/{Howto => Library}/constants.ts (100%) rename src/pages/{Howto => Library}/labels.ts (100%) rename src/pages/{Howto/howto.service.test.ts => Library/library.service.test.ts} (98%) rename src/pages/{Howto/howto.service.ts => Library/library.service.ts} (98%) rename src/stores/{Howto/howto.store.test.ts => Library/library.store.test.ts} (98%) rename src/stores/{Howto/howto.store.tsx => Library/library.store.tsx} (100%) rename src/test/factories/{Howto.ts => Library.ts} (100%) diff --git a/.github/pr-labeler.config.yml b/.github/pr-labeler.config.yml index 16d2ef1123..5085c1167e 100644 --- a/.github/pr-labeler.config.yml +++ b/.github/pr-labeler.config.yml @@ -1,6 +1,6 @@ # Configuration for pr-labeller actions -"Mod: HowTo 📰": - - src/pages/Howto/**/* +"Mod: Library 📰": + - src/pages/Library/**/* "Mod: Maps 🗺": - src/pages/Maps/**/* "Mod: Research 🔬": diff --git a/packages/components/assets/icons/icon-how-to.svg b/packages/components/assets/icons/icon-library.svg similarity index 100% rename from packages/components/assets/icons/icon-how-to.svg rename to packages/components/assets/icons/icon-library.svg diff --git a/packages/components/src/UserStatistics/UserStatistics.tsx b/packages/components/src/UserStatistics/UserStatistics.tsx index bc48b59039..19672c88fe 100644 --- a/packages/components/src/UserStatistics/UserStatistics.tsx +++ b/packages/components/src/UserStatistics/UserStatistics.tsx @@ -1,6 +1,6 @@ import { Box, Card, Flex } from 'theme-ui' -import HowToCountIcon from '../../assets/icons/icon-how-to.svg' +import HowToCountIcon from '../../assets/icons/icon-library.svg' import ResearchIcon from '../../assets/icons/icon-research.svg' import starActiveSVG from '../../assets/icons/icon-star-active.svg' import { ElWithBeforeIcon } from '../ElWithBeforeIcon/ElWithBeforeIcon' diff --git a/packages/cypress/src/fixtures/howto.ts b/packages/cypress/src/fixtures/library.ts similarity index 100% rename from packages/cypress/src/fixtures/howto.ts rename to packages/cypress/src/fixtures/library.ts diff --git a/packages/cypress/src/integration/howto/discussions.spec.ts b/packages/cypress/src/integration/library/discussions.spec.ts similarity index 98% rename from packages/cypress/src/integration/howto/discussions.spec.ts rename to packages/cypress/src/integration/library/discussions.spec.ts index a69df0acf5..f39e644335 100644 --- a/packages/cypress/src/integration/howto/discussions.spec.ts +++ b/packages/cypress/src/integration/library/discussions.spec.ts @@ -4,7 +4,7 @@ import { ExternalLinkLabel } from 'oa-shared' import { MOCK_DATA } from '../../data' -import { howto } from '../../fixtures/howto' +import { howto } from '../../fixtures/library' import { generateNewUserDetails } from '../../utils/TestUtils' const howtos = Object.values(MOCK_DATA.howtos) diff --git a/packages/cypress/src/integration/howto/read.spec.ts b/packages/cypress/src/integration/library/read.spec.ts similarity index 100% rename from packages/cypress/src/integration/howto/read.spec.ts rename to packages/cypress/src/integration/library/read.spec.ts diff --git a/packages/cypress/src/integration/howto/seo.spec.ts b/packages/cypress/src/integration/library/seo.spec.ts similarity index 100% rename from packages/cypress/src/integration/howto/seo.spec.ts rename to packages/cypress/src/integration/library/seo.spec.ts diff --git a/packages/cypress/src/integration/howto/write.spec.ts b/packages/cypress/src/integration/library/write.spec.ts similarity index 94% rename from packages/cypress/src/integration/howto/write.spec.ts rename to packages/cypress/src/integration/library/write.spec.ts index b6c40cd405..e82c03b6a8 100644 --- a/packages/cypress/src/integration/howto/write.spec.ts +++ b/packages/cypress/src/integration/library/write.spec.ts @@ -1,11 +1,6 @@ import { faker } from '@faker-js/faker' import { DifficultyLevel, IModerationStatus } from 'oa-shared' -import { - HOWTO_STEP_DESCRIPTION_MAX_LENGTH, - HOWTO_TITLE_MIN_LENGTH, -} from '../../../../../src/pages/Howto/constants' -import { guidance, headings } from '../../../../../src/pages/Howto/labels' import { generateNewUserDetails } from '../../utils/TestUtils' describe('[Library]', () => { @@ -150,10 +145,7 @@ describe('[Library]', () => { }, { _animationKey: 'unique3', - text: faker.lorem - .sentences(50) - .slice(0, HOWTO_STEP_DESCRIPTION_MAX_LENGTH) - .trim(), + text: faker.lorem.sentences(50).slice(0, 1000).trim(), title: 'A long title that is the total characters limit of', videoURL: 'https://www.youtube.com/watch?v=Os7dREQ00l4', }, @@ -183,8 +175,9 @@ describe('[Library]', () => { 'images/howto-step-pic1.jpg', 'images/howto-step-pic2.jpg', ] - const categoryGuidanceMain = guidance.moulds.main.slice(0, 40) - const categoryGuidanceFiles = guidance.moulds.files + const categoryGuidanceMain = + 'Cover image should show the fully built mould' + const categoryGuidanceFiles = 'Include files to replicate the mould' cy.signUpNewUser(creator) cy.get('[data-cy=loader]').should('not.exist') @@ -210,14 +203,12 @@ describe('[Library]', () => { cy.step('Warn if title has less than minimum required characters') cy.fillIntroTitle('qwer') - cy.contains( - `Should be more than ${HOWTO_TITLE_MIN_LENGTH} characters`, - ).should('be.visible') + cy.contains(`Should be more than ${5} characters`).should('be.visible') cy.step('Cannot be published yet') cy.get('[data-cy=submit]').click() cy.get('[data-cy=errors-container]').should('be.visible') - cy.contains(headings.errors).should('be.visible') + cy.contains("Ouch, something's wrong").should('be.visible') cy.contains('Make sure this field is filled correctly').should( 'be.visible', ) diff --git a/shared/mocks/data/index.ts b/shared/mocks/data/index.ts index e3bfa2da09..52ecf03891 100644 --- a/shared/mocks/data/index.ts +++ b/shared/mocks/data/index.ts @@ -1,6 +1,6 @@ export { categories } from './categories' export { discussions } from './discussions' -export { howtos } from './howtos' +export { howtos } from './library' export { mappins } from './mappins' export { questionCategories } from './questionCategories' export { questions } from './questions' diff --git a/shared/mocks/data/howtos.ts b/shared/mocks/data/library.ts similarity index 100% rename from shared/mocks/data/howtos.ts rename to shared/mocks/data/library.ts diff --git a/src/assets/icons/icon-how-to.svg b/src/assets/icons/icon-library.svg similarity index 100% rename from src/assets/icons/icon-how-to.svg rename to src/assets/icons/icon-library.svg diff --git a/src/pages/Howto/Content/Common/index.ts b/src/pages/Howto/Content/Common/index.ts deleted file mode 100644 index 3ca756cdda..0000000000 --- a/src/pages/Howto/Content/Common/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -export { FormFieldWrapper } from './FormFieldWrapper' -export { HowtoButtonDraft } from './HowtoButtonDraft' -export { HowtoButtonPublish } from './HowtoButtonPublish' -export { HowtoCategoryGuidance } from './HowtoCategoryGuidance' -export { HowtoErrors } from './HowtoErrors' -export { HowtoFieldCategory } from './HowtoFieldCategory' -export { HowtoFieldCoverImage } from './HowtoFieldCoverImage' -export { HowtoFieldDescription } from './HowtoFieldDescription' -export { HowtoFieldDifficulty } from './HowtoFieldDifficulty' -export { HowtoFieldFileLink } from './HowtoFieldFileLink' -export { HowtoFieldFiles } from './HowtoFieldFiles' -export { HowtoFieldFileUpload } from './HowtoFieldFileUpload' -export { HowtoFieldStep } from './HowtoFieldStep' -export { HowtoFieldStepsContainer } from './HowtoFieldStepsContainer' -export { HowtoFieldTags } from './HowtoFieldTags' -export { HowtoFieldTime } from './HowtoFieldTime' -export { HowtoFieldTitle } from './HowtoFieldTitle' -export { HowToSubmitStatus } from './SubmitStatus' -export { HowtoPostingGuidelines } from './HowtoPostingGuidelines' diff --git a/src/pages/Howto/Content/Common/utils/index.ts b/src/pages/Howto/Content/Common/utils/index.ts deleted file mode 100644 index 7ab05a7ba2..0000000000 --- a/src/pages/Howto/Content/Common/utils/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { transformHowtoErrors } from './transformHowtoErrors' diff --git a/src/pages/Howto/Content/Common/FormFieldWrapper.test.tsx b/src/pages/Library/Content/Common/FormFieldWrapper.test.tsx similarity index 94% rename from src/pages/Howto/Content/Common/FormFieldWrapper.test.tsx rename to src/pages/Library/Content/Common/FormFieldWrapper.test.tsx index 21cce2bd65..f6b5cc2b14 100644 --- a/src/pages/Howto/Content/Common/FormFieldWrapper.test.tsx +++ b/src/pages/Library/Content/Common/FormFieldWrapper.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react' import { describe, it } from 'vitest' import { FormFieldWrapper } from './FormFieldWrapper' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoFormProvider } from './LibraryFormProvider' describe('FormFieldWrapper', () => { it('renders the props', async () => { diff --git a/src/pages/Howto/Content/Common/FormFieldWrapper.tsx b/src/pages/Library/Content/Common/FormFieldWrapper.tsx similarity index 100% rename from src/pages/Howto/Content/Common/FormFieldWrapper.tsx rename to src/pages/Library/Content/Common/FormFieldWrapper.tsx diff --git a/src/pages/Howto/Content/Common/FormSettings.tsx b/src/pages/Library/Content/Common/FormSettings.tsx similarity index 100% rename from src/pages/Howto/Content/Common/FormSettings.tsx rename to src/pages/Library/Content/Common/FormSettings.tsx diff --git a/src/pages/Howto/Content/Common/Howto.form.test.tsx b/src/pages/Library/Content/Common/Library.form.test.tsx similarity index 96% rename from src/pages/Howto/Content/Common/Howto.form.test.tsx rename to src/pages/Library/Content/Common/Library.form.test.tsx index 4b8263735e..c509814c28 100644 --- a/src/pages/Howto/Content/Common/Howto.form.test.tsx +++ b/src/pages/Library/Content/Common/Library.form.test.tsx @@ -5,14 +5,14 @@ import { act, fireEvent, render, waitFor } from '@testing-library/react' import { ThemeProvider } from '@theme-ui/core' import { Provider } from 'mobx-react' import { useCommonStores } from 'src/common/hooks/useCommonStores' -import { FactoryHowto } from 'src/test/factories/Howto' +import { FactoryHowto } from 'src/test/factories/Library' import { testingThemeStyles } from 'src/test/utils/themeUtils' import { describe, expect, it, vi } from 'vitest' -import { HowtoForm } from './Howto.form' +import { HowtoForm } from './Library.form' import type { ILibrary } from 'oa-shared' -import type { ParentType } from './Howto.form' +import type { ParentType } from './Library.form' const Theme = testingThemeStyles diff --git a/src/pages/Howto/Content/Common/Howto.form.tsx b/src/pages/Library/Content/Common/Library.form.tsx similarity index 91% rename from src/pages/Howto/Content/Common/Howto.form.tsx rename to src/pages/Library/Content/Common/Library.form.tsx index 324e30263c..cc8002c892 100644 --- a/src/pages/Howto/Content/Common/Howto.form.tsx +++ b/src/pages/Library/Content/Common/Library.form.tsx @@ -18,20 +18,20 @@ import { import { Box, Card, Flex, Heading } from 'theme-ui' import { headings, intro } from '../../labels' -import { HowtoButtonDraft } from './HowtoButtonDraft' -import { HowtoButtonPublish } from './HowtoButtonPublish' -import { HowtoErrors } from './HowtoErrors' -import { HowtoFieldCategory } from './HowtoFieldCategory' -import { HowtoFieldCoverImage } from './HowtoFieldCoverImage' -import { HowtoFieldCoverImageAlt } from './HowtoFieldCoverImageAlt' -import { HowtoFieldDescription } from './HowtoFieldDescription' -import { HowtoFieldDifficulty } from './HowtoFieldDifficulty' -import { HowtoFieldFiles } from './HowtoFieldFiles' -import { HowtoFieldStepsContainer } from './HowtoFieldStepsContainer' -import { HowtoFieldTags } from './HowtoFieldTags' -import { HowtoFieldTime } from './HowtoFieldTime' -import { HowtoFieldTitle } from './HowtoFieldTitle' -import { HowtoPostingGuidelines } from './HowtoPostingGuidelines' +import { HowtoButtonDraft } from './LibraryButtonDraft' +import { HowtoButtonPublish } from './LibraryButtonPublish' +import { HowtoFieldCategory } from './LibraryCategory.field' +import { HowtoFieldCoverImage } from './LibraryCoverImage.field' +import { HowtoFieldCoverImageAlt } from './LibraryCoverImageAlt.field' +import { HowtoFieldDescription } from './LibraryDescription.field' +import { HowtoFieldDifficulty } from './LibraryDifficulty.field' +import { HowtoErrors } from './LibraryErrors' +import { HowtoFieldFiles } from './LibraryFiles.field' +import { HowtoPostingGuidelines } from './LibraryPostingGuidelines' +import { HowtoFieldStepsContainer } from './LibraryStepsContainer.field' +import { HowtoFieldTags } from './LibraryTags.field' +import { HowtoFieldTime } from './LibraryTime.field' +import { HowtoFieldTitle } from './LibraryTitle.field' import { HowToSubmitStatus } from './SubmitStatus' import type { FormApi } from 'final-form' diff --git a/src/pages/Howto/Content/Common/HowtoButtonDraft.tsx b/src/pages/Library/Content/Common/LibraryButtonDraft.tsx similarity index 100% rename from src/pages/Howto/Content/Common/HowtoButtonDraft.tsx rename to src/pages/Library/Content/Common/LibraryButtonDraft.tsx diff --git a/src/pages/Howto/Content/Common/HowtoButtonPublish.tsx b/src/pages/Library/Content/Common/LibraryButtonPublish.tsx similarity index 100% rename from src/pages/Howto/Content/Common/HowtoButtonPublish.tsx rename to src/pages/Library/Content/Common/LibraryButtonPublish.tsx diff --git a/src/pages/Howto/Content/Common/HowtoFieldCategory.tsx b/src/pages/Library/Content/Common/LibraryCategory.field.tsx similarity index 89% rename from src/pages/Howto/Content/Common/HowtoFieldCategory.tsx rename to src/pages/Library/Content/Common/LibraryCategory.field.tsx index 7230192fcd..690c225c4e 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldCategory.tsx +++ b/src/pages/Library/Content/Common/LibraryCategory.field.tsx @@ -4,10 +4,10 @@ import { CategoriesSelectV2 } from 'src/pages/common/Category/CategoriesSelectV2 import { FormFieldWrapper, HowtoCategoryGuidance, -} from 'src/pages/Howto/Content/Common' -import { intro } from 'src/pages/Howto/labels' +} from 'src/pages/Library/Content/Common' +import { intro } from 'src/pages/Library/labels' -import { howtoService } from '../../howto.service' +import { howtoService } from '../../library.service' import type { SelectValue } from 'src/pages/common/Category/CategoriesSelectV2' diff --git a/src/pages/Howto/Content/Common/HowtoCategoryGuidance.test.tsx b/src/pages/Library/Content/Common/LibraryCategoryGuidance.test.tsx similarity index 87% rename from src/pages/Howto/Content/Common/HowtoCategoryGuidance.test.tsx rename to src/pages/Library/Content/Common/LibraryCategoryGuidance.test.tsx index 20d80b7944..a15313aa64 100644 --- a/src/pages/Howto/Content/Common/HowtoCategoryGuidance.test.tsx +++ b/src/pages/Library/Content/Common/LibraryCategoryGuidance.test.tsx @@ -1,10 +1,10 @@ import { render, screen } from '@testing-library/react' -import { guidance } from 'src/pages/Howto/labels' +import { guidance } from 'src/pages/Library/labels' import { FactoryCategory } from 'src/test/factories/Category' import { describe, expect, it } from 'vitest' -import { HowtoCategoryGuidance } from './HowtoCategoryGuidance' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoCategoryGuidance } from './LibraryCategoryGuidance' +import { HowtoFormProvider } from './LibraryFormProvider' describe('HowtoCategoryGuidance', () => { it('renders expected main content when a category that exists is present', async () => { diff --git a/src/pages/Howto/Content/Common/HowtoCategoryGuidance.tsx b/src/pages/Library/Content/Common/LibraryCategoryGuidance.tsx similarity index 100% rename from src/pages/Howto/Content/Common/HowtoCategoryGuidance.tsx rename to src/pages/Library/Content/Common/LibraryCategoryGuidance.tsx diff --git a/src/pages/Howto/Content/Common/HowtoFieldCoverImage.tsx b/src/pages/Library/Content/Common/LibraryCoverImage.field.tsx similarity index 91% rename from src/pages/Howto/Content/Common/HowtoFieldCoverImage.tsx rename to src/pages/Library/Content/Common/LibraryCoverImage.field.tsx index 699d4e087c..0bf7452bba 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldCoverImage.tsx +++ b/src/pages/Library/Content/Common/LibraryCoverImage.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { ImageInputField } from 'src/common/Form/ImageInput.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { draftValidationWrapper, required } from 'src/utils/validators' import { Box, Text } from 'theme-ui' diff --git a/src/pages/Howto/Content/Common/HowtoFieldCoverImageAlt.tsx b/src/pages/Library/Content/Common/LibraryCoverImageAlt.field.tsx similarity index 88% rename from src/pages/Howto/Content/Common/HowtoFieldCoverImageAlt.tsx rename to src/pages/Library/Content/Common/LibraryCoverImageAlt.field.tsx index 3a12f8b43a..b49c8947c1 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldCoverImageAlt.tsx +++ b/src/pages/Library/Content/Common/LibraryCoverImageAlt.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { FieldInput } from 'oa-components' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { Box, Text } from 'theme-ui' import { intro } from '../../labels' diff --git a/src/pages/Howto/Content/Common/HowtoFieldDescription.test.tsx b/src/pages/Library/Content/Common/LibraryDescription.field.test.tsx similarity index 76% rename from src/pages/Howto/Content/Common/HowtoFieldDescription.test.tsx rename to src/pages/Library/Content/Common/LibraryDescription.field.test.tsx index 19cc50ad4a..60fa9f3592 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldDescription.test.tsx +++ b/src/pages/Library/Content/Common/LibraryDescription.field.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react' import { describe, it } from 'vitest' -import { HowtoFieldDescription } from './HowtoFieldDescription' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoFieldDescription } from './LibraryDescription.field' +import { HowtoFormProvider } from './LibraryFormProvider' describe('HowtoFieldStepsDescription', () => { it('renders', async () => { diff --git a/src/pages/Howto/Content/Common/HowtoFieldDescription.tsx b/src/pages/Library/Content/Common/LibraryDescription.field.tsx similarity index 92% rename from src/pages/Howto/Content/Common/HowtoFieldDescription.tsx rename to src/pages/Library/Content/Common/LibraryDescription.field.tsx index d8a7a6a1d6..7c3ad67d51 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldDescription.tsx +++ b/src/pages/Library/Content/Common/LibraryDescription.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { FieldTextarea } from 'oa-components' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { draftValidationWrapper, required } from 'src/utils/validators' diff --git a/src/pages/Howto/Content/Common/HowtoFieldDifficulty.tsx b/src/pages/Library/Content/Common/LibraryDifficulty.field.tsx similarity index 91% rename from src/pages/Howto/Content/Common/HowtoFieldDifficulty.tsx rename to src/pages/Library/Content/Common/LibraryDifficulty.field.tsx index 47d8d7ac79..13ee798aeb 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldDifficulty.tsx +++ b/src/pages/Library/Content/Common/LibraryDifficulty.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { SelectField } from 'src/common/Form/Select.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { draftValidationWrapper, required } from 'src/utils/validators' diff --git a/src/pages/Howto/Content/Common/HowtoErrors.test.tsx b/src/pages/Library/Content/Common/LibraryErrors.test.tsx similarity index 92% rename from src/pages/Howto/Content/Common/HowtoErrors.test.tsx rename to src/pages/Library/Content/Common/LibraryErrors.test.tsx index 95db5253f0..062565ad20 100644 --- a/src/pages/Howto/Content/Common/HowtoErrors.test.tsx +++ b/src/pages/Library/Content/Common/LibraryErrors.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react' import { describe, expect, it } from 'vitest' -import { HowtoErrors } from './HowtoErrors' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoErrors } from './LibraryErrors' +import { HowtoFormProvider } from './LibraryFormProvider' describe('HowtoErrors', () => { it('renders component when visible and has intro errors', async () => { diff --git a/src/pages/Howto/Content/Common/HowtoErrors.tsx b/src/pages/Library/Content/Common/LibraryErrors.tsx similarity index 93% rename from src/pages/Howto/Content/Common/HowtoErrors.tsx rename to src/pages/Library/Content/Common/LibraryErrors.tsx index 6bc7eb395a..7d3fb650be 100644 --- a/src/pages/Howto/Content/Common/HowtoErrors.tsx +++ b/src/pages/Library/Content/Common/LibraryErrors.tsx @@ -1,6 +1,6 @@ import { ErrorsContainer } from 'src/common/Form/ErrorsContainer' -import { transformHowtoErrors } from './utils/' +import { transformHowtoErrors } from '../utils' import type { IErrorsListSet, ITopLevelErrorsList } from 'src/common/Form/types' diff --git a/src/pages/Howto/Content/Common/HowtoFieldFileLink.tsx b/src/pages/Library/Content/Common/LibraryFileLink.field.tsx similarity index 91% rename from src/pages/Howto/Content/Common/HowtoFieldFileLink.tsx rename to src/pages/Library/Content/Common/LibraryFileLink.field.tsx index 70af9b8621..c65efce6f6 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldFileLink.tsx +++ b/src/pages/Library/Content/Common/LibraryFileLink.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { FieldInput } from 'oa-components' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { draftValidationWrapper, diff --git a/src/pages/Howto/Content/Common/HowtoFieldFileUpload.tsx b/src/pages/Library/Content/Common/LibraryFileUpload.field.tsx similarity index 93% rename from src/pages/Howto/Content/Common/HowtoFieldFileUpload.tsx rename to src/pages/Library/Content/Common/LibraryFileUpload.field.tsx index e124bce60b..027ffd52a0 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldFileUpload.tsx +++ b/src/pages/Library/Content/Common/LibraryFileUpload.field.tsx @@ -2,7 +2,7 @@ import { Field } from 'react-final-form' import { UserRole } from 'oa-shared' import { AuthWrapper } from 'src/common/AuthWrapper' import { FileInputField } from 'src/common/Form/FileInput.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { Text } from 'theme-ui' import { intro } from '../../labels' diff --git a/src/pages/Howto/Content/Common/HowtoFieldFiles.test.tsx b/src/pages/Library/Content/Common/LibraryFiles.field.test.tsx similarity index 91% rename from src/pages/Howto/Content/Common/HowtoFieldFiles.test.tsx rename to src/pages/Library/Content/Common/LibraryFiles.field.test.tsx index a779619175..9868b95127 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldFiles.test.tsx +++ b/src/pages/Library/Content/Common/LibraryFiles.field.test.tsx @@ -1,10 +1,10 @@ import { render, screen } from '@testing-library/react' -import { guidance } from 'src/pages/Howto/labels' +import { guidance } from 'src/pages/Library/labels' import { FactoryCategory } from 'src/test/factories/Category' import { describe, it, vi } from 'vitest' -import { HowtoFieldFiles } from './HowtoFieldFiles' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoFieldFiles } from './LibraryFiles.field' +import { HowtoFormProvider } from './LibraryFormProvider' vi.mock('src/common/hooks/useCommonStores', () => { return { diff --git a/src/pages/Howto/Content/Common/HowtoFieldFiles.tsx b/src/pages/Library/Content/Common/LibraryFiles.field.tsx similarity index 98% rename from src/pages/Howto/Content/Common/HowtoFieldFiles.tsx rename to src/pages/Library/Content/Common/LibraryFiles.field.tsx index 5379a59e5d..5a44659348 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldFiles.tsx +++ b/src/pages/Library/Content/Common/LibraryFiles.field.tsx @@ -4,7 +4,7 @@ import { HowtoCategoryGuidance, HowtoFieldFileLink, HowtoFieldFileUpload, -} from 'src/pages/Howto/Content/Common' +} from 'src/pages/Library/Content/Common' import { Flex, Text } from 'theme-ui' import { buttons, headings, intro } from '../../labels' diff --git a/src/pages/Howto/Content/Common/HowtoFormProvider.tsx b/src/pages/Library/Content/Common/LibraryFormProvider.tsx similarity index 86% rename from src/pages/Howto/Content/Common/HowtoFormProvider.tsx rename to src/pages/Library/Content/Common/LibraryFormProvider.tsx index a8e8d02b3e..978e359c5e 100644 --- a/src/pages/Howto/Content/Common/HowtoFormProvider.tsx +++ b/src/pages/Library/Content/Common/LibraryFormProvider.tsx @@ -1,6 +1,6 @@ import { Form } from 'react-final-form' import arrayMutators from 'final-form-arrays' -import { FactoryHowto } from 'src/test/factories/Howto' +import { FactoryHowto } from 'src/test/factories/Library' import { vi } from 'vitest' export const HowtoFormProvider = ({ diff --git a/src/pages/Howto/Content/Common/HowtoPostingGuidelines.tsx b/src/pages/Library/Content/Common/LibraryPostingGuidelines.tsx similarity index 100% rename from src/pages/Howto/Content/Common/HowtoPostingGuidelines.tsx rename to src/pages/Library/Content/Common/LibraryPostingGuidelines.tsx diff --git a/src/pages/Howto/Content/Common/howtofieldstep.test.tsx b/src/pages/Library/Content/Common/LibraryStep.field.test.tsx similarity index 80% rename from src/pages/Howto/Content/Common/howtofieldstep.test.tsx rename to src/pages/Library/Content/Common/LibraryStep.field.test.tsx index 0e62468ade..c0699c7ec0 100644 --- a/src/pages/Howto/Content/Common/howtofieldstep.test.tsx +++ b/src/pages/Library/Content/Common/LibraryStep.field.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react' import { describe, it, vi } from 'vitest' -import { HowtoFieldStep } from './HowtoFieldStep' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoFormProvider } from './LibraryFormProvider' +import { HowtoFieldStep } from './LibraryStep.field' describe('HowtoFieldStep', () => { it('renders', async () => { diff --git a/src/pages/Howto/Content/Common/HowtoFieldStep.tsx b/src/pages/Library/Content/Common/LibraryStep.field.tsx similarity index 100% rename from src/pages/Howto/Content/Common/HowtoFieldStep.tsx rename to src/pages/Library/Content/Common/LibraryStep.field.tsx diff --git a/src/pages/Howto/Content/Common/HowtoFieldStepsContainer.test.tsx b/src/pages/Library/Content/Common/LibraryStepsContainer.field.test.tsx similarity index 75% rename from src/pages/Howto/Content/Common/HowtoFieldStepsContainer.test.tsx rename to src/pages/Library/Content/Common/LibraryStepsContainer.field.test.tsx index 93e5ea6d51..ae82a205b0 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldStepsContainer.test.tsx +++ b/src/pages/Library/Content/Common/LibraryStepsContainer.field.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react' import { describe, it } from 'vitest' -import { HowtoFieldStepsContainer } from './HowtoFieldStepsContainer' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoFormProvider } from './LibraryFormProvider' +import { HowtoFieldStepsContainer } from './LibraryStepsContainer.field' describe('HowtoFieldStepsContainer', () => { it('renders', async () => { diff --git a/src/pages/Howto/Content/Common/HowtoFieldStepsContainer.tsx b/src/pages/Library/Content/Common/LibraryStepsContainer.field.tsx similarity index 97% rename from src/pages/Howto/Content/Common/HowtoFieldStepsContainer.tsx rename to src/pages/Library/Content/Common/LibraryStepsContainer.field.tsx index 5eef1fdf8e..1bd05cb823 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldStepsContainer.tsx +++ b/src/pages/Library/Content/Common/LibraryStepsContainer.field.tsx @@ -1,7 +1,7 @@ import { FieldArray } from 'react-final-form-arrays' import { AnimatePresence, motion } from 'framer-motion' import { Button } from 'oa-components' -import { HowtoFieldStep } from 'src/pages/Howto/Content/Common/HowtoFieldStep' +import { HowtoFieldStep } from 'src/pages/Library/Content/Common/LibraryStep.field' import { COMPARISONS } from 'src/utils/comparisons' import { Box, Flex, Heading, Text } from 'theme-ui' diff --git a/src/pages/Howto/Content/Common/HowtoFieldTags.tsx b/src/pages/Library/Content/Common/LibraryTags.field.tsx similarity index 84% rename from src/pages/Howto/Content/Common/HowtoFieldTags.tsx rename to src/pages/Library/Content/Common/LibraryTags.field.tsx index 979b5d8f5e..51d4aa6a1d 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldTags.tsx +++ b/src/pages/Library/Content/Common/LibraryTags.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { TagsSelectField } from 'src/common/Form/TagsSelect.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { intro } from '../../labels' diff --git a/src/pages/Howto/Content/Common/HowtoFieldTime.tsx b/src/pages/Library/Content/Common/LibraryTime.field.tsx similarity index 91% rename from src/pages/Howto/Content/Common/HowtoFieldTime.tsx rename to src/pages/Library/Content/Common/LibraryTime.field.tsx index 13e83d402c..caa9b99d76 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldTime.tsx +++ b/src/pages/Library/Content/Common/LibraryTime.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { SelectField } from 'src/common/Form/Select.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { draftValidationWrapper, required } from 'src/utils/validators' diff --git a/src/pages/Howto/Content/Common/HowtoFieldTitle.test.tsx b/src/pages/Library/Content/Common/LibraryTitle.field.test.tsx similarity index 61% rename from src/pages/Howto/Content/Common/HowtoFieldTitle.test.tsx rename to src/pages/Library/Content/Common/LibraryTitle.field.test.tsx index 1bd086dd90..45b35378c9 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldTitle.test.tsx +++ b/src/pages/Library/Content/Common/LibraryTitle.field.test.tsx @@ -1,14 +1,14 @@ import { render, screen } from '@testing-library/react' import { describe, it, vi } from 'vitest' -import { HowtoFieldTitle } from './HowtoFieldTitle' -import { HowtoFormProvider } from './HowtoFormProvider' +import { HowtoFormProvider } from './LibraryFormProvider' +import { HowtoFieldTitle } from './LibraryTitle.field' -import type { HowtoStore } from 'src/stores/Howto/howto.store' -import type { ParentType } from './Howto.form' +import type { HowtoStore } from 'src/stores/Library/library.store' +import type { ParentType } from './Library.form' -vi.mock('src/stores/Howto/howto.store') -const store = await vi.importMock('src/stores/Howto/howto.store') +vi.mock('src/stores/Library/library.store') +const store = await vi.importMock('src/stores/Library/library.store') describe('HowtoFieldTitle', () => { it('renders', async () => { diff --git a/src/pages/Howto/Content/Common/HowtoFieldTitle.tsx b/src/pages/Library/Content/Common/LibraryTitle.field.tsx similarity index 93% rename from src/pages/Howto/Content/Common/HowtoFieldTitle.tsx rename to src/pages/Library/Content/Common/LibraryTitle.field.tsx index d21390bad6..3cd487e0e4 100644 --- a/src/pages/Howto/Content/Common/HowtoFieldTitle.tsx +++ b/src/pages/Library/Content/Common/LibraryTitle.field.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { Field } from 'react-final-form' import { FieldInput } from 'oa-components' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common/FormFieldWrapper' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common/FormFieldWrapper' import { COMPARISONS } from 'src/utils/comparisons' import { composeValidators, minValue, required } from 'src/utils/validators' import { Card, Text } from 'theme-ui' @@ -9,7 +9,7 @@ import { Card, Text } from 'theme-ui' import { HOWTO_TITLE_MAX_LENGTH, HOWTO_TITLE_MIN_LENGTH } from '../../constants' import { intro } from '../../labels' -import type { HowtoStore } from 'src/stores/Howto/howto.store' +import type { HowtoStore } from 'src/stores/Library/library.store' interface IProps { store: HowtoStore diff --git a/src/pages/Howto/Content/Common/SubmitStatus.tsx b/src/pages/Library/Content/Common/SubmitStatus.tsx similarity index 100% rename from src/pages/Howto/Content/Common/SubmitStatus.tsx rename to src/pages/Library/Content/Common/SubmitStatus.tsx diff --git a/src/pages/Library/Content/Common/index.ts b/src/pages/Library/Content/Common/index.ts new file mode 100644 index 0000000000..919f1a88d3 --- /dev/null +++ b/src/pages/Library/Content/Common/index.ts @@ -0,0 +1,19 @@ +export { FormFieldWrapper } from './FormFieldWrapper' +export { HowtoButtonDraft } from './LibraryButtonDraft' +export { HowtoButtonPublish } from './LibraryButtonPublish' +export { HowtoCategoryGuidance } from './LibraryCategoryGuidance' +export { HowtoErrors } from './LibraryErrors' +export { HowtoFieldCategory } from './LibraryCategory.field' +export { HowtoFieldCoverImage } from './LibraryCoverImage.field' +export { HowtoFieldDescription } from './LibraryDescription.field' +export { HowtoFieldDifficulty } from './LibraryDifficulty.field' +export { HowtoFieldFileLink } from './LibraryFileLink.field' +export { HowtoFieldFiles } from './LibraryFiles.field' +export { HowtoFieldFileUpload } from './LibraryFileUpload.field' +export { HowtoFieldStep } from './LibraryStep.field' +export { HowtoFieldStepsContainer } from './LibraryStepsContainer.field' +export { HowtoFieldTags } from './LibraryTags.field' +export { HowtoFieldTime } from './LibraryTime.field' +export { HowtoFieldTitle } from './LibraryTitle.field' +export { HowToSubmitStatus } from './SubmitStatus' +export { HowtoPostingGuidelines } from './LibraryPostingGuidelines' diff --git a/src/pages/Howto/Content/HowtoList/HowToCard.tsx b/src/pages/Library/Content/List/LibraryCard.tsx similarity index 100% rename from src/pages/Howto/Content/HowtoList/HowToCard.tsx rename to src/pages/Library/Content/List/LibraryCard.tsx diff --git a/src/pages/Howto/Content/HowtoList/HowtoList.tsx b/src/pages/Library/Content/List/LibraryList.tsx similarity index 95% rename from src/pages/Howto/Content/HowtoList/HowtoList.tsx rename to src/pages/Library/Content/List/LibraryList.tsx index 052158723d..50377f97f7 100644 --- a/src/pages/Howto/Content/HowtoList/HowtoList.tsx +++ b/src/pages/Library/Content/List/LibraryList.tsx @@ -8,14 +8,14 @@ import useDrafts from 'src/pages/common/Drafts/useDrafts' import { Flex, Grid, Heading } from 'theme-ui' import { ITEMS_PER_PAGE } from '../../constants' -import { howtoService, HowtosSearchParams } from '../../howto.service' import { listing } from '../../labels' -import HowToCard from './HowToCard' -import { HowtoHeader } from './HowtoListHeader' +import { howtoService, HowtosSearchParams } from '../../library.service' +import HowToCard from './LibraryCard' +import { HowtoHeader } from './LibraryListHeader' import type { DocumentData, QueryDocumentSnapshot } from 'firebase/firestore' import type { ILibrary } from 'oa-shared' -import type { HowtoSortOption } from './HowtoSortOptions' +import type { HowtoSortOption } from './LibrarySortOptions' export const HowtoList = observer(() => { const siteName = import.meta.env.VITE_SITE_NAME diff --git a/src/pages/Howto/Content/HowtoList/HowtoListHeader.tsx b/src/pages/Library/Content/List/LibraryListHeader.tsx similarity index 96% rename from src/pages/Howto/Content/HowtoList/HowtoListHeader.tsx rename to src/pages/Library/Content/List/LibraryListHeader.tsx index a0ccd53802..e3fa7471c6 100644 --- a/src/pages/Howto/Content/HowtoList/HowtoListHeader.tsx +++ b/src/pages/Library/Content/List/LibraryListHeader.tsx @@ -8,12 +8,12 @@ import DraftButton from 'src/pages/common/Drafts/DraftButton' import { ListHeader } from 'src/pages/common/Layout/ListHeader' import { Button, Flex } from 'theme-ui' -import { howtoService, HowtosSearchParams } from '../../howto.service' import { listing } from '../../labels' -import { HowtoSortOptions } from './HowtoSortOptions' +import { howtoService, HowtosSearchParams } from '../../library.service' +import { HowtoSortOptions } from './LibrarySortOptions' import type { ICategory } from 'shared/lib' -import type { HowtoSortOption } from './HowtoSortOptions' +import type { HowtoSortOption } from './LibrarySortOptions' interface IProps { draftCount: number diff --git a/src/pages/Howto/Content/HowtoList/HowtoSortOptions.ts b/src/pages/Library/Content/List/LibrarySortOptions.ts similarity index 100% rename from src/pages/Howto/Content/HowtoList/HowtoSortOptions.ts rename to src/pages/Library/Content/List/LibrarySortOptions.ts diff --git a/src/pages/Howto/Content/Howto/Howto.test.tsx b/src/pages/Library/Content/Page/Library.test.tsx similarity index 98% rename from src/pages/Howto/Content/Howto/Howto.test.tsx rename to src/pages/Library/Content/Page/Library.test.tsx index 1b3fdd4108..fa41113772 100644 --- a/src/pages/Howto/Content/Howto/Howto.test.tsx +++ b/src/pages/Library/Content/Page/Library.test.tsx @@ -9,13 +9,13 @@ import { Provider } from 'mobx-react' import { GlobalStyles } from 'oa-components' import { IModerationStatus } from 'oa-shared' import { preciousPlasticTheme } from 'oa-themes' -import { FactoryHowto, FactoryHowtoStep } from 'src/test/factories/Howto' +import { FactoryHowto, FactoryHowtoStep } from 'src/test/factories/Library' import { describe, expect, it, vi } from 'vitest' -import { Howto } from './Howto' +import { Howto } from './Library' import type { ILibrary } from 'oa-shared' -import type { HowtoStore } from 'src/stores/Howto/howto.store' +import type { HowtoStore } from 'src/stores/Library/library.store' const Theme = preciousPlasticTheme.styles diff --git a/src/pages/Howto/Content/Howto/Howto.tsx b/src/pages/Library/Content/Page/Library.tsx similarity index 96% rename from src/pages/Howto/Content/Howto/Howto.tsx rename to src/pages/Library/Content/Page/Library.tsx index d6f3e16753..5ece6b4437 100644 --- a/src/pages/Howto/Content/Howto/Howto.tsx +++ b/src/pages/Library/Content/Page/Library.tsx @@ -14,9 +14,9 @@ import { useCommonStores } from 'src/common/hooks/useCommonStores' import { Breadcrumbs } from 'src/pages/common/Breadcrumbs/Breadcrumbs' import { Box } from 'theme-ui' -import HowtoDescription from './HowtoDescription/HowtoDescription' -import { HowtoDiscussion } from './HowToDiscussion/HowToDiscussion' -import Step from './Step/Step' +import HowtoDescription from './LibraryDescription' +import { HowtoDiscussion } from './LibraryDiscussion' +import Step from './LibraryStep' import type { ILibrary, IUser } from 'oa-shared' diff --git a/src/pages/Howto/Content/Howto/HowtoDescription/HowtoDescription.tsx b/src/pages/Library/Content/Page/LibraryDescription.tsx similarity index 98% rename from src/pages/Howto/Content/Howto/HowtoDescription/HowtoDescription.tsx rename to src/pages/Library/Content/Page/LibraryDescription.tsx index e096e8718e..a6d72e99e2 100644 --- a/src/pages/Howto/Content/Howto/HowtoDescription/HowtoDescription.tsx +++ b/src/pages/Library/Content/Page/LibraryDescription.tsx @@ -27,8 +27,8 @@ import { } from 'src/utils/helpers' import { Alert, Box, Card, Divider, Flex, Heading, Image, Text } from 'theme-ui' -import { ContentAuthorTimestamp } from '../../../../common/ContentAuthorTimestamp/ContentAuthorTimestamp' -import { HowtoDownloads } from '../HowtoDownloads/HowtoDownloads' +import { ContentAuthorTimestamp } from '../../../common/ContentAuthorTimestamp/ContentAuthorTimestamp' +import { HowtoDownloads } from './LibraryDownloads' import type { ILibrary, ITag, IUser } from 'oa-shared' diff --git a/src/pages/Howto/Content/Howto/HowToDiscussion/HowToDiscussion.tsx b/src/pages/Library/Content/Page/LibraryDiscussion.tsx similarity index 100% rename from src/pages/Howto/Content/Howto/HowToDiscussion/HowToDiscussion.tsx rename to src/pages/Library/Content/Page/LibraryDiscussion.tsx diff --git a/src/pages/Howto/Content/Howto/HowtoDownloads/HowtoDownloads.tsx b/src/pages/Library/Content/Page/LibraryDownloads.tsx similarity index 97% rename from src/pages/Howto/Content/Howto/HowtoDownloads/HowtoDownloads.tsx rename to src/pages/Library/Content/Page/LibraryDownloads.tsx index a06d440fd4..1b7f6579da 100644 --- a/src/pages/Howto/Content/Howto/HowtoDownloads/HowtoDownloads.tsx +++ b/src/pages/Library/Content/Page/LibraryDownloads.tsx @@ -8,7 +8,7 @@ import { isHowtoDownloadCooldownExpired, retrieveHowtoDownloadCooldown, updateHowtoDownloadCooldown, -} from './downloadCooldown' +} from '../utils/downloadCooldown' import type { ILibrary, IUser } from 'oa-shared' diff --git a/src/pages/Howto/Content/Howto/Step/Step.tsx b/src/pages/Library/Content/Page/LibraryStep.tsx similarity index 100% rename from src/pages/Howto/Content/Howto/Step/Step.tsx rename to src/pages/Library/Content/Page/LibraryStep.tsx diff --git a/src/pages/Howto/Content/Howto/HowtoDownloads/downloadCooldown.ts b/src/pages/Library/Content/utils/downloadCooldown.ts similarity index 100% rename from src/pages/Howto/Content/Howto/HowtoDownloads/downloadCooldown.ts rename to src/pages/Library/Content/utils/downloadCooldown.ts diff --git a/src/pages/Library/Content/utils/index.ts b/src/pages/Library/Content/utils/index.ts new file mode 100644 index 0000000000..b6f15bce9d --- /dev/null +++ b/src/pages/Library/Content/utils/index.ts @@ -0,0 +1 @@ +export { transformHowtoErrors } from './transformLibraryErrors' diff --git a/src/pages/Howto/Content/Common/utils/transformHowtoErrors.test.ts b/src/pages/Library/Content/utils/transformLibraryErrors.test.ts similarity index 91% rename from src/pages/Howto/Content/Common/utils/transformHowtoErrors.test.ts rename to src/pages/Library/Content/utils/transformLibraryErrors.test.ts index 0790808de2..96663324c2 100644 --- a/src/pages/Howto/Content/Common/utils/transformHowtoErrors.test.ts +++ b/src/pages/Library/Content/utils/transformLibraryErrors.test.ts @@ -1,7 +1,7 @@ -import { intro, steps } from 'src/pages/Howto/labels' +import { intro, steps } from 'src/pages/Library/labels' import { describe, expect, it } from 'vitest' -import { transformHowtoErrors } from './transformHowtoErrors' +import { transformHowtoErrors } from './transformLibraryErrors' describe('transformHowtoErrors', () => { describe('introErrors', () => { diff --git a/src/pages/Howto/Content/Common/utils/transformHowtoErrors.ts b/src/pages/Library/Content/utils/transformLibraryErrors.ts similarity index 98% rename from src/pages/Howto/Content/Common/utils/transformHowtoErrors.ts rename to src/pages/Library/Content/utils/transformLibraryErrors.ts index b47d4702fc..1bb3a9ca43 100644 --- a/src/pages/Howto/Content/Common/utils/transformHowtoErrors.ts +++ b/src/pages/Library/Content/utils/transformLibraryErrors.ts @@ -1,4 +1,4 @@ -import { intro as introLabels, steps as stepsLabels } from '../../../labels' +import { intro as introLabels, steps as stepsLabels } from '../../labels' import type { IErrorsListSet, diff --git a/src/pages/Howto/Content/CreateHowto/CreateHowto.tsx b/src/pages/Library/CreateLibrary.tsx similarity index 72% rename from src/pages/Howto/Content/CreateHowto/CreateHowto.tsx rename to src/pages/Library/CreateLibrary.tsx index f24619b252..2f221d3a65 100644 --- a/src/pages/Howto/Content/CreateHowto/CreateHowto.tsx +++ b/src/pages/Library/CreateLibrary.tsx @@ -1,8 +1,8 @@ import * as React from 'react' import { observer } from 'mobx-react' -import { HowtoForm } from 'src/pages/Howto/Content/Common/Howto.form' +import { HowtoForm } from 'src/pages/Library/Content/Common/Library.form' -import TEMPLATE from './Template' +import TEMPLATE from './CreateLibraryTemplate' import type { ILibrary } from 'oa-shared' diff --git a/src/pages/Howto/Content/CreateHowto/Template.tsx b/src/pages/Library/CreateLibraryTemplate.tsx similarity index 100% rename from src/pages/Howto/Content/CreateHowto/Template.tsx rename to src/pages/Library/CreateLibraryTemplate.tsx diff --git a/src/pages/Howto/Content/EditHowto/EditHowto.tsx b/src/pages/Library/EditLibrary.tsx similarity index 94% rename from src/pages/Howto/Content/EditHowto/EditHowto.tsx rename to src/pages/Library/EditLibrary.tsx index 27caaef8de..eb1f0bfcb9 100644 --- a/src/pages/Howto/Content/EditHowto/EditHowto.tsx +++ b/src/pages/Library/EditLibrary.tsx @@ -4,7 +4,7 @@ import { useCommonStores } from 'src/common/hooks/useCommonStores' import { isAllowedToEditContent } from 'src/utils/helpers' import { Text } from 'theme-ui' -import { HowtoForm } from '../Common/Howto.form' +import { HowtoForm } from './Content/Common/Library.form' import type { ILibrary, IUser } from 'oa-shared' diff --git a/src/pages/Howto/Content/EditHowto/Template.tsx b/src/pages/Library/EditLibraryTemplate.tsx similarity index 100% rename from src/pages/Howto/Content/EditHowto/Template.tsx rename to src/pages/Library/EditLibraryTemplate.tsx diff --git a/src/pages/Howto/constants.ts b/src/pages/Library/constants.ts similarity index 100% rename from src/pages/Howto/constants.ts rename to src/pages/Library/constants.ts diff --git a/src/pages/Howto/labels.ts b/src/pages/Library/labels.ts similarity index 100% rename from src/pages/Howto/labels.ts rename to src/pages/Library/labels.ts diff --git a/src/pages/Howto/howto.service.test.ts b/src/pages/Library/library.service.test.ts similarity index 98% rename from src/pages/Howto/howto.service.test.ts rename to src/pages/Library/library.service.test.ts index 636139a56e..cf864c02b1 100644 --- a/src/pages/Howto/howto.service.test.ts +++ b/src/pages/Library/library.service.test.ts @@ -4,7 +4,7 @@ import { UserRole } from 'oa-shared' import { FactoryUser } from 'src/test/factories/User' import { describe, expect, it, vi } from 'vitest' -import { exportedForTesting } from './howto.service' +import { exportedForTesting } from './library.service' const mockWhere = vi.fn() const mockOrderBy = vi.fn() diff --git a/src/pages/Howto/howto.service.ts b/src/pages/Library/library.service.ts similarity index 98% rename from src/pages/Howto/howto.service.ts rename to src/pages/Library/library.service.ts index 904e0a3c71..7d04d9a77c 100644 --- a/src/pages/Howto/howto.service.ts +++ b/src/pages/Library/library.service.ts @@ -24,7 +24,7 @@ import type { QueryNonFilterConstraint, } from 'firebase/firestore' import type { ICategory, ILibrary, IUserDB } from 'oa-shared' -import type { HowtoSortOption } from './Content/HowtoList/HowtoSortOptions' +import type { HowtoSortOption } from './Content/List/LibrarySortOptions' export enum HowtosSearchParams { category = 'category', diff --git a/src/pages/Question/Content/Common/FormFields/QuestionCategory.field.tsx b/src/pages/Question/Content/Common/FormFields/QuestionCategory.field.tsx index 2d28d0ff11..8803c38e7e 100644 --- a/src/pages/Question/Content/Common/FormFields/QuestionCategory.field.tsx +++ b/src/pages/Question/Content/Common/FormFields/QuestionCategory.field.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { Field } from 'react-final-form' import { CategoriesSelectV2 } from 'src/pages/common/Category/CategoriesSelectV2' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { fields } from 'src/pages/Question/labels' import { questionService } from 'src/pages/Question/question.service' diff --git a/src/pages/Question/Content/Common/FormFields/QuestionDescription.field.tsx b/src/pages/Question/Content/Common/FormFields/QuestionDescription.field.tsx index bce3aee359..2fafb0361b 100644 --- a/src/pages/Question/Content/Common/FormFields/QuestionDescription.field.tsx +++ b/src/pages/Question/Content/Common/FormFields/QuestionDescription.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { FieldTextarea } from 'oa-components' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { QUESTION_MAX_DESCRIPTION_LENGTH } from 'src/pages/Question/constants' import { fields } from 'src/pages/Question/labels' import { composeValidators, required } from 'src/utils/validators' diff --git a/src/pages/Question/Content/Common/FormFields/QuestionImage.field.tsx b/src/pages/Question/Content/Common/FormFields/QuestionImage.field.tsx index 36cbe380e4..02f97ce522 100644 --- a/src/pages/Question/Content/Common/FormFields/QuestionImage.field.tsx +++ b/src/pages/Question/Content/Common/FormFields/QuestionImage.field.tsx @@ -1,7 +1,7 @@ import { Field } from 'react-final-form' import styled from '@emotion/styled' import { ImageInputField } from 'src/common/Form/ImageInput.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { fields } from 'src/pages/Question/labels' import { COMPARISONS } from 'src/utils/comparisons' diff --git a/src/pages/Question/Content/Common/FormFields/QuestionTags.field.tsx b/src/pages/Question/Content/Common/FormFields/QuestionTags.field.tsx index 70bfc22c4a..df9a36c993 100644 --- a/src/pages/Question/Content/Common/FormFields/QuestionTags.field.tsx +++ b/src/pages/Question/Content/Common/FormFields/QuestionTags.field.tsx @@ -1,6 +1,6 @@ import { Field } from 'react-final-form' import { TagsSelectField } from 'src/common/Form/TagsSelect.field' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { fields } from 'src/pages/Question/labels' import { COMPARISONS } from 'src/utils/comparisons' diff --git a/src/pages/Question/Content/Common/FormFields/QuestionTitle.field.tsx b/src/pages/Question/Content/Common/FormFields/QuestionTitle.field.tsx index 02ea039194..dfcbfee913 100644 --- a/src/pages/Question/Content/Common/FormFields/QuestionTitle.field.tsx +++ b/src/pages/Question/Content/Common/FormFields/QuestionTitle.field.tsx @@ -1,7 +1,7 @@ import { Field } from 'react-final-form' import { FieldInput } from 'oa-components' import { useCommonStores } from 'src/common/hooks/useCommonStores' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { QUESTION_MAX_TITLE_LENGTH, QUESTION_MIN_TITLE_LENGTH, diff --git a/src/pages/UserSettings/content/sections/ChangeEmail.form.tsx b/src/pages/UserSettings/content/sections/ChangeEmail.form.tsx index d211b76ea3..32f16c1d27 100644 --- a/src/pages/UserSettings/content/sections/ChangeEmail.form.tsx +++ b/src/pages/UserSettings/content/sections/ChangeEmail.form.tsx @@ -3,7 +3,7 @@ import { Field, Form } from 'react-final-form' import { Button, FieldInput, Icon } from 'oa-components' import { PasswordField } from 'src/common/Form/PasswordField' import { useCommonStores } from 'src/common/hooks/useCommonStores' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { UserContactError } from 'src/pages/User/contact/UserContactError' import { buttons, fields, headings } from 'src/pages/UserSettings/labels' import { Flex, Heading, Text } from 'theme-ui' diff --git a/src/pages/UserSettings/content/sections/ChangePassword.form.tsx b/src/pages/UserSettings/content/sections/ChangePassword.form.tsx index f186510268..5bab867ecf 100644 --- a/src/pages/UserSettings/content/sections/ChangePassword.form.tsx +++ b/src/pages/UserSettings/content/sections/ChangePassword.form.tsx @@ -3,7 +3,7 @@ import { Form } from 'react-final-form' import { Button, FieldInput, Icon } from 'oa-components' import { PasswordField } from 'src/common/Form/PasswordField' import { useCommonStores } from 'src/common/hooks/useCommonStores' -import { FormFieldWrapper } from 'src/pages/Howto/Content/Common' +import { FormFieldWrapper } from 'src/pages/Library/Content/Common' import { UserContactError } from 'src/pages/User/contact/UserContactError' import { buttons, fields, headings } from 'src/pages/UserSettings/labels' import { Flex, Heading, Text } from 'theme-ui' diff --git a/src/routes/_.library.$slug._index.tsx b/src/routes/_.library.$slug._index.tsx index ecfb771864..6a499c5c3f 100644 --- a/src/routes/_.library.$slug._index.tsx +++ b/src/routes/_.library.$slug._index.tsx @@ -1,7 +1,7 @@ import { json } from '@remix-run/node' import { useLoaderData } from '@remix-run/react' -import { Howto } from 'src/pages/Howto/Content/Howto/Howto' -import { howtoService } from 'src/pages/Howto/howto.service' +import { Howto } from 'src/pages/Library/Content/Page/Library' +import { howtoService } from 'src/pages/Library/library.service' import { NotFoundPage } from 'src/pages/NotFound/NotFound' import { pageViewService } from 'src/services/pageViewService.server' import { generateTags, mergeMeta } from 'src/utils/seo.utils' diff --git a/src/routes/_.library.$slug.edit.tsx b/src/routes/_.library.$slug.edit.tsx index 8607f55be6..177dd82df8 100644 --- a/src/routes/_.library.$slug.edit.tsx +++ b/src/routes/_.library.$slug.edit.tsx @@ -2,8 +2,8 @@ import { json } from '@remix-run/node' import { useLoaderData } from '@remix-run/react' /* eslint-disable unicorn/filename-case */ import { AuthRoute } from 'src/pages/common/AuthRoute' -import EditHowto from 'src/pages/Howto/Content/EditHowto/EditHowto' -import { howtoService } from 'src/pages/Howto/howto.service' +import EditHowto from 'src/pages/Library/EditLibrary' +import { howtoService } from 'src/pages/Library/library.service' import type { ILibrary } from 'oa-shared' import type { LoaderFunctionArgs } from 'react-router' diff --git a/src/routes/_.library._index.tsx b/src/routes/_.library._index.tsx index 1111b52f56..13956aaf41 100644 --- a/src/routes/_.library._index.tsx +++ b/src/routes/_.library._index.tsx @@ -1,5 +1,5 @@ /* eslint-disable unicorn/filename-case */ -import { HowtoList } from 'src/pages/Howto/Content/HowtoList/HowtoList' +import { HowtoList } from 'src/pages/Library/Content/List/LibraryList' import { SeoTagsUpdateComponent } from 'src/utils/seo' export async function clientLoader() { diff --git a/src/routes/_.library.create.tsx b/src/routes/_.library.create.tsx index 112b56c990..63e9032c63 100644 --- a/src/routes/_.library.create.tsx +++ b/src/routes/_.library.create.tsx @@ -1,6 +1,6 @@ /* eslint-disable unicorn/filename-case */ import { AuthRoute } from 'src/pages/common/AuthRoute' -import CreateHowto from 'src/pages/Howto/Content/CreateHowto/CreateHowto' +import CreateHowto from 'src/pages/Library/CreateLibrary' export async function clientLoader() { return null diff --git a/src/stores/Howto/howto.store.test.ts b/src/stores/Library/library.store.test.ts similarity index 98% rename from src/stores/Howto/howto.store.test.ts rename to src/stores/Library/library.store.test.ts index d75a9b4516..ccfcec5938 100644 --- a/src/stores/Howto/howto.store.test.ts +++ b/src/stores/Library/library.store.test.ts @@ -5,10 +5,10 @@ import { FactoryHowto, FactoryHowtoDraft, FactoryHowtoStep, -} from 'src/test/factories/Howto' +} from 'src/test/factories/Library' import { FactoryUser } from 'src/test/factories/User' -import { HowtoStore } from './howto.store' +import { HowtoStore } from './library.store' import type { ILibrary, IUser } from 'oa-shared' import type { IRootStore } from '../RootStore' diff --git a/src/stores/Howto/howto.store.tsx b/src/stores/Library/library.store.tsx similarity index 100% rename from src/stores/Howto/howto.store.tsx rename to src/stores/Library/library.store.tsx diff --git a/src/stores/RootStore.tsx b/src/stores/RootStore.tsx index 201b0d0f62..0af3e9d7dd 100644 --- a/src/stores/RootStore.tsx +++ b/src/stores/RootStore.tsx @@ -1,7 +1,7 @@ import { AggregationsStore } from './Aggregations/aggregations.store' import { DatabaseV2 } from './databaseV2/DatabaseV2' import { DiscussionStore } from './Discussions/discussions.store' -import { HowtoStore } from './Howto/howto.store' +import { HowtoStore } from './Library/library.store' import { MapsStore } from './Maps/maps.store' import { QuestionStore } from './Question/question.store' import { ResearchStore } from './Research/research.store' diff --git a/src/test/factories/Howto.ts b/src/test/factories/Library.ts similarity index 100% rename from src/test/factories/Howto.ts rename to src/test/factories/Library.ts diff --git a/src/utils/validators.ts b/src/utils/validators.ts index 9e4184aa6f..e550bb4cf3 100644 --- a/src/utils/validators.ts +++ b/src/utils/validators.ts @@ -1,6 +1,6 @@ import { getSpecialCharacters, stripSpecialCharacters } from './helpers' -import type { HowtoStore } from 'src/stores/Howto/howto.store' +import type { HowtoStore } from 'src/stores/Library/library.store' import type { ResearchStore } from 'src/stores/Research/research.store' type storeTypes = HowtoStore | ResearchStore | QuestionStore