diff --git a/cypress/e2e/login/widgets.cy.js b/cypress/e2e/login/widgets.cy.js index e71026e1..3978f86d 100644 --- a/cypress/e2e/login/widgets.cy.js +++ b/cypress/e2e/login/widgets.cy.js @@ -2,9 +2,9 @@ function checkValidation(widgetName) { cy.contains(widgetName).click() - cy.contains('Create Widget').click() + cy.contains('Create widget').click() cy.get('.text-red-500').should('exist') - cy.contains('Go Back').click() + cy.contains('Go back').click() } function createwidget(name) { @@ -14,11 +14,11 @@ function createwidget(name) { } function throughme(name) { - cy.contains('Create Widget').click() + cy.contains('Create widget').click() cy.wait(1000) cy.get('[href="/lilwat/dashboard/edit"]').click() cy.wait(1000) - cy.contains('Edit Widgets').click() + cy.contains('Edit widgets').click() cy.contains(name) .scrollIntoView() @@ -30,7 +30,7 @@ function throughme(name) { cy.get('#widgetName').should('contain.value', name) cy.wait(1500) - cy.contains('Delete Widget').click() + cy.contains('Delete widget').click() cy.get('#RemoveWidgetModalContent').contains('Delete').click() } diff --git a/src/common/dataHooks/useSearchLoader.js b/src/common/dataHooks/useSearchLoader.js index 11d16a26..1ba64d68 100644 --- a/src/common/dataHooks/useSearchLoader.js +++ b/src/common/dataHooks/useSearchLoader.js @@ -51,7 +51,7 @@ function useSearchLoader({ searchParams }) { sitename: result?.entry?.site?.slug, siteTitle: result?.entry?.site?.title, visibility: result?.entry?.visibility, - siteVisibility: result?.entry?.site.visibility, + siteVisibility: result?.entry?.site?.visibility, } switch (result?.type) { case TYPE_WORD: diff --git a/src/components/CategoryCrud/CategoryCrudPresentation.js b/src/components/CategoryCrud/CategoryCrudPresentation.js index 8dcd357f..61e52b57 100644 --- a/src/components/CategoryCrud/CategoryCrudPresentation.js +++ b/src/components/CategoryCrud/CategoryCrudPresentation.js @@ -86,10 +86,10 @@ function CategoryCrudPresentation({
diff --git a/src/components/CharacterCrud/CharacterCrudPresentation.js b/src/components/CharacterCrud/CharacterCrudPresentation.js index 4ce2ed16..4008df5c 100644 --- a/src/components/CharacterCrud/CharacterCrudPresentation.js +++ b/src/components/CharacterCrud/CharacterCrudPresentation.js @@ -41,7 +41,7 @@ function CharacterCrudPresentation({ backHandler, dataToEdit, submitHandler }) {
{activeStep < 1 ? 'Cancel' : 'Previous Step'} + {activeStep < 1 ? 'Cancel' : 'Previous step'}
@@ -403,11 +409,11 @@ function DictionaryCrudPresentation({ submitLabel={ isCreate ? `Add ${getFriendlyDocType({ docType: type })}` - : 'Save Changes' + : 'Save changes' } submitIcon={isCreate ? 'Add' : 'Save'} cancelIcon={isCreate ? 'BackArrow' : 'Close'} - cancelLabel={isCreate ? 'Go Back' : 'Cancel'} + cancelLabel={isCreate ? 'Go back' : 'Cancel'} onCancelClick={backHandler} onSubmitClick={handleSubmit(submitHandler)} /> diff --git a/src/components/ErrorHandler/ErrorHandlerPresentation.js b/src/components/ErrorHandler/ErrorHandlerPresentation.js index 02c2a480..02841aa8 100644 --- a/src/components/ErrorHandler/ErrorHandlerPresentation.js +++ b/src/components/ErrorHandler/ErrorHandlerPresentation.js @@ -30,7 +30,7 @@ function ErrorHandlerPresentation({ backHandler, status, heading, content }) { 'BackArrow', 'inline-flex pb-2 h-7 fill-current mr-2 h-10', )} - Go Back + Go back
- Report Problem + Report problem
diff --git a/src/components/Form/CategoryArrayField.js b/src/components/Form/CategoryArrayField.js index 8f5277d9..0fa25bc8 100644 --- a/src/components/Form/CategoryArrayField.js +++ b/src/components/Form/CategoryArrayField.js @@ -7,7 +7,7 @@ import getIcon from 'common/utils/getIcon' import { useModalSelector } from 'common/hooks/useModalController' import Modal from 'components/Modal' import CategoriesBrowser from 'components/CategoriesBrowser' - +import FieldButton from 'components/Form/FieldButton' function CategoryArrayField({ label, nameId, @@ -56,16 +56,8 @@ function CategoryArrayField({ ))} - {fields?.length < maxItems && ( - + )}
{helpText && ( diff --git a/src/components/Form/EntryArrayField.js b/src/components/Form/EntryArrayField.js index d0383f77..f9095e16 100644 --- a/src/components/Form/EntryArrayField.js +++ b/src/components/Form/EntryArrayField.js @@ -8,6 +8,7 @@ import { useModalSelector } from 'common/hooks/useModalController' import Modal from 'components/Modal' import EntrySelector from 'components/EntrySelector' import { TYPE_WORD, TYPE_PHRASE } from 'common/constants' +import FieldButton from 'components/Form/FieldButton' function EntryArrayField({ label, @@ -56,16 +57,8 @@ function EntryArrayField({ ))} - {fields?.length < maxItems && ( - + )}
{helpText && ( diff --git a/src/components/Form/FieldButton.js b/src/components/Form/FieldButton.js new file mode 100644 index 00000000..3770948a --- /dev/null +++ b/src/components/Form/FieldButton.js @@ -0,0 +1,30 @@ +import React from 'react' +import PropTypes from 'prop-types' + +// FPCC +import getIcon from 'common/utils/getIcon' + +function FieldButton({ label, openModal, append }) { + return ( +
+ +
+ ) +} + +// Proptypes +const { func, string } = PropTypes +FieldButton.propTypes = { + label: string, + openModal: func, + append: func, +} + +export default FieldButton diff --git a/src/components/Form/NextPrevious.js b/src/components/Form/NextPrevious.js index 144bb175..9b7b5c72 100644 --- a/src/components/Form/NextPrevious.js +++ b/src/components/Form/NextPrevious.js @@ -1,11 +1,12 @@ import React from 'react' import PropTypes from 'prop-types' +import { Link } from 'react-router-dom' // FPCC import getIcon from 'common/utils/getIcon' import useSearchParamsState from 'common/hooks/useSearchParamsState' -function NextPrevious({ numberOfSteps, onClickCallback }) { +function NextPrevious({ numberOfSteps, onClickCallback, sitename }) { const [activeStep, setActiveStep] = useSearchParamsState({ searchParamName: 'step', defaultValue: '0', @@ -20,15 +21,15 @@ function NextPrevious({ numberOfSteps, onClickCallback }) { } return ( -
+
{activeStepNumber > 0 ? ( ) : (
@@ -36,23 +37,31 @@ function NextPrevious({ numberOfSteps, onClickCallback }) { {activeStepNumber !== numberOfSteps - 1 ? ( ) : ( -
+
+ + Finish + +
)}
) } // PROPTYPES -const { number, func } = PropTypes +const { number, func, string } = PropTypes NextPrevious.propTypes = { numberOfSteps: number, onClickCallback: func, + sitename: string, } export default NextPrevious diff --git a/src/components/Form/TextArrayField.js b/src/components/Form/TextArrayField.js index a95cc515..a2fe899e 100644 --- a/src/components/Form/TextArrayField.js +++ b/src/components/Form/TextArrayField.js @@ -5,7 +5,7 @@ import { useFieldArray } from 'react-hook-form' // FPCC import getIcon from 'common/utils/getIcon' import { convertJsonToReadableString } from 'common/utils/stringHelpers' - +import FieldButton from 'components/Form/FieldButton' function TextArrayField({ label, nameId, @@ -67,14 +67,7 @@ function TextArrayField({ ))} {fields?.length < maxItems && ( - + )}
{helpText && ( diff --git a/src/components/Form/TextTranslationArrayField.js b/src/components/Form/TextTranslationArrayField.js index cfac9794..d2a18fd7 100644 --- a/src/components/Form/TextTranslationArrayField.js +++ b/src/components/Form/TextTranslationArrayField.js @@ -21,7 +21,9 @@ function TextTranslationArrayField({ return ( - +
    {fields.map((item, index) => ( @@ -91,7 +93,7 @@ function TextTranslationArrayField({ className="bg-white border-2 border-primary text-primary hover:bg-gray-50 rounded-lg shadow-sm py-2 px-4 inline-flex justify-center text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary-light" > {getIcon('Add', 'fill-current -ml-1 mr-2 h-5 w-5')} - Add {label.slice(0, -1)} + Add {label.slice(0, -1).toLowerCase()} )}
diff --git a/src/components/Form/index.js b/src/components/Form/index.js index 81359ac2..ef7b693d 100644 --- a/src/components/Form/index.js +++ b/src/components/Form/index.js @@ -3,6 +3,7 @@ import Autocomplete from 'components/Form/Autocomplete' import AutocompleteMultiple from 'components/Form/AutocompleteMultiple' import CategoryArrayField from 'components/Form/CategoryArrayField' import EntryArrayField from 'components/Form/EntryArrayField' +import FieldButton from 'components/Form/FieldButton' import FileUploadField from 'components/Form/FileUploadField' import Header from 'components/Form/Header' import MediaArrayField from 'components/Form/MediaArrayField' @@ -26,6 +27,7 @@ export default { AutocompleteMultiple, CategoryArrayField, EntryArrayField, + FieldButton, FileUploadField, Header, MediaArrayField, diff --git a/src/components/HomeCrud/HomeCrudPresentation.js b/src/components/HomeCrud/HomeCrudPresentation.js index a87baf20..4bfeaec2 100644 --- a/src/components/HomeCrud/HomeCrudPresentation.js +++ b/src/components/HomeCrud/HomeCrudPresentation.js @@ -26,7 +26,7 @@ function HomeCrudPresentation({ site }) { className="inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-lg shadow-sm text-white bg-primary hover:bg-primary-light" > {getIcon('Pencil', 'fill-current -ml-1 mr-2 h-5 w-5')} - Edit Banner and Logo + Edit banner and logo
diff --git a/src/components/HomeCrud/HomeForm.js b/src/components/HomeCrud/HomeForm.js index 5e60c47d..fcfa8055 100644 --- a/src/components/HomeCrud/HomeForm.js +++ b/src/components/HomeCrud/HomeForm.js @@ -30,12 +30,12 @@ function HomeForm({ cancelHandler, dataToEdit, submitHandler }) { return (
- +
-
{key}
+
+ {key === 'mimeType' ? 'File Type' : key} +
{file[key]}
diff --git a/src/components/MediaDetails/MediaDetailsVisual.js b/src/components/MediaDetails/MediaDetailsVisual.js index ae9066b1..741a4aef 100644 --- a/src/components/MediaDetails/MediaDetailsVisual.js +++ b/src/components/MediaDetails/MediaDetailsVisual.js @@ -49,8 +49,8 @@ function MediaDetailsVisual({ file, docType }) { key={key} className="py-3 flex justify-between text-sm font-medium" > -
- {key.charAt(0).toUpperCase() + key.slice(1)} +
+ {key === 'mimeType' ? 'File Type' : key}
{file[key]} diff --git a/src/components/PageCrud/PageForm.js b/src/components/PageCrud/PageForm.js index 45cbdc90..50c0b7a6 100644 --- a/src/components/PageCrud/PageForm.js +++ b/src/components/PageCrud/PageForm.js @@ -105,7 +105,7 @@ function PageForm({ cancelHandler, dataToEdit, submitHandler, deleteHandler }) {
diff --git a/src/components/SongCrud/SongCrudPresentation.js b/src/components/SongCrud/SongCrudPresentation.js index 4b01ba95..7e005ce0 100644 --- a/src/components/SongCrud/SongCrudPresentation.js +++ b/src/components/SongCrud/SongCrudPresentation.js @@ -85,7 +85,7 @@ function SongCrudPresentation({
diff --git a/src/components/SpeakerCrud/SpeakerCrudPresentation.js b/src/components/SpeakerCrud/SpeakerCrudPresentation.js index 160227e5..ae5793ff 100644 --- a/src/components/SpeakerCrud/SpeakerCrudPresentation.js +++ b/src/components/SpeakerCrud/SpeakerCrudPresentation.js @@ -68,7 +68,7 @@ function SpeakerCrudPresentation({ submitLabel={isCreateMode ? 'Add Speaker' : 'Save Changes'} submitIcon={isCreateMode ? 'Add' : 'Save'} cancelIcon={isCreateMode ? 'BackArrow' : 'Close'} - cancelLabel={isCreateMode ? 'Go Back' : 'Cancel'} + cancelLabel={isCreateMode ? 'Go back' : 'Cancel'} onCancelClick={backHandler} onSubmitClick={handleSubmit(submitHandler)} /> diff --git a/src/components/StoryCoverCrud/StoryCoverCrudPresentation.js b/src/components/StoryCoverCrud/StoryCoverCrudPresentation.js index 995cebf1..4d1b28f2 100644 --- a/src/components/StoryCoverCrud/StoryCoverCrudPresentation.js +++ b/src/components/StoryCoverCrud/StoryCoverCrudPresentation.js @@ -92,7 +92,7 @@ function StoryCoverCrudPresentation({ dataToEdit, submitHandler }) {
-
+
case 3: return ( - + ) diff --git a/src/components/StoryCrud/StoryCrudPreview.js b/src/components/StoryCrud/StoryCrudPreview.js index 79928762..532d8ae9 100644 --- a/src/components/StoryCrud/StoryCrudPreview.js +++ b/src/components/StoryCrud/StoryCrudPreview.js @@ -41,7 +41,7 @@ function StoryCrudPreview({ storyData }) { className="text-primary-light text-sm font-semibold" onClick={() => setTranslate(!translate)} > - View {translate ? 'Language' : 'Translation'} + View {translate ? 'language' : 'translation'} ) @@ -87,7 +87,7 @@ function StoryCrudPreview({ storyData }) {

Story Info

-

Story Title

+

Story title

{translate ? titleTranslation : title}

{translateButton()}
@@ -96,7 +96,7 @@ function StoryCrudPreview({ storyData }) {

{author}

-

Story Introduction

+

Story introduction

{translateButton()} @@ -131,7 +131,7 @@ function StoryCrudPreview({ storyData }) { {audioThumbnails(currentPage?.relatedAudio)}
-

Visual Media

+

Visual media

{relatedVisualMediaThumbnails({ images: storyData?.relatedImages, @@ -143,8 +143,9 @@ function StoryCrudPreview({ storyData }) {
- EDIT + Edit
@@ -161,7 +162,7 @@ function StoryCrudPreview({ storyData }) {
{currentPage?.text && (
-

Page Text

+

Page text

- Pages + Page {pages?.map((pageId, pageIndex) => (
@@ -205,7 +207,7 @@ function StoryCrudPreview({ storyData }) {

Privacy

-

Who can view your Content?

+

Who can view your content?

{visibility}

@@ -216,19 +218,12 @@ function StoryCrudPreview({ storyData }) {
- EDIT + Edit
-
- - FINISH - -
) } diff --git a/src/components/StoryCrud/StoryCrudStepWrapper.js b/src/components/StoryCrud/StoryCrudStepWrapper.js index 02d0a5eb..00337ccd 100644 --- a/src/components/StoryCrud/StoryCrudStepWrapper.js +++ b/src/components/StoryCrud/StoryCrudStepWrapper.js @@ -5,7 +5,7 @@ import { useSearchParams } from 'react-router-dom' // FPCC import Form from 'components/Form' -function StoryCrudStepWrapper({ children, onClickCallback }) { +function StoryCrudStepWrapper({ children, onClickCallback, sitename }) { const [searchParams, setSearchParams] = useSearchParams() const storyFormSteps = [ { title: 'Cover Page' }, @@ -14,7 +14,6 @@ function StoryCrudStepWrapper({ children, onClickCallback }) { { title: 'Preview' }, ] const id = searchParams.get('id') - const defaultOnClick = (step) => { if (id) { setSearchParams({ step, id }) @@ -39,17 +38,19 @@ function StoryCrudStepWrapper({ children, onClickCallback }) {
) } // PROPTYPES -const { func, node } = PropTypes +const { func, node, string } = PropTypes StoryCrudStepWrapper.propTypes = { children: node, onClickCallback: func, + sitename: string, } export default StoryCrudStepWrapper diff --git a/src/components/StoryPagesCrud/StoryPageForm.js b/src/components/StoryPagesCrud/StoryPageForm.js index 57e0121e..f35fdeca 100644 --- a/src/components/StoryPagesCrud/StoryPageForm.js +++ b/src/components/StoryPagesCrud/StoryPageForm.js @@ -60,7 +60,7 @@ function StoryPageForm({
setAddPageOpen(true)} > {getIcon('Add', 'fill-current h-5 mr-2')} - ADD PAGE + Add page
)} diff --git a/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js b/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js index eb3f08c9..d94b027c 100644 --- a/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js +++ b/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js @@ -196,7 +196,7 @@ function WidgetAreaEditPresentationSettingsPane({ {currentWidget?.type === WIDGET_CONTACT && (
- Contact List + Contact list
diff --git a/src/components/WidgetCrud/WidgetCrudPresentation.js b/src/components/WidgetCrud/WidgetCrudPresentation.js index 15c4daef..fd927cb4 100644 --- a/src/components/WidgetCrud/WidgetCrudPresentation.js +++ b/src/components/WidgetCrud/WidgetCrudPresentation.js @@ -48,7 +48,7 @@ function WidgetCrudPresentation({
{widgetTypes?.length > 0 && @@ -92,13 +92,13 @@ function WidgetCrudPresentation({
@@ -107,8 +107,8 @@ function WidgetCrudPresentation({ {dataToEdit?.id && ( )}
diff --git a/src/components/WidgetCrud/WidgetFormBase.js b/src/components/WidgetCrud/WidgetFormBase.js index 55086765..955dd211 100644 --- a/src/components/WidgetCrud/WidgetFormBase.js +++ b/src/components/WidgetCrud/WidgetFormBase.js @@ -31,7 +31,7 @@ function WidgetFormBase({
diff --git a/src/components/WidgetCrud/WidgetFormContact.js b/src/components/WidgetCrud/WidgetFormContact.js index 69578bb0..435e9d0f 100644 --- a/src/components/WidgetCrud/WidgetFormContact.js +++ b/src/components/WidgetCrud/WidgetFormContact.js @@ -84,7 +84,7 @@ function WidgetFormContact({ cancelHandler, dataToEdit, submitHandler }) {
0 ? (
- Contact List + Contact list
(Please contact support at hello@firstvoices.com to update this @@ -108,7 +108,7 @@ function WidgetFormContact({ cancelHandler, dataToEdit, submitHandler }) { ) : (
- Contact List + Contact list
(Please contact support at hello@firstvoices.com to update this diff --git a/src/components/WidgetCrud/WidgetFormText.js b/src/components/WidgetCrud/WidgetFormText.js index 0198644b..c6dfda8c 100644 --- a/src/components/WidgetCrud/WidgetFormText.js +++ b/src/components/WidgetCrud/WidgetFormText.js @@ -139,7 +139,7 @@ function WidgetFormText({ cancelHandler, dataToEdit, submitHandler }) {