Repository: First-Peoples-Cultural-Council/fv-web
Pull request #776: FW-4609 remove references to Nuxeo docs
Author: login: gmcauliffe
Created: 2025-03-24T20:32:25Z | Merged: 2025-03-24T21:15:22Z

### Description of Changes

Remove all references to nuxeo "documents" and "document types"

### Checklist

- [x] README / documentation has been updated if needed
- [x] PR title / commit messages contain Jira ticket number if applicable
- [ ] Tests have been updated / created if applicable

### Reviewers Should Do The Following:

- [x] Review the changes here
- [ ] Pull the branch and test locally

### Additional Notes

N/A



Diff:
diff --git a/src/common/constants/docTypes.js b/src/common/constants/docTypes.js
deleted file mode 100644
index 8e2b2192e..000000000
--- a/src/common/constants/docTypes.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ----- Document Types ------ */
-// Main
-export const DOC_BOOK = 'FVBook'
-export const DOC_CHAR = 'FVCharacter'
-export const DOC_PHRASE = 'FVPhrase'
-export const DOC_SONG = 'FVSong'
-export const DOC_STORY = 'FVBook'
-export const DOC_STORYPAGE = 'FVBookEntry'
-export const DOC_WORD = 'FVWord'
-// Media
-export const DOC_AUDIO = 'FVAudio'
-export const DOC_IMAGE = 'FVPicture'
-export const DOC_VIDEO = 'FVVideo'
-
-// Other
-export const DOC_CATEGORY = 'FVCategory'
-export const DOC_SPEAKER = 'FVPerson'
-export const DOC_GALLERY = 'FVGallery'
-export const DOC_LABEL = 'FVLabel'
-export const DOC_PAGE = 'FVPage'
-export const DOC_SITE = 'FVDialect'
-export const DOC_WIDGET = 'FVWidget'
diff --git a/src/common/constants/index.js b/src/common/constants/index.js
index 97d92bc2c..0fa6d72fd 100644
--- a/src/common/constants/index.js
+++ b/src/common/constants/index.js
@@ -1,4 +1,3 @@
-export * from './docTypes'
 export * from './join'
 export * from './media'
 export * from './misc'
diff --git a/src/common/constants/searchParams.js b/src/common/constants/searchParams.js
index 8146eeb86..451c55af9 100644
--- a/src/common/constants/searchParams.js
+++ b/src/common/constants/searchParams.js
@@ -64,8 +64,9 @@ export const TYPE_STORY = 'story'
 export const TYPE_WORD = 'word'
 export const TYPE_ENTRY = 'word,phrase,song,story'
 export const TYPE_DICTIONARY = 'word,phrase'
-export const TYPE_MEDIA = 'audio,image,video'
+export const TYPE_MEDIA = 'audio,document,image,video'
 export const TYPE_AUDIO = 'audio'
+export const TYPE_DOCUMENT = 'document'
 export const TYPE_IMAGE = 'image'
 export const TYPE_VIDEO = 'video'
 
diff --git a/src/common/dataAdaptors/mediaAdaptors.js b/src/common/dataAdaptors/mediaAdaptors.js
index 64e56ed57..ea3278f9f 100644
--- a/src/common/dataAdaptors/mediaAdaptors.js
+++ b/src/common/dataAdaptors/mediaAdaptors.js
@@ -23,7 +23,7 @@ export const mediaSearchAdaptor = ({ type, data }) => {
         width: data?.original?.width,
       }
     default:
-      return { ...data, message: 'NOT a media document' }
+      return { ...data, message: 'NOT a media type' }
   }
 }
 
diff --git a/src/common/dataHooks/useCreateUppy.js b/src/common/dataHooks/useCreateUppy.js
index 053c53e29..f5864c95f 100644
--- a/src/common/dataHooks/useCreateUppy.js
+++ b/src/common/dataHooks/useCreateUppy.js
@@ -87,7 +87,10 @@ function useCreateUppy({ maxItems, setSelectedMedia, type }) {
         },
       })
       .use(XHR, {
-        endpoint: api.media.getUploadEndpoint(site?.sitename, mediaTypePath),
+        endpoint: api.media.getUploadEndpoint({
+          sitename: site?.sitename,
+          mediaTypePath,
+        }),
         fieldName: 'original',
         formData: true,
         headers: getAuthHeaderIfTokenExists(),
diff --git a/src/common/hooks/useIdArrayField.js b/src/common/hooks/useIdArrayField.js
index 0f2759300..6259600f0 100644
--- a/src/common/hooks/useIdArrayField.js
+++ b/src/common/hooks/useIdArrayField.js
@@ -18,7 +18,7 @@ function useIdArrayField(nameId, control) {
     onChange([...value, item])
   }
 
-  // Can be multiple ids for a list of documents
+  // Can be multiple ids for a list of items
   // or can be just one item's id
   const addItems = (items) => {
     if (Array.isArray(items)) {
diff --git a/src/common/utils/stringHelpers.js b/src/common/utils/stringHelpers.js
index aef3ad56c..619b66654 100644
--- a/src/common/utils/stringHelpers.js
+++ b/src/common/utils/stringHelpers.js
@@ -1,14 +1,6 @@
 /* eslint-disable max-lines */
 // FPCC
 import {
-  DOC_BOOK,
-  DOC_CATEGORY,
-  DOC_PAGE,
-  DOC_PHRASE,
-  DOC_WORD,
-  DOC_AUDIO,
-  DOC_IMAGE,
-  DOC_VIDEO,
   MEMBERS,
   PUBLIC,
   TEAM,
@@ -20,6 +12,7 @@ import {
   TYPE_SONG,
   TYPE_MEDIA,
   TYPE_AUDIO,
+  TYPE_DOCUMENT,
   TYPE_IMAGE,
   TYPE_VIDEO,
   UUID_REGEX,
@@ -45,76 +38,47 @@ export const extractTextFromHtml = (htmlString) => {
   return span.textContent || span.innerText
 }
 
-export const getFriendlyDocType = ({
-  docType,
+export const getFriendlyType = ({
+  type,
   plural = false,
   titleCase = false,
 }) => {
-  // Temporarily adding redundant cases to use the function with updated media types
-  // until we completely switch over to new document types
   let friendly = ''
-  switch (docType) {
-    case DOC_AUDIO:
+  switch (type) {
     case TYPE_AUDIO:
     case 'audio':
       friendly = 'audio'
       break
-    case DOC_BOOK:
-      friendly = plural ? 'songs/stories' : 'song/story'
-      break
-    case DOC_CATEGORY:
-      friendly = plural ? 'categories' : 'category'
+    case TYPE_DOCUMENT:
+      friendly = plural ? 'documents' : 'document'
       break
-    case DOC_IMAGE:
     case TYPE_IMAGE:
     case 'image':
     case 'images':
       friendly = plural ? 'images' : 'image'
       break
-    case DOC_PAGE:
-      friendly = plural ? 'custom pages' : 'custom page'
-      break
-    case DOC_PHRASE:
     case TYPE_PHRASE:
+    case 'phrase':
+    case 'phrases':
       friendly = plural ? 'phrases' : 'phrase'
       break
-    case DOC_VIDEO:
     case TYPE_VIDEO:
     case 'video':
     case 'videos':
       friendly = plural ? 'videos' : 'video'
       break
-    case DOC_WORD:
     case TYPE_WORD:
+    case 'word':
+    case 'words':
       friendly = plural ? 'words' : 'word'
       break
     default:
-      friendly = plural ? 'documents' : 'document'
+      friendly = plural ? 'types' : 'type'
       break
   }
   return titleCase ? makeTitleCase(friendly) : friendly
 }
 
-export const getFriendlyDocTypes = ({
-  docTypes,
-  plural = false,
-  titleCase = false,
-  isAnd = false,
-}) => {
-  const friendlyTypes = docTypes?.map((docType) =>
-    getFriendlyDocType({ docType, plural, titleCase }),
-  )
-  return friendlyTypes?.reduce((result, item, i) => {
-    if (i === 0) {
-      return item
-    }
-
-    const isLastItem = i === friendlyTypes.length - 1
-    const finalConnector = isAnd ? ' and ' : ' or '
-    return isLastItem ? result + finalConnector + item : `${result}, ${item}`
-  }, '')
-}
-
 export const convertStateToVisibility = (state) => {
   switch (state) {
     case 'New':
diff --git a/src/components/Actions/Copy.js b/src/components/Actions/Copy.js
index a126df10f..92878359b 100644
--- a/src/components/Actions/Copy.js
+++ b/src/components/Actions/Copy.js
@@ -5,8 +5,7 @@ import PropTypes from 'prop-types'
 import getIcon from 'common/utils/getIcon'
 import copyToClipboard from 'common/utils/copyToClipboard'
 function Copy({
-  docId,
-  docTitle,
+  textToCopy,
   iconStyling = 'h-8 w-8 md:h-6 md:w-6',
   withLabels = false,
   withConfirmation = false,
@@ -29,9 +28,12 @@ function Copy({
     <button
       type="button"
       id="CopyAction"
+      data-testid={`copy-btn-${textToCopy}`}
       aria-label="Copy to clipboard"
       className="relative inline-flex items-center text-sm font-medium text-charcoal-900 hover:text-black group"
-      onClick={() => copyToClipboard({ text: docTitle, confirmationCallback })}
+      onClick={() =>
+        copyToClipboard({ text: textToCopy, confirmationCallback })
+      }
     >
       {getIcon('Copy', `fill-current ${iconStyling}`)}
       {hoverTooltip ? (
@@ -42,19 +44,13 @@ function Copy({
       {withLabels ? (
         <>
           <span className="mx-2">COPY</span>
-          <span
-            id={`copy-message-${docId}`}
-            className={confirmation ? '' : 'hidden'}
-          >
+          <span className={confirmation ? '' : 'hidden'}>
             <span className="absolute bottom-1 -right-1 bg-white">COPIED</span>
           </span>
         </>
       ) : null}
       {withTooltip ? (
-        <span
-          id={`copy-message-${docId}`}
-          className={confirmation ? '' : 'hidden'}
-        >
+        <span className={confirmation ? '' : 'hidden'}>
           <div className="absolute bottom-0 -right-1 w-auto p-1 text-sm bg-charcoal-500 text-white text-center rounded-lg shadow-lg ">
             Copied
           </div>
@@ -66,8 +62,7 @@ function Copy({
 // PROPTYPES
 const { bool, string } = PropTypes
 Copy.propTypes = {
-  docId: string,
-  docTitle: string,
+  textToCopy: string,
   iconStyling: string,
   withLabels: bool,
   withConfirmation: bool,
diff --git a/src/components/ActionsMenu/ActionsMenuPresentation.js b/src/components/ActionsMenu/ActionsMenuPresentation.js
index 5ca57972e..a9f367e11 100644
--- a/src/components/ActionsMenu/ActionsMenuPresentation.js
+++ b/src/components/ActionsMenu/ActionsMenuPresentation.js
@@ -29,8 +29,7 @@ function ActionsMenuPresentation({
       {/* Pinned Action Buttons */}
       {actions.includes('copy') ? (
         <Copy
-          docId={entry?.id}
-          docTitle={entry?.title}
+          textToCopy={entry?.title}
           iconStyling={iconStyling}
           withLabels={withLabels}
           withConfirmation={withConfirmation}
diff --git a/src/components/AddMediaModalWrapper/AddMediaModalWrapper.js b/src/components/AddMediaModalWrapper/AddMediaModalWrapper.js
index 4f316b19a..ecb94bb38 100644
--- a/src/components/AddMediaModalWrapper/AddMediaModalWrapper.js
+++ b/src/components/AddMediaModalWrapper/AddMediaModalWrapper.js
@@ -2,9 +2,14 @@ import React from 'react'
 import PropTypes from 'prop-types'
 
 // FPCC
-import { TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO } from 'common/constants'
+import {
+  TYPE_AUDIO,
+  TYPE_DOCUMENT,
+  TYPE_IMAGE,
+  TYPE_VIDEO,
+} from 'common/constants'
 import Modal from 'components/Modal'
-import { getFriendlyDocType } from 'common/utils/stringHelpers'
+import { getFriendlyType } from 'common/utils/stringHelpers'
 import getIcon from 'common/utils/getIcon'
 
 function AddMediaModalWrapper({
@@ -23,7 +28,7 @@ function AddMediaModalWrapper({
     const tabHasSelectedItems = itemsSelected && currentTab.id === tab.id
     // If no files are uploaded/selected, allow the user to switch tabs
     // otherwise switch to Insert Media button
-    // allowing user to attach the selected/uploaded files to the document.
+    // allowing user to attach the selected/uploaded files.
     const handleOnClick = () => {
       if (tabHasSelectedItems) updateFormMedia(selectedMedia)
       setCurrentTab(tab)
@@ -44,8 +49,8 @@ function AddMediaModalWrapper({
         {getIcon(tabHasSelectedItems ? 'Add' : tab?.icon, 'btn-icon')}
         <span>
           {tabHasSelectedItems
-            ? `Insert ${selectedMedia.length} ${getFriendlyDocType({
-                docType: type,
+            ? `Insert ${selectedMedia.length} ${getFriendlyType({
+                type,
                 plural: true,
               })}`
             : tab.btnLabel}
@@ -83,7 +88,7 @@ const { array, bool, func, node, object, oneOf } = PropTypes
 AddMediaModalWrapper.propTypes = {
   selectedMedia: array,
   updateFormMedia: func,
-  type: oneOf([TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO]),
+  type: oneOf([TYPE_AUDIO, TYPE_DOCUMENT, TYPE_IMAGE, TYPE_VIDEO]),
   tabOptions: array,
   children: node,
   closeModal: func,
diff --git a/src/components/Alphabet/AlphabetPresentationSelected.js b/src/components/Alphabet/AlphabetPresentationSelected.js
index 3802d0c98..8f8d4769c 100644
--- a/src/components/Alphabet/AlphabetPresentationSelected.js
+++ b/src/components/Alphabet/AlphabetPresentationSelected.js
@@ -45,7 +45,7 @@ function AlphabetPresentationSelected({
         )}
         {title ? (
           <Copy
-            docTitle={title}
+            textToCopy={title}
             iconStyling="fill-current text-blumine-800 h-6 w-6 sm:w-8 sm:h-8 ml-2"
             withConfirmation
             withTooltip
diff --git a/src/components/ByCategory/ByCategoryFilters.js b/src/components/ByCategory/ByCategoryFilters.js
index 2dc77b6a5..ae12c831b 100644
--- a/src/components/ByCategory/ByCategoryFilters.js
+++ b/src/components/ByCategory/ByCategoryFilters.js
@@ -23,7 +23,9 @@ function ByCategoryFilters({
       >
         <Link
           className="transition duration-500 ease-in-out flex items-center cursor-pointer rounded-lg text-charcoal-700"
-          to={`/${sitename}/${kids ? 'kids/' : ''}categories/${category.id}`}
+          to={`/${sitename}/${kids ? 'kids/' : ''}categories/${
+            category.id
+          }?types=${searchType}`}
         >
           {getCategoryIcon(
             category.title,
@@ -55,7 +57,7 @@ function ByCategoryFilters({
               className="transition duration-500 ease-in-out rounded-lg pr-4 flex items-center cursor-pointer text-charcoal-700 bg-charcoal-200"
               to={`/${sitename}/${kids ? 'kids/' : ''}categories/${
                 currentParentCategory.id
-              }?docType=${searchType}`}
+              }?types=${searchType}`}
             >
               {getCategoryIcon(
                 currentParentCategory.title,
@@ -83,7 +85,7 @@ function ByCategoryFilters({
                     }`}
                     to={`/${sitename}/${kids ? 'kids/' : ''}categories/${
                       child.id
-                    }?docType=${searchType}`}
+                    }?types=${searchType}`}
                   >
                     {getIcon(
                       'Placeholder',
diff --git a/src/components/DashboardMediaAudio/DashboardMediaAudioPresentation.js b/src/components/DashboardMediaAudio/DashboardMediaAudioPresentation.js
index 9238c2029..8f123ff80 100644
--- a/src/components/DashboardMediaAudio/DashboardMediaAudioPresentation.js
+++ b/src/components/DashboardMediaAudio/DashboardMediaAudioPresentation.js
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types'
 // FPCC
 import AudioNative from 'components/AudioNative'
 import MediaDetails from 'components/MediaDetails'
-import { TYPE_AUDIO } from 'common/constants'
 import InfiniteLoadBtn from 'components/InfiniteLoadBtn'
 
 function DashboardMediaAudioPresentation({ infiniteQueryResponse }) {
@@ -84,10 +83,7 @@ function DashboardMediaAudioPresentation({ infiniteQueryResponse }) {
         </section>
       </main>
       <aside className="col-span-1 bg-white p-8 border-1 border-charcoal-100">
-        <MediaDetails.Audio
-          file={infiniteQueryResponse?.currentFile}
-          docType={TYPE_AUDIO}
-        />
+        <MediaDetails.Audio file={infiniteQueryResponse?.currentFile} />
       </aside>
     </div>
   )
diff --git a/src/components/DashboardMediaVisual/DashboardMediaVisualPresentation.js b/src/components/DashboardMediaVisual/DashboardMediaVisualPresentation.js
index 12b504b25..c1d93a3f8 100644
--- a/src/components/DashboardMediaVisual/DashboardMediaVisualPresentation.js
+++ b/src/components/DashboardMediaVisual/DashboardMediaVisualPresentation.js
@@ -90,7 +90,7 @@ function DashboardMediaVisualPresentation({ infiniteQueryResponse, type }) {
       <aside className="col-span-1 bg-white p-8 border-1 border-charcoal-100">
         <MediaDetails.Visual
           file={infiniteQueryResponse?.currentFile}
-          docType={type}
+          type={type}
         />
       </aside>
     </div>
diff --git a/src/components/DeleteButtonMedia/DeleteButtonMediaPresentation.js b/src/components/DeleteButtonMedia/DeleteButtonMediaPresentation.js
index 641fe77ab..6bbbf219d 100644
--- a/src/components/DeleteButtonMedia/DeleteButtonMediaPresentation.js
+++ b/src/components/DeleteButtonMedia/DeleteButtonMediaPresentation.js
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types'
 import getIcon from 'common/utils/getIcon'
 import Modal from 'components/Modal'
 
-function DeleteButtonMediaPresentation({ docType, usage, deleteHandler }) {
+function DeleteButtonMediaPresentation({ type, usage, deleteHandler }) {
   const [deleteModalOpen, setDeleteModalOpen] = useState(false)
 
   return (
@@ -30,10 +30,10 @@ function DeleteButtonMediaPresentation({ docType, usage, deleteHandler }) {
         >
           <div className="text-center space-y-2">
             <p className="text-xl text-charcoal-900">
-              Are you sure you want to delete this {docType} from your site ?
+              Are you sure you want to delete this {type} from your site ?
             </p>
             <p>
-              This {docType} file is being used on your site in{' '}
+              This {type} file is being used on your site in{' '}
               <span className="font-bold">{usage?.total}</span> places. Deleting
               it will remove it from all of them. Are you sure you want to
               delete it?
@@ -71,7 +71,7 @@ function DeleteButtonMediaPresentation({ docType, usage, deleteHandler }) {
 // PROPTYPES
 const { func, object, string } = PropTypes
 DeleteButtonMediaPresentation.propTypes = {
-  docType: string,
+  type: string,
   usage: object,
   deleteHandler: func,
 }
diff --git a/src/components/DictionaryCrud/DictionaryCrudPresentation.js b/src/components/DictionaryCrud/DictionaryCrudPresentation.js
index 7c1cd6fc1..c3f0f64ee 100644
--- a/src/components/DictionaryCrud/DictionaryCrudPresentation.js
+++ b/src/components/DictionaryCrud/DictionaryCrudPresentation.js
@@ -6,7 +6,7 @@ import * as yup from 'yup'
 // FPCC
 import Form from 'components/Form'
 import DeleteButton from 'components/DeleteButton'
-import { getFriendlyDocType } from 'common/utils/stringHelpers'
+import { getFriendlyType } from 'common/utils/stringHelpers'
 import { TYPE_WORD, TYPE_PHRASE, PUBLIC, WARNING } from 'common/constants'
 import getIcon from 'common/utils/getIcon'
 import { definitions } from 'common/utils/validationHelpers'
@@ -83,7 +83,7 @@ function DictionaryCrudPresentation({
   })
 
   const steps = [
-    { title: `Add ${getFriendlyDocType({ docType: type })} content` },
+    { title: `Add ${getFriendlyType({ type })} content` },
     { title: 'Add media and other info' },
     { title: 'Save and finish' },
   ]
@@ -118,8 +118,8 @@ function DictionaryCrudPresentation({
           <Fragment key={step}>
             <div className="col-span-12">
               <Form.TextField
-                label={`${getFriendlyDocType({
-                  docType: type,
+                label={`${getFriendlyType({
+                  type,
                   titleCase: true,
                 })} in your language`}
                 nameId="title"
@@ -129,8 +129,8 @@ function DictionaryCrudPresentation({
             </div>
             <div className="col-span-12">
               <Form.TextArrayField
-                label={`${getFriendlyDocType({
-                  docType: type,
+                label={`${getFriendlyType({
+                  type,
                   titleCase: true,
                 })} translations`}
                 nameId="translations"
@@ -155,7 +155,7 @@ function DictionaryCrudPresentation({
                 nameId="categories"
                 control={control}
                 register={register}
-                docCountLimit={8}
+                maxItems={8}
                 errors={errors}
               />
             </div>
@@ -165,9 +165,9 @@ function DictionaryCrudPresentation({
                 nameId="relatedEntries"
                 control={control}
                 register={register}
-                helpText={`Words and phrases related to your ${getFriendlyDocType(
-                  { docType: type },
-                )}`}
+                helpText={`Words and phrases related to your ${getFriendlyType({
+                  type,
+                })}`}
                 maxItems={10}
                 types={[TYPE_WORD, TYPE_PHRASE]}
                 errors={errors}
@@ -275,9 +275,7 @@ function DictionaryCrudPresentation({
       className="flex flex-col max-w-5xl p-8 space-y-4 min-h-screen"
     >
       <div className="w-full flex justify-center">
-        <Form.Header
-          title={`Create ${getFriendlyDocType({ docType: type })}`}
-        />
+        <Form.Header title={`Create ${getFriendlyType({ type })}`} />
       </div>
       <Form.Stepper onClickCallback={stepHandle} steps={steps} />
       <form
@@ -341,26 +339,24 @@ function DictionaryCrudPresentation({
       <div>
         <div className="w-full flex justify-center">
           <Form.Header
-            title={`Edit ${getFriendlyDocType({ docType: type })}: ${
-              dataToEdit?.title
-            }`}
+            title={`Edit ${getFriendlyType({ type })}: ${dataToEdit?.title}`}
           />
         </div>
         <div className="flex w-full justify-end">
           <DeleteButton.Presentation
             deleteHandler={deleteHandler}
-            label={`Delete ${getFriendlyDocType({ docType: type })}`}
-            message={`Are you sure you want to delete this ${getFriendlyDocType(
-              { docType: type },
-            )} from your site?`}
+            label={`Delete ${getFriendlyType({ type })}`}
+            message={`Are you sure you want to delete this ${getFriendlyType({
+              type,
+            })} from your site?`}
           />
         </div>
         {dataToEdit?.isImmersionLabel && (
           <div className="flex w-full justify-center mt-2">
             <AlertBanner.Presentation
               alertType={WARNING}
-              message={`This ${getFriendlyDocType({
-                docType: type,
+              message={`This ${getFriendlyType({
+                type,
               })} is being used as an immersion label for your site. Any edits to its spelling or visibility will impact the places where that label appears.`}
             />
           </div>
@@ -384,9 +380,7 @@ function DictionaryCrudPresentation({
           <div>
             <Form.SubmitButtons
               submitLabel={
-                isCreate
-                  ? `Add ${getFriendlyDocType({ docType: type })}`
-                  : 'Save changes'
+                isCreate ? `Add ${getFriendlyType({ type })}` : 'Save changes'
               }
               submitIcon={isCreate ? 'Add' : 'Save'}
               cancelIcon={isCreate ? 'BackArrow' : 'Close'}
diff --git a/src/components/Form/AudioArrayField.js b/src/components/Form/AudioArrayField.js
index 6f06fbba6..497468675 100644
--- a/src/components/Form/AudioArrayField.js
+++ b/src/components/Form/AudioArrayField.js
@@ -32,14 +32,14 @@ function AudioArrayField({
       <div data-testid="AudioArrayField" className="space-y-2">
         <div>
           {value?.length > 0 &&
-            value?.map((docId) => (
+            value?.map((id) => (
               <div
-                key={`${docId}`}
+                key={`${id}`}
                 className="inline-flex border border-transparent bg-white rounded-lg shadow-md text-sm font-medium p-2 space-x-1 mr-2 mb-2"
               >
-                <MediaThumbnail.Audio id={docId} />
+                <MediaThumbnail.Audio id={id} />
 
-                <XButton onClickHandler={() => removeItem(docId)} />
+                <XButton onClickHandler={() => removeItem(id)} />
               </div>
             ))}
         </div>
diff --git a/src/components/Form/SelectOneMedia.js b/src/components/Form/SelectOneMedia.js
index 043dbf03f..6778293c5 100644
--- a/src/components/Form/SelectOneMedia.js
+++ b/src/components/Form/SelectOneMedia.js
@@ -84,7 +84,7 @@ function SelectOneButton({ value, onChange }) {
         label="Add Media"
         onClickHandler={() => setMediaChoiceModalOpen(true)}
       />
-      {/* Choose between doc types Modal */}
+      {/* Choose between types Modal */}
       <Modal.Presentation
         isOpen={mediaChoiceModalOpen}
         closeHandler={() => setMediaChoiceModalOpen(false)}
diff --git a/src/components/MediaDetails/MediaDetailsVisual.js b/src/components/MediaDetails/MediaDetailsVisual.js
index 7ed97dbe6..c07a51450 100644
--- a/src/components/MediaDetails/MediaDetailsVisual.js
+++ b/src/components/MediaDetails/MediaDetailsVisual.js
@@ -8,7 +8,7 @@ import getIcon from 'common/utils/getIcon'
 import { IMAGE, VIDEO } from 'common/constants'
 import MediaDetailsSettings from 'components/MediaDetails/MediaDetailsSettings'
 
-function MediaDetailsVisual({ file, docType }) {
+function MediaDetailsVisual({ file, type }) {
   const { sitename } = useParams()
 
   return (
@@ -20,7 +20,7 @@ function MediaDetailsVisual({ file, docType }) {
         </a>
 
         <Link
-          to={`/${sitename}/dashboard/edit/${docType}?id=${file?.id}`}
+          to={`/${sitename}/dashboard/edit/${type}?id=${file?.id}`}
           data-testid="EntryDrawerEdit"
           target="_blank"
           rel="noopener noreferrer"
@@ -32,14 +32,14 @@ function MediaDetailsVisual({ file, docType }) {
       </div>
       <div>
         <div className="block w-full max-h-1/3-screen rounded-lg overflow-hidden">
-          {docType === IMAGE && (
+          {type === IMAGE && (
             <img
               src={getMediaPath({ mediaObject: file, type: IMAGE })}
               alt={file?.title}
               className="object-contain w-full"
             />
           )}
-          {docType === VIDEO && (
+          {type === VIDEO && (
             <video
               className="w-full aspect-video"
               src={getMediaPath({ mediaObject: file, type: VIDEO })}
@@ -67,7 +67,7 @@ function MediaDetailsVisual({ file, docType }) {
 const { object, oneOf } = PropTypes
 MediaDetailsVisual.propTypes = {
   file: object,
-  docType: oneOf([IMAGE, VIDEO]),
+  type: oneOf([IMAGE, VIDEO]),
 }
 
 export default MediaDetailsVisual
diff --git a/src/components/MediaEdit/MediaEditPresentation.js b/src/components/MediaEdit/MediaEditPresentation.js
index c5a3cc1d2..ac45bebc2 100644
--- a/src/components/MediaEdit/MediaEditPresentation.js
+++ b/src/components/MediaEdit/MediaEditPresentation.js
@@ -9,7 +9,7 @@ import { definitions } from 'common/utils/validationHelpers'
 import { usePeople } from 'common/dataHooks/usePeople'
 import AudioNative from 'components/AudioNative'
 import { AUDIO, IMAGE, VIDEO } from 'common/constants'
-import { getFriendlyDocType } from 'common/utils/stringHelpers'
+import { getFriendlyType } from 'common/utils/stringHelpers'
 import { getMediaPath } from 'common/utils/mediaHelpers'
 
 function MediaEditPresentation({
@@ -49,8 +49,8 @@ function MediaEditPresentation({
     value: entry?.id,
   }))
 
-  const titleCaseDocType = getFriendlyDocType({
-    docType: mediaType,
+  const titleCaseDocType = getFriendlyType({
+    type: mediaType,
     titleCase: true,
   })
 
diff --git a/src/components/PageCrud/PageCrudPresentation.js b/src/components/PageCrud/PageCrudPresentation.js
index 217229e68..0e4f1e922 100644
--- a/src/components/PageCrud/PageCrudPresentation.js
+++ b/src/components/PageCrud/PageCrudPresentation.js
@@ -5,7 +5,6 @@ import { Link } from 'react-router-dom'
 // FPCC
 import WidgetAreaEdit from 'components/WidgetAreaEdit'
 import getIcon from 'common/utils/getIcon'
-// import VisibilitySelect from 'components/VisibilitySelect'
 
 function PageCrudPresentation({ dataToEdit, site }) {
   return (
@@ -33,10 +32,6 @@ function PageCrudPresentation({ dataToEdit, site }) {
               {getIcon('Link', 'btn-icon')}
               <span>View Page</span>
             </Link>
-            {/* <VisibilitySelect.Container
-              id={dataToEdit?.id}
-              docState={dataToEdit?.state}
-            /> */}
             <Link
               type="button"
               to={`/${site?.sitename}/dashboard/edit/page?slug=${dataToEdit?.slug}&editHeader=true`}
diff --git a/src/components/SelectorEntries/SelectorEntriesPresentationList.js b/src/components/SelectorEntries/SelectorEntriesPresentationList.js
index a7c54b583..85c4c0e43 100644
--- a/src/components/SelectorEntries/SelectorEntriesPresentationList.js
+++ b/src/components/SelectorEntries/SelectorEntriesPresentationList.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
 import { useSearchParams } from 'react-router-dom'
 
 // FPCC
-import { getFriendlyDocType } from 'common/utils/stringHelpers'
+import { getFriendlyType } from 'common/utils/stringHelpers'
 import getIcon from 'common/utils/getIcon'
 import InfiniteLoadBtn from 'components/InfiniteLoadBtn'
 
@@ -36,7 +36,7 @@ function SelectorEntriesPresentationList({
                 <th scope="col" className={headerClass}>
                   {isMultiDocType
                     ? 'Language Entry'
-                    : getFriendlyDocType({ docType: types[0] })}
+                    : getFriendlyType({ type: types[0] })}
                 </th>
                 <th scope="col" className={headerClass}>
                   Translation
diff --git a/src/components/StoryPagesCrud/storyPagesDataAdaptor.js b/src/components/StoryPagesCrud/storyPagesDataAdaptor.js
deleted file mode 100644
index eb93879f0..000000000
--- a/src/components/StoryPagesCrud/storyPagesDataAdaptor.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import wysiwygStateHelpers from 'common/utils/wysiwygStateHelpers'
-import {
-  selectOneMediaFormHelper,
-  selectOneMediaDataHelper,
-} from 'common/utils/mediaHelpers'
-import { isUUID } from 'common/utils/stringHelpers'
-
-export const storyPagesDataAdaptor = ({ data }) => {
-  const pageArray = data?.contextParameters?.book?.pages || []
-
-  if (!pageArray?.length) {
-    return {}
-  }
-
-  const { getWysiwygStateFromJson } = wysiwygStateHelpers()
-
-  function formatPage(page) {
-    let formattedData = null
-
-    const videos = page.related_videos || []
-    const images = page.related_pictures || []
-
-    const textJson = page.text || ''
-    const textState = getWysiwygStateFromJson(textJson)
-
-    formattedData = {
-      id: page?.uid || '',
-      text: textJson,
-      textPreview: `${textState?.getPlainText().slice(0, 150)}...`,
-      textTranslation: page.textTranslation,
-      audio: page.related_audio || [],
-      notes: page?.notes,
-      visualMedia: selectOneMediaDataHelper(images, videos),
-    }
-
-    return formattedData
-  }
-
-  const pageMap = {}
-
-  pageArray.forEach((page) => {
-    if (page?.uid) {
-      pageMap[page.uid] = formatPage(page)
-    }
-  })
-
-  return pageMap
-}
-
-// This adaptor is also used by the Story component
-export const pageOrderDataAdaptor = ({ data }) => {
-  const isV2 = !!data?.properties['fv:modifiedv2']
-  const rawPageData = data?.contextParameters?.book?.pages || []
-
-  if (isV2 && data?.properties['fvbook:pages']?.length > 0) {
-    return data?.properties['fvbook:pages']
-  }
-  const hasSortMaps =
-    rawPageData?.length > 0 && rawPageData[0]?.sortMap !== null
-  const pageOrder = hasSortMaps
-    ? rawPageData
-        .slice()
-        .sort((a, b) => a?.sortMap > b?.sortMap)
-        .map((p) => p?.uid)
-    : rawPageData?.map((p) => p.uid)
-  return pageOrder
-}
-
-export const pageFormDataAdaptor = ({ formData }) => {
-  const { getJsonFromWysiwygState } = wysiwygStateHelpers()
-  const text = getJsonFromWysiwygState(formData?.text)
-  const textTranslation = getJsonFromWysiwygState(formData?.textTranslation)
-  const mediaObject = selectOneMediaFormHelper(formData?.visualMedia)
-
-  return {
-    'fvbookentry:text': text,
-    'fvbookentry:text_translation': textTranslation,
-    'fv:notes': formData?.notes,
-    'fv:related_audio': formData?.audio,
-    'fv:related_pictures': isUUID(mediaObject?.imageId)
-      ? [mediaObject?.imageId]
-      : [],
-    'fv:related_videos': isUUID(mediaObject?.videoId)
-      ? [mediaObject?.videoId]
-      : [],
-    'fv:modifiedv2': true,
-  }
-}
diff --git a/src/components/VisibilitySelect/VisibilitySelectContainer.js b/src/components/VisibilitySelect/VisibilitySelectContainer.js
deleted file mode 100644
index b571cd476..000000000
--- a/src/components/VisibilitySelect/VisibilitySelectContainer.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useState } from 'react'
-import PropTypes from 'prop-types'
-
-// FPCC
-import VisibilitySelectData from 'components/VisibilitySelect/VisibilitySelectData'
-import ConfirmationDialog from 'components/ConfirmationDialog'
-import { useModalControllerWithCallback } from 'common/hooks/useModalController'
-import Listbox from 'components/Listbox'
-import { PUBLIC, MEMBERS, TEAM } from 'common/constants'
-
-function VisibilitySelectContainer({ id, docState, successCallback }) {
-  const { submitHandler, docVisibility, visibilityOptions } =
-    VisibilitySelectData({ id, docState, successCallback })
-  const [selectedOption, setSelectedOption] = useState(null)
-  const { modalOpen, openModal, closeModal, closeWithCallback } =
-    useModalControllerWithCallback({
-      onCloseCallback: () => submitHandler(selectedOption),
-    })
-
-  const setValue = (value) => {
-    setSelectedOption(value)
-    openModal()
-  }
-
-  return (
-    <div id="VisibilitySelectContainer">
-      <div className="w-52">
-        <Listbox.Presentation
-          selectedValue={docVisibility}
-          options={visibilityOptions}
-          setValue={setValue}
-        />
-      </div>
-      <ConfirmationDialog.Presentation
-        onConfirmation={closeWithCallback}
-        isOpen={modalOpen}
-        closeHandler={closeModal}
-        message={`Do you want to change who can see this to ${selectedOption}?`}
-      />
-    </div>
-  )
-}
-// PROPTYPES
-const { func, string, oneOf } = PropTypes
-VisibilitySelectContainer.propTypes = {
-  id: string,
-  docState: oneOf([
-    'New',
-    'Disabled',
-    'Enabled',
-    'Published',
-    PUBLIC,
-    TEAM,
-    MEMBERS,
-  ]),
-  successCallback: func,
-}
-
-export default VisibilitySelectContainer
diff --git a/src/components/VisibilitySelect/VisibilitySelectData.js b/src/components/VisibilitySelect/VisibilitySelectData.js
deleted file mode 100644
index e43949a20..000000000
--- a/src/components/VisibilitySelect/VisibilitySelectData.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import { useState, useEffect } from 'react'
-import { useTranslation } from 'react-i18next'
-
-// FPCC
-import api from 'services/api'
-import { useNotification } from 'context/NotificationContext'
-import {
-  convertStateToVisibility,
-  getFriendlyDocType,
-} from 'common/utils/stringHelpers'
-import { useSiteStore } from 'context/SiteContext'
-
-function VisibilitySelectData({ id, docState, successCallback }) {
-  const { site } = useSiteStore()
-  const { setNotification } = useNotification()
-  const [docVisibility, setDocVisibility] = useState(null)
-  const [t] = useTranslation()
-
-  useEffect(() => {
-    if (convertStateToVisibility(docState) !== docVisibility) {
-      setDocVisibility(convertStateToVisibility(docState))
-    }
-  }, [docState])
-
-  const updateVisibility = async (newVisibility) => {
-    const response = await api.visibility.update({
-      id,
-      newVisibility,
-    })
-    if (response?.uid) {
-      setNotification({
-        type: 'SUCCESS',
-        message: `Success! Your ${getFriendlyDocType(
-          response?.type,
-        )} is now visible to: ${t(`visibility.${newVisibility}`)}.`,
-      })
-      setDocVisibility(newVisibility)
-      if (successCallback) return successCallback()
-    } else {
-      setNotification({
-        type: 'ERROR',
-        message:
-          'ERROR: There was a problem changing visibility of the document. Please try again. If the error persists please contact FirstVoices Support.',
-      })
-    }
-  }
-
-  const submitHandler = (selectedVisibility) => {
-    if (docVisibility !== selectedVisibility)
-      updateVisibility(selectedVisibility)
-  }
-
-  return {
-    submitHandler,
-    docVisibility,
-    visibilityOptions: site?.visibilityOptions || [],
-  }
-}
-
-export default VisibilitySelectData
diff --git a/src/components/VisibilitySelect/index.js b/src/components/VisibilitySelect/index.js
deleted file mode 100644
index 40497eb50..000000000
--- a/src/components/VisibilitySelect/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import VisibilitySelectContainer from 'components/VisibilitySelect/VisibilitySelectContainer'
-import VisibilitySelectData from 'components/VisibilitySelect/VisibilitySelectData'
-
-export default {
-  Container: VisibilitySelectContainer,
-  Data: VisibilitySelectData,
-}
diff --git a/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js b/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js
index 0a0fa2db1..dff891e67 100644
--- a/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js
+++ b/src/components/WidgetAreaEdit/WidgetAreaEditPresentationSettingsPane.js
@@ -4,7 +4,6 @@ import { Link } from 'react-router-dom'
 
 // FPCC
 import Modal from 'components/Modal'
-// import VisibilitySelect from 'components/VisibilitySelect'
 import Widget from 'components/Widget'
 import WysiwygBlock from 'components/WysiwygBlock'
 
@@ -127,19 +126,13 @@ function WidgetAreaEditPresentationSettingsPane({
           <div className="my-2 col-span-3 flex items-center justify-end">
             <div className="flex justify-stretch flex-row space-x-4">
               {currentWidget?.editable ? (
-                <>
-                  {/* <VisibilitySelect.Container
-                    id={currentWidget?.id}
-                    docState={currentWidget?.visibility}
-                  /> */}
-                  <Link
-                    to={`/${site?.sitename}/dashboard/edit/widget?id=${currentWidget?.id}`}
-                    className="btn-outlined"
-                  >
-                    {getIcon('Pencil', 'btn-icon')}
-                    <span>Edit</span>
-                  </Link>
-                </>
+                <Link
+                  to={`/${site?.sitename}/dashboard/edit/widget?id=${currentWidget?.id}`}
+                  className="btn-outlined"
+                >
+                  {getIcon('Pencil', 'btn-icon')}
+                  <span>Edit</span>
+                </Link>
               ) : null}
               <button
                 data-testid="preview"
diff --git a/src/services/api/media.js b/src/services/api/media.js
index 578586871..1a7c74044 100644
--- a/src/services/api/media.js
+++ b/src/services/api/media.js
@@ -3,11 +3,11 @@ import { apiBase } from 'services/config'
 import { SITES, AUDIO_PATH, IMAGE_PATH, VIDEO_PATH } from 'common/constants'
 
 const media = {
-  get: async ({ sitename, docType, pageParam, perPage = 24 }) => {
+  get: async ({ sitename, mediaTypePath, pageParam, perPage = 24 }) => {
     // Get list of media files of specified type for given site
     const response = await apiBase()
       .get(
-        `${SITES}/${sitename}/${docType}/?page=${pageParam}&pageSize=${perPage}`,
+        `${SITES}/${sitename}/${mediaTypePath}/?page=${pageParam}&pageSize=${perPage}`,
       )
       .json()
     const lastPage = response?.previous
@@ -23,11 +23,9 @@ const media = {
     apiBase().get(`${SITES}/${sitename}/${IMAGE_PATH}/${id}`).json(),
   getVideo: async ({ sitename, id }) =>
     apiBase().get(`${SITES}/${sitename}/${VIDEO_PATH}/${id}`).json(),
-  getMediaDocument: async ({ sitename, docId, docType }) =>
-    apiBase().get(`${SITES}/${sitename}/${docType}/${docId}`).json(),
-  getUploadEndpoint: (sitename, docType) => {
+  getUploadEndpoint: ({ sitename, mediaTypePath }) => {
     const url = new URL(
-      `${SITES}/${sitename}/${docType}`,
+      `${SITES}/${sitename}/${mediaTypePath}`,
       GlobalConfiguration.API_URL,
     )
     return url.href


Reviews:
user: login: sahil97
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T21:05:19Z
user: login: sarahfirstvoices
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T21:08:27Z
user: login: sahil97
body: Other than the missing import, LGTM !
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T21:08:37Z
user: login: gmcauliffe
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T21:14:23Z
user: login: sahil97
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T21:15:03Z

Review comments:
diff_hunk: @@ -24,6 +16,7 @@ import {
   TYPE_VIDEO,
   UUID_REGEX,
 } from 'common/constants'
+import { TYPE_DOCUMENT } from '../constants/searchParams'
path: src/common/utils/stringHelpers.js
user: login: sahil97
body: I might be missing something or looking in the wrong file, but I don't see this added to the searchParams file as a part of this PR, and neither on the current code on dev. Could you please check ?
created_at: 2025-03-24T21:05:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -24,6 +16,7 @@ import {
   TYPE_VIDEO,
   UUID_REGEX,
 } from 'common/constants'
+import { TYPE_DOCUMENT } from '../constants/searchParams'
path: src/common/utils/stringHelpers.js
user: login: gmcauliffe
body: Great catch. Thanks :)
created_at: 2025-03-24T21:14:22Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-03-24T21:13:44Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=First-Peoples-Cultural-Council_fv-web&pullRequest=776)


author_association: NONE