From 9cf48bf0a6e0c30a111c0c09b2621e778f628839 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Feb 2025 16:19:22 -0500 Subject: [PATCH 01/50] Start of DocumentLibraryView --- .../DocumentDetailView/DocumentDetailView.css | 53 ++++++ .../DocumentDetailView.previewData.ts | 120 +++++++++++++ .../DocumentDetailView.stories.tsx | 95 +++++++++++ .../DocumentDetailView/DocumentDetailView.tsx | 159 ++++++++++++++++++ .../view/DocumentDetailView/index.ts | 1 + .../DocumentLibraryView.css | 0 .../DocumentLibraryView.previewData.ts | 25 +++ .../DocumentLibraryView.stories.tsx | 46 +++++ .../DocumentLibraryView.tsx | 142 ++++++++++++++++ .../view/DocumentLibraryView/index.ts | 1 + src/helpers/index.ts | 1 + src/helpers/query-all-survey-files.ts | 85 ++++++++++ src/helpers/strings-en.ts | 9 +- 13 files changed, 736 insertions(+), 1 deletion(-) create mode 100644 src/components/view/DocumentDetailView/DocumentDetailView.css create mode 100644 src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts create mode 100644 src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx create mode 100644 src/components/view/DocumentDetailView/DocumentDetailView.tsx create mode 100644 src/components/view/DocumentDetailView/index.ts create mode 100644 src/components/view/DocumentLibraryView/DocumentLibraryView.css create mode 100644 src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts create mode 100644 src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx create mode 100644 src/components/view/DocumentLibraryView/DocumentLibraryView.tsx create mode 100644 src/components/view/DocumentLibraryView/index.ts create mode 100644 src/helpers/query-all-survey-files.ts diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.css b/src/components/view/DocumentDetailView/DocumentDetailView.css new file mode 100644 index 000000000..89f76bb1d --- /dev/null +++ b/src/components/view/DocumentDetailView/DocumentDetailView.css @@ -0,0 +1,53 @@ +.mdhui-survey-answer-file-container { + max-width: 600px; + margin: auto; + padding: 16px; + border-radius: 8px; + background: #f9f9f9; + box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); +} + +.mdhui-survey-answer-file-preview-container { + width: 100%; + height: 55vh; + display: flex; + align-items: center; + justify-content: center; + background: #fff; + border-radius: 8px; + overflow: hidden; +} + +.mdhui-survey-answer-file-preview-content { + max-width: 100%; + max-height: 100%; + height: 90%; + width: 90%; +} + +.mdhui-survey-answer-file-image-preview { + object-fit: contain; +} + +.mdhui-survey-answer-file-document-file-name { + display: flex; + justify-content: center; + margin-top: 10px; +} + +.mdhui-survey-answer-file-document-details-parent { + padding: 10px; +} + +.mdhui-survey-answer-file-document-details { + font-size: .88em; + margin: 5px; +} + +.mdhui-survey-answer-file-download-button { + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: flex-end; + margin-bottom: 10px; +} \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts new file mode 100644 index 000000000..863fc6739 --- /dev/null +++ b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts @@ -0,0 +1,120 @@ +import { DocumentDetail, DocumentDetailViewPreviewType } from "./DocumentDetailView"; + +export function getPreviewData(preview: DocumentDetailViewPreviewType): DocumentDetail | undefined { + switch (preview) { + case "PreviewPdf": + return previewPdfData; + case "PreviewText": + return previewTxtData; + case "PreviewImage": + return previewImageData; + case "PreviewCsvFile": + return previewCsvFile; + case "PreviewMp4": + return previewMp4; + case "PreviewFileNotFound": + return previewFileNotFoundData; + case "PreviewUnknown": + return previewFileNotSupported; + default: + return undefined; + } +} + +const previewPdfData: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Sample Portrait PDF", + fileName: "PDF32000_2008.pdf", + type: "Test Results", + notes: "These are some notes for a sample PDF", + date: new Date(), + presignedDocUrl: "https://freelawlibrary.org/wp-content/uploads/2022/10/The-Constitution-Full-Text-The-National-Constitution-Center.pdf",//"https://constitutioncenter.org/media/files/constitution.pdf", + presignedImageUrl: "", + showDownload: false, + fileKey: "file key" +}; + +const previewTxtData: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Pride and Prejudice", + fileName: "PrideAndPrejudice.txt", + type: "Other", + notes: "These are some notes Pride and Prejudice in a text file format", + date: new Date(), + presignedDocUrl: "https://www.gutenberg.org/cache/epub/42671/pg42671.txt", + presignedImageUrl: "", + showDownload: false, + fileKey: "file key" +}; + +const previewImageData: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Sample Image File", + fileName: "CareevolutionLogo.svg", + type: "Images", + notes: "These are some notes for a sample image file", + date: new Date(), + presignedDocUrl: "", + presignedImageUrl: "https://careevolution.com/wp-content/themes/careevolution-2023/assets/images/logo.svg", + showDownload: false, + fileKey: "file key" +}; + +const previewFileNotFoundData: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Sample Image File", + fileName: "CareevolutionLogo.svg", + type: "Images", + notes: "These are some notes for a sample image file", + date: new Date(), + presignedDocUrl: "", + presignedImageUrl: "", + showDownload: false, + fileKey: "file key" +}; + +const previewCsvFile: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Sample Import File", + fileName: "ImportFile.csv", + type: "Images", + notes: "These are some notes for a sample csv file", + date: new Date(), + presignedDocUrl: "https://people.sc.fsu.edu/~jburkardt/data/csv/airtravel.csv", + presignedImageUrl: "", + showDownload: false, + fileKey: "file key" +}; + +const previewMp4: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Big Buck Bunny", + fileName: "BigBuckBunny_512kb.mp4", + type: "MP4 File", + notes: "The story follows Big Buck Bunny, a gentle and kind-hearted rabbit who enjoys nature. However, his peaceful life is disrupted by three mischievous rodents who bully smaller animals. After they go too far, Bunny decides to fight back, leading to a hilarious and satisfying revenge sequence.", + date: new Date(), + presignedDocUrl: "https://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4", + presignedImageUrl: "", + showDownload: false, + fileKey: "file key" +}; + +const previewFileNotSupported: DocumentDetail = { + surveyResultId: "12345", + fileCategory: "test category", + title: "Failing Document", + fileName: "AFailingDocument.zip", + type: "Zip", + notes: "This should display an error message", + date: new Date(), + presignedDocUrl: "https:/abc.123.org/AFailingDocument.zip", + presignedImageUrl: "", + showDownload: false, + fileKey: "file key" +}; diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx new file mode 100644 index 000000000..9d649df64 --- /dev/null +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -0,0 +1,95 @@ +import React from "react" +import { Meta, StoryObj } from "@storybook/react" +import { Description } from "@storybook/blocks" +import DocumentDetailView, { DocumentDetailViewProps } from "./DocumentDetailView"; + +const meta: Meta = { + title: "View/DocumentDetailView", + component: DocumentDetailView, + parameters: { + layout: 'fullscreen', + docs: { + Description: + } + } +}; + +export default meta; +type Story = StoryObj; + +const render = (args: DocumentDetailViewProps) => ; + +const uploadDocumentSurveyProps: DocumentDetailViewProps = { + surveyResultId: '', + uploadDocumentSurveyName: 'UploadDocument', + fileResultIdentifier: 'document', + typeResultIdentifier: 'document_type', + nameResultIdentifier: 'document_name', + dateResultIdentifier: 'document_date', + notesResultIdentifier: 'document_notes' +} + +export const Pdf: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewPdf' }, + render: render +}; + +export const Text: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewText' }, + render: render +}; + +export const Image: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewImage' }, + render: render +}; + +export const Csv: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewCsvFile' }, + render: render +}; + +export const Unsupported: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewUnknown' }, + render: render +}; + +export const Loading: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewLoading' }, + render: render +}; + +export const FileNotFound: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewFileNotFound' }, + render: render +}; + +export const LiveMultiPagePdf: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: '' }, + render: render +}; + +export const LiveSingleLandscapePdf: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: '2e3f7062-87e8-ef11-bafe-0affe8024cad' }, + render: render +}; + +export const LiveSinglePortraitPdf: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: '97477698-85e9-ef11-bafe-0affe8024cad' }, + render: render +}; + +export const LiveCsv: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: '540e6dc9-eeee-ef11-bafe-0affe8024cad' }, + render: render +}; + +export const LiveText: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: 'b1508427-a3e8-ef11-bafe-0affe8024cad' }, + render: render +}; + +export const LiveImage: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: 'a90c0337-cfe4-ef11-bafe-0affe8024cad' }, + render: render +}; \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx new file mode 100644 index 000000000..28ed644f5 --- /dev/null +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -0,0 +1,159 @@ +import React from "react"; +import { Button, Layout, LoadingIndicator, Title } from "../../presentational"; +import MyDataHelps from "@careevolution/mydatahelps-js"; +import { language, SurveyUploadedFileQueryParameters, useInitializeView } from "../../../helpers"; +import "./DocumentDetailView.css" +import queryAllSurveyFiles, { SurveyUploadedFile } from "../../../helpers/query-all-survey-files"; +import { getShortDateString } from "../../../helpers/date-helpers"; +import { getPreviewData } from "./DocumentDetailView.previewData"; + +export type DocumentDetailViewPreviewType = "PreviewPdf" | "PreviewText" | "PreviewImage" | "PreviewUnknown" | "PreviewCsvFile" | "PreviewMp4" | "PreviewFileNotFound" | "PreviewLoading"; + +export interface DocumentDetailViewProps { + preview?: DocumentDetailViewPreviewType, + surveyResultId: string, + uploadDocumentSurveyName: string, + fileResultIdentifier: string, + typeResultIdentifier: string, + nameResultIdentifier: string, + dateResultIdentifier: string, + notesResultIdentifier: string, + colorScheme?: "auto" | "light" | "dark" +} + +export interface DocumentDetail extends SurveyUploadedFile { + presignedDocUrl: string, + presignedImageUrl: string, + showDownload: boolean, + fileKey: string +} + +/** This view display a file uploaded by the user via specified survey */ +export default function DocumentDetailView(props: DocumentDetailViewProps) { + let [documentDetail, setDocumentDetail] = React.useState(); + + async function initialize() { + const params: SurveyUploadedFileQueryParameters = { + uploadDocumentSurveyName: props.uploadDocumentSurveyName, + fileResultIdentifier: props.fileResultIdentifier, + typeResultIdentifier: props.typeResultIdentifier, + nameResultIdentifier: props.nameResultIdentifier, + dateResultIdentifier: props.dateResultIdentifier, + notesResultIdentifier: props.notesResultIdentifier, + surveyResultId: props.surveyResultId + }; + + if (props.preview) { + if (props.preview !== "PreviewLoading") { + const previewData = getPreviewData(props.preview); + setDocumentDetail(previewData); + return; + } + } + + Promise.all([ + MyDataHelps.getDeviceInfo(), + queryAllSurveyFiles({ ...params }) + ]).then(([deviceInfo, uploadedFiles]) => { + if (uploadedFiles.length > 0) { + const file = uploadedFiles[0]; + MyDataHelps.queryFiles({ category: file.fileCategory }).then(function (files) { + if (files.files.length === 0) { + setDocumentDetail({ ...file } as DocumentDetail); + return; + } + + MyDataHelps.getFileDownloadUrl(files.files[0].key).then(function (response) { + let documentDetail: DocumentDetail = { + ...file, + presignedDocUrl: "", + presignedImageUrl: "", + showDownload: !["iOS", "Android"].includes(deviceInfo?.platform) && !file.fileName.endsWith("pdf"), + fileKey: files.files[0].key + }; + + if (isImageFile(file.fileName)) { + documentDetail.presignedImageUrl = response.preSignedUrl; + } else { + documentDetail.presignedDocUrl = response.preSignedUrl; + } + + setDocumentDetail(documentDetail); + }); + }); + } + }); + } + + function isImageFile(fileName: string) { + if (!fileName) return false; + + const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp', '.tiff', '.svg', '.ico', '.avif']; + const lowerCaseFileName = fileName.toLowerCase(); + + return imageExtensions.some(ext => lowerCaseFileName.endsWith(ext)); + } + + async function downloadFile() { + const deviceInfo = await MyDataHelps.getDeviceInfo(); + + if (!deviceInfo || deviceInfo.platform == "Web") { + window.open(documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl, "_blank"); + } else { + (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl }); + } + } + + const deleteFile = () => { + if (!documentDetail?.fileKey || !documentDetail?.surveyResultId) { + return; + } + + if (window.confirm(language("delete-file-confirm"))) { + MyDataHelps.deleteSurveyResult(props.surveyResultId); + MyDataHelps.deleteFile(documentDetail?.fileKey!); + setDocumentDetail(undefined); + MyDataHelps.dismiss(); + } + }; + + + useInitializeView(() => { + initialize(); + }, [], []); + + return ( + + {(!documentDetail) && } + {documentDetail?.showDownload && +
+ +
+ } + + {documentDetail && + <> +
+
+ {documentDetail?.presignedDocUrl && + } + {documentDetail?.presignedImageUrl && + {language("file-not-loaded")}} + {!documentDetail.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
} +
+
{documentDetail?.fileName}
+
+ +
+ {documentDetail?.type} +
{`${documentDetail?.title} - ${getShortDateString(documentDetail?.date!)}`}
+ {language("notes")} +
{documentDetail?.notes}
+ +
+ + } +
+ ); +} \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/index.ts b/src/components/view/DocumentDetailView/index.ts new file mode 100644 index 000000000..07d85b9fd --- /dev/null +++ b/src/components/view/DocumentDetailView/index.ts @@ -0,0 +1 @@ +export { default } from './DocumentDetailView'; \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.css b/src/components/view/DocumentLibraryView/DocumentLibraryView.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts b/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts new file mode 100644 index 000000000..ee38e85d0 --- /dev/null +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts @@ -0,0 +1,25 @@ +import { addWeeks } from "date-fns"; +import { SurveyUploadedFile } from "../../../helpers"; + +export function getPreviewData(): SurveyUploadedFile[] { + return [ + createUploadedFile("Sample Portrait PDF", "PDF32000_2008.pdf", "Test Results", "These are some notes for a sample PDF"), + createUploadedFile("Sample Text File", "MITLicense.MD", "Other", "These are some notes for a sample text file"), + createUploadedFile("Sample Image File", "CareevolutionLogo.svg", "Images", "These are some notes for a sample image file"), + createUploadedFile("Second Sample Portrait PDF", "PDF32000_2008.pdf", "Test Results", "These are some notes for a sample PDF"), + createUploadedFile("Second Sample Text File", "MITLicense.MD", "Other", "These are some notes for a sample text file"), + createUploadedFile("Second Sample Image File", "CareevolutionLogo.svg", "Images", "These are some notes for a sample image file") + ]; +} + +function createUploadedFile(title: string, fileName: string, type: string, notes?: string): SurveyUploadedFile { + return { + surveyResultId: "12345", + fileCategory: "", + title: title, + fileName: fileName, + type: type, + notes: notes, + date: addWeeks(new Date(), Math.floor(Math.random() * 10)) + }; +} \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx new file mode 100644 index 000000000..89d282919 --- /dev/null +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx @@ -0,0 +1,46 @@ +import React from "react" +import { Meta, StoryObj } from "@storybook/react" +import { Description } from "@storybook/blocks" +import DocumentLibraryView, { DocumentLibraryViewProps } from "./DocumentLibraryView" +import { Action } from "../../presentational"; + +const meta: Meta = { + title: "View/DocumentLibraryView", + component: DocumentLibraryView, + parameters: { + layout: 'fullscreen', + docs: { + Description: + } + } +}; + +export default meta; +type Story = StoryObj; + +const render = (args: DocumentLibraryViewProps) =>
; + +const defaultProps : DocumentLibraryViewProps = { + uploadDocumentSurveyName: 'UploadDocument', + fileResultIdentifier: 'document', + typeResultIdentifier: 'document_type', + nameResultIdentifier: 'document_name', + dateResultIdentifier: 'document_date', + notesResultIdentifier: 'document_notes', + documentViewBaseUrl: '' +}; + +export const Default: Story = { + args: { ...defaultProps, preview: 'Preview' }, + render: render +}; + +export const Loading: Story = { + args: { ...defaultProps, preview: 'PreviewLoading' }, + render: render +}; + +export const Live: Story = { + args: { ...defaultProps }, + render: render +}; \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx new file mode 100644 index 000000000..e1250cd4a --- /dev/null +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -0,0 +1,142 @@ +import React from "react"; +import { Action, Button, Layout, LoadingIndicator, Title } from "../../presentational"; +import { language, useInitializeView } from "../../../helpers"; +import SegmentedControl, { SegmentedControlProps } from "../../presentational/SegmentedControl/SegmentedControl"; +import { FontAwesomeSvgIcon } from "react-fontawesome-svg-icon"; +import { faFileLines } from "@fortawesome/free-solid-svg-icons"; +import MyDataHelps from "@careevolution/mydatahelps-js"; +import { getShortDateString } from "../../../helpers/date-helpers"; +import queryAllSurveyFiles, { SurveyUploadedFile, SurveyUploadedFileQueryParameters } from "../../../helpers/query-all-survey-files"; +import { getPreviewData } from "./DocumentLibraryView.previewData"; + +export interface DocumentLibraryViewProps { + preview?: "Preview" | "PreviewLoading", + uploadDocumentSurveyName: string, + fileResultIdentifier: string, + typeResultIdentifier: string, + nameResultIdentifier: string, + dateResultIdentifier: string, + notesResultIdentifier: string, + documentViewBaseUrl: string, + colorScheme?: "auto" | "light" | "dark" +} + +/** + * This view displays a list of documents uploaded by the user via specified survey. + */ +export default function DocumentLibraryView(props: DocumentLibraryViewProps) { + const [loading, setLoading] = React.useState(false); + const [selectedSegment, setSelectedSegment] = React.useState<"date" | "name" | "type">("date"); + const [files, setFiles] = React.useState([]); + + const segmentedControlProps: SegmentedControlProps = { + segments: [ + { + key: "date", + title: language('date') + }, + { + key: "name", + title: language('name') + }, + { + key: "type", + title: language('type') + } + ], + selectedSegment: selectedSegment, + color: "var(--mdhui-color-primary)", + onSegmentSelected: (segmentKey) => { + console.log(`Change in selected segment ${segmentKey}`); + setSelectedSegment(segmentKey as "date" | "name" | "type"); + }, + style: { + marginTop: '15px', + marginBottom: '15px' + } + }; + + const onUploadClick = () => { + setLoading(true); + MyDataHelps.startSurvey(props.uploadDocumentSurveyName); + } + + const onFileClick = (file: SurveyUploadedFile) => { + //console.log(`Opening File ${file.title} ${file.fileName} ${file.type} ${file.date} SurveyResultID: ${file.surveyResultId}`); + + if (props.documentViewBaseUrl) { + const documentDetailViewUrl = props.documentViewBaseUrl + '?surveyResultId=' + encodeURIComponent(file.surveyResultId) + + '&uploadDocumentSurveyName=' + encodeURIComponent(props.uploadDocumentSurveyName) + + '&fileResultIdentifier=' + encodeURIComponent(props.fileResultIdentifier) + + '&typeResultIdentifier=' + encodeURIComponent(props.typeResultIdentifier) + + '&nameResultIdentifier=' + encodeURIComponent(props.nameResultIdentifier) + + '&dateResultIdentifier=' + encodeURIComponent(props.dateResultIdentifier) + + '¬esResultIdentifier=' + encodeURIComponent(props.notesResultIdentifier); + MyDataHelps.openApplication(documentDetailViewUrl, { modal: true }); + } + } + + async function initialize() { + setLoading(true); + + if (props.preview) { + if (props.preview === "Preview") { + setFiles(getPreviewData()); + setLoading(false); + } + return; + } + + const params: SurveyUploadedFileQueryParameters = { + uploadDocumentSurveyName: props.uploadDocumentSurveyName, + fileResultIdentifier: props.fileResultIdentifier, + typeResultIdentifier: props.typeResultIdentifier, + nameResultIdentifier: props.nameResultIdentifier, + dateResultIdentifier: props.dateResultIdentifier, + notesResultIdentifier: props.notesResultIdentifier + }; + + queryAllSurveyFiles({ ...params }).then((uploadedFiles: SurveyUploadedFile[]) => { + setFiles(uploadedFiles); + setLoading(false); + }); + } + + function buildFileList(files: SurveyUploadedFile[], selectedSegment: "date" | "name" | "type") { + const sortedFiles = files.sort((a, b) => { + if (selectedSegment === "date") { + return a.date > b.date ? -1 : 1; + } else if (selectedSegment === "name") { + return a.title < b.title ? -1 : 1; + } else { + return a.type < b.type ? -1 : 1; + } + }); + + return sortedFiles.map((file: SurveyUploadedFile, index: number) => + } + onClick={() => onFileClick(file)}> + ); + } + + useInitializeView(() => { + initialize(); + }, [], []); + + return ( + + {loading && } + {!loading && <> +
+ {language('documents')} + +
+ + + {files.length > 0 && buildFileList(files, selectedSegment)} + } +
+ ) +} \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/index.ts b/src/components/view/DocumentLibraryView/index.ts new file mode 100644 index 000000000..769474ecf --- /dev/null +++ b/src/components/view/DocumentLibraryView/index.ts @@ -0,0 +1 @@ +export { default } from './DocumentLibraryView'; \ No newline at end of file diff --git a/src/helpers/index.ts b/src/helpers/index.ts index 6f772a348..265b3c308 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -8,6 +8,7 @@ export * from './get-interval-start'; export * from './colors'; export * from './blood-pressure-data-providers' export * from './query-all-survey-answers'; +export * from './query-all-survey-files'; export * from './Initialization'; export * from './relative-activity'; export * from './BasicPointsAndBadges/PointsAndBadges'; diff --git a/src/helpers/query-all-survey-files.ts b/src/helpers/query-all-survey-files.ts new file mode 100644 index 000000000..5ce52f559 --- /dev/null +++ b/src/helpers/query-all-survey-files.ts @@ -0,0 +1,85 @@ +import { SurveyAnswer, SurveyAnswersQuery } from "@careevolution/mydatahelps-js"; +import { parseISO } from "date-fns"; +import queryAllSurveyAnswers from "./query-all-survey-answers"; + +export interface SurveyUploadedFile { + surveyResultId: string, + fileCategory: string, + title: string, + fileName: string, + type: string, + notes?: string, + date: Date +} + +export interface SurveyUploadedFileQueryParameters { + uploadDocumentSurveyName: string, + fileResultIdentifier: string, + typeResultIdentifier: string, + nameResultIdentifier: string, + dateResultIdentifier: string, + notesResultIdentifier: string + surveyResultId?: string +} + +export default async function (props: SurveyUploadedFileQueryParameters): Promise { + + async function groupSurveyAnswersByResults(answers: SurveyAnswer[]) { + let uploadedFiles: SurveyUploadedFile[] = []; + + if (answers.length > 0) { + let resultIds = [...new Set(answers.map(a => a.surveyResultID))]; + resultIds.forEach(async (resultId) => { + var resultsForSubmission = answers.filter(a => a.surveyResultID == resultId); + var useDate = ""; + if (props.dateResultIdentifier) { + var dateResults = resultsForSubmission.find(r => r.resultIdentifier == props.dateResultIdentifier); + useDate = dateResults && dateResults.answers ? dateResults.answers[0] : resultsForSubmission[0].date; + } else { + useDate = resultsForSubmission[0].date; + } + const titleResults = resultsForSubmission.find(r => r.resultIdentifier == props.nameResultIdentifier); + const title = titleResults && titleResults.answers ? titleResults.answers[0] : ""; + var fileNameResults = resultsForSubmission.find(r => r.resultIdentifier == props.fileResultIdentifier); + const fileName = fileNameResults && fileNameResults.answers ? fileNameResults.answers[0] : ""; + const fileNameResultID = fileNameResults && fileNameResults.surveyResultID ? `${fileNameResults.surveyResultID}` : ""; + var typeResults = resultsForSubmission.find(r => r.resultIdentifier == props.typeResultIdentifier); + const type = typeResults && typeResults.answers ? typeResults.answers[0] : ""; + var notesResults = resultsForSubmission.find(r => r.resultIdentifier == props.notesResultIdentifier); + const notes = notesResults && notesResults.answers ? notesResults.answers[0] : ""; + + if (!Number.isNaN(Date.parse(useDate)) && + title && fileName && type) { + const useFileDate = parseISO(useDate); + const newUploadedFile: SurveyUploadedFile = { + surveyResultId: `${resultId}`, + fileCategory: `surveyresult_${fileNameResultID}`, + title: title, + fileName: fileName, + type: type, + notes: notes, + date: useFileDate + }; + + uploadedFiles.push(newUploadedFile); + } + }); + } + return uploadedFiles; + } + + let queryParameters: SurveyAnswersQuery = { + surveyName : props.uploadDocumentSurveyName, + resultIdentifier : [props.fileResultIdentifier!, + props.typeResultIdentifier!, props.nameResultIdentifier!, + props.dateResultIdentifier!, props.notesResultIdentifier!] + }; + + if (props.surveyResultId) { + queryParameters.surveyResultID = props.surveyResultId; + } + + return await queryAllSurveyAnswers(queryParameters).then((surveyAnswers: SurveyAnswer[]) => { + return groupSurveyAnswersByResults(surveyAnswers); + }); +} diff --git a/src/helpers/strings-en.ts b/src/helpers/strings-en.ts index 0a2dfdde2..5c72e2bc2 100644 --- a/src/helpers/strings-en.ts +++ b/src/helpers/strings-en.ts @@ -14,6 +14,10 @@ "remove": "Remove", "help": "Help", "view": "View", + "documents": "Documents", + "upload": "Upload", + "name" : "Name", + "date" : "Date", "health-records": "Health Records", "connect-ehr-title-prefix": "Connect ", "connect-ehr-title-divider": " or ", @@ -523,7 +527,10 @@ "daily": "Daily", "weekly": "Weekly", "monthly": "Monthly", - "bonus": "Bonus" + "bonus": "Bonus", + "download": "Download", + "delete-file-confirm": "Are you sure you want to delete this file?", + "file-not-loaded": "The file could not be loaded. Please contact support.", }; export default strings; \ No newline at end of file From 620dc37892e9ce835ea3b0a93397ed09502fc264 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Wed, 19 Feb 2025 14:07:25 -0500 Subject: [PATCH 02/50] Update languages and missing main export --- src/components/view/index.ts | 2 ++ src/helpers/strings-de.ts | 10 +++++++++- src/helpers/strings-en.ts | 8 ++++---- src/helpers/strings-es.ts | 10 +++++++++- src/helpers/strings-fr.ts | 10 +++++++++- src/helpers/strings-it.ts | 10 +++++++++- src/helpers/strings-nl.ts | 10 +++++++++- src/helpers/strings-pl.ts | 10 +++++++++- src/helpers/strings-pt.ts | 10 +++++++++- 9 files changed, 69 insertions(+), 11 deletions(-) diff --git a/src/components/view/index.ts b/src/components/view/index.ts index ff47dd176..51f2671c4 100644 --- a/src/components/view/index.ts +++ b/src/components/view/index.ts @@ -5,6 +5,8 @@ export { default as ConnectDevicesView } from "./ConnectDevicesView" export { default as ConnectEhrView } from "./ConnectEhrView" export { default as DeviceActivityView } from "./DeviceActivityView" export { default as DeviceDataView } from "./DeviceDataView" +export { default as DocumentDetailView } from "./DocumentDetailView" +export { default as DocumentLibraryView } from "./DocumentLibraryView" export { default as EhrNewsFeedView } from "./EhrNewsFeedView"; export { default as EhrNewsFeedEventDetailView } from "./EhrNewsFeedEventDetailView"; export { default as ExternalAccountsView } from "./ExternalAccountsView" diff --git a/src/helpers/strings-de.ts b/src/helpers/strings-de.ts index 8e28a2fdf..d31ee0082 100644 --- a/src/helpers/strings-de.ts +++ b/src/helpers/strings-de.ts @@ -522,7 +522,15 @@ let strings: { [key: string]: string } = { "device-activity": "Geräteaktivität", "daily": "Täglich", "weekly": "Wöchentlich", - "monthly": "Monatlich" + "monthly": "Monatlich", + "documents": "Dokumente", + "upload": "Hochladen", + "name": "Name", + "date": "Datum", + "bonus": "Bonus", + "download": "Herunterladen", + "delete-file-confirm": "Sind Sie sicher, dass Sie diese Datei löschen möchten?", + "file-not-loaded": "Die Datei konnte nicht geladen werden. Bitte wenden Sie sich an den Support." }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-en.ts b/src/helpers/strings-en.ts index 5c72e2bc2..52b12318c 100644 --- a/src/helpers/strings-en.ts +++ b/src/helpers/strings-en.ts @@ -14,10 +14,6 @@ "remove": "Remove", "help": "Help", "view": "View", - "documents": "Documents", - "upload": "Upload", - "name" : "Name", - "date" : "Date", "health-records": "Health Records", "connect-ehr-title-prefix": "Connect ", "connect-ehr-title-divider": " or ", @@ -527,6 +523,10 @@ "daily": "Daily", "weekly": "Weekly", "monthly": "Monthly", + "documents": "Documents", + "upload": "Upload", + "name" : "Name", + "date" : "Date", "bonus": "Bonus", "download": "Download", "delete-file-confirm": "Are you sure you want to delete this file?", diff --git a/src/helpers/strings-es.ts b/src/helpers/strings-es.ts index 1e414d066..456ad8948 100644 --- a/src/helpers/strings-es.ts +++ b/src/helpers/strings-es.ts @@ -522,7 +522,15 @@ "device-activity": "Actividad del dispositivo", "daily": "Diario", "weekly": "Semanal", - "monthly": "Mensual" + "monthly": "Mensual", + "documents": "Documentos", + "upload": "Subir", + "name": "Nombre", + "date": "Fecha", + "bonus": "Bono", + "download": "Descargar", + "delete-file-confirm": "¿Estás seguro de que deseas eliminar este archivo?", + "file-not-loaded": "No se pudo cargar el archivo. Por favor, contacta con soporte." }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-fr.ts b/src/helpers/strings-fr.ts index 693d17147..1383f6eff 100644 --- a/src/helpers/strings-fr.ts +++ b/src/helpers/strings-fr.ts @@ -522,7 +522,15 @@ let strings: { [key: string]: string } = { "device-activity": "Activité de l'appareil", "daily": "Quotidien", "weekly": "Hebdomadaire", - "monthly": "Mensuel" + "monthly": "Mensuel", + "documents": "Documents", + "upload": "Télécharger", + "name": "Nom", + "date": "Date", + "bonus": "Bonus", + "download": "Télécharger", + "delete-file-confirm": "Êtes-vous sûr de vouloir supprimer ce fichier ?", + "file-not-loaded": "Le fichier n'a pas pu être chargé. Veuillez contacter le support." }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-it.ts b/src/helpers/strings-it.ts index 152528986..86983f476 100644 --- a/src/helpers/strings-it.ts +++ b/src/helpers/strings-it.ts @@ -522,7 +522,15 @@ let strings: { [key: string]: string } = { "device-activity": "Attività del dispositivo", "daily": "Quotidiano", "weekly": "Settimanale", - "monthly": "Mensile" + "monthly": "Mensile", + "documents": "Documenti", + "upload": "Carica", + "name": "Nome", + "date": "Data", + "bonus": "Bonus", + "download": "Scarica", + "delete-file-confirm": "Sei sicuro di voler eliminare questo file?", + "file-not-loaded": "Il file non è stato caricato. Per favore, contatta il supporto." }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-nl.ts b/src/helpers/strings-nl.ts index c3f64e192..0a3a5f259 100644 --- a/src/helpers/strings-nl.ts +++ b/src/helpers/strings-nl.ts @@ -521,7 +521,15 @@ let strings: { [key: string]: string } = { "device-activity": "Apparaatactiviteit", "daily": "Dagelijks", "weekly": "Wekelijks", - "monthly": "Maandelijks" + "monthly": "Maandelijks", + "documents": "Documenten", + "upload": "Uploaden", + "name": "Naam", + "date": "Datum", + "bonus": "Bonus", + "download": "Downloaden", + "delete-file-confirm": "Weet je zeker dat je dit bestand wilt verwijderen?", + "file-not-loaded": "Het bestand kon niet worden geladen. Neem contact op met de ondersteuning." }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pl.ts b/src/helpers/strings-pl.ts index f5e72ffcb..37dcba96c 100644 --- a/src/helpers/strings-pl.ts +++ b/src/helpers/strings-pl.ts @@ -522,7 +522,15 @@ let strings: { [key: string]: string } = { "device-activity": "Aktywność urządzenia", "daily": "Codziennie", "weekly": "Cotygodniowo", - "monthly": "Comiesięcznie" + "monthly": "Comiesięcznie", + "documents": "Dokumenty", + "upload": "Prześlij", + "name": "Nazwa", + "date": "Data", + "bonus": "Bonus", + "download": "Pobierz", + "delete-file-confirm": "Czy na pewno chcesz usunąć ten plik?", + "file-not-loaded": "Nie udało się załadować pliku. Proszę skontaktować się z pomocą techniczną." }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pt.ts b/src/helpers/strings-pt.ts index 275ade3cc..77e76406a 100644 --- a/src/helpers/strings-pt.ts +++ b/src/helpers/strings-pt.ts @@ -522,7 +522,15 @@ let strings: { [key: string]: string } = { "device-activity": "Atividade do dispositivo", "daily": "Diário", "weekly": "Semanal", - "monthly": "Mensal" + "monthly": "Mensal", + "documents": "Documentos", + "upload": "Carregar", + "name": "Nome", + "date": "Data", + "bonus": "Bônus", + "download": "Baixar", + "delete-file-confirm": "Tem certeza de que deseja excluir este arquivo?", + "file-not-loaded": "Não foi possível carregar o arquivo. Por favor, entre em contato com o suporte." }; export default strings; \ No newline at end of file From 91d229a9a2ebcb40dce1f378bfd9da72f7dbac76 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Wed, 19 Feb 2025 14:31:12 -0500 Subject: [PATCH 03/50] Fix build errors from translation files --- src/helpers/strings-en.ts | 1 - src/helpers/strings-pl.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers/strings-en.ts b/src/helpers/strings-en.ts index 6352c5412..63676f2d2 100644 --- a/src/helpers/strings-en.ts +++ b/src/helpers/strings-en.ts @@ -531,7 +531,6 @@ "download": "Download", "delete-file-confirm": "Are you sure you want to delete this file?", "file-not-loaded": "The file could not be loaded. Please contact support.", - "bonus": "Bonus", "syncing-data": "Syncing data...", "health-connect-phr-sync-title": "Sync with Health Connect", "health-connect-phr-sync-prompt": "Choose health records to read from and write to Health Connect" diff --git a/src/helpers/strings-pl.ts b/src/helpers/strings-pl.ts index bf23e30bf..ec5391dcf 100644 --- a/src/helpers/strings-pl.ts +++ b/src/helpers/strings-pl.ts @@ -530,7 +530,7 @@ let strings: { [key: string]: string } = { "bonus": "Bonus", "download": "Pobierz", "delete-file-confirm": "Czy na pewno chcesz usunąć ten plik?", - "file-not-loaded": "Nie udało się załadować pliku. Proszę skontaktować się z pomocą techniczną." + "file-not-loaded": "Nie udało się załadować pliku. Proszę skontaktować się z pomocą techniczną.", "syncing-data": "Synchronizowanie danych...", "health-connect-phr-sync-title": "Synchronizuj z Health Connect", "health-connect-phr-sync-prompt": "Wybierz rekordy zdrowotne do odczytu i zapisu w Health Connect" From 0a7fe74b958db309237ca2cd7709ebdd376b1585 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Wed, 19 Feb 2025 14:38:59 -0500 Subject: [PATCH 04/50] more fixes --- .../DocumentDetailView/DocumentDetailView.previewData.ts | 2 +- .../view/DocumentDetailView/DocumentDetailView.stories.tsx | 5 +++++ src/helpers/strings-de.ts | 2 +- src/helpers/strings-es.ts | 2 +- src/helpers/strings-fr.ts | 2 +- src/helpers/strings-it.ts | 2 +- src/helpers/strings-nl.ts | 2 +- src/helpers/strings-pt.ts | 2 +- 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts index 863fc6739..aba440bce 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts +++ b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts @@ -29,7 +29,7 @@ const previewPdfData: DocumentDetail = { type: "Test Results", notes: "These are some notes for a sample PDF", date: new Date(), - presignedDocUrl: "https://freelawlibrary.org/wp-content/uploads/2022/10/The-Constitution-Full-Text-The-National-Constitution-Center.pdf",//"https://constitutioncenter.org/media/files/constitution.pdf", + presignedDocUrl: "https://freelawlibrary.org/wp-content/uploads/2022/10/The-Constitution-Full-Text-The-National-Constitution-Center.pdf", presignedImageUrl: "", showDownload: false, fileKey: "file key" diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index 9d649df64..e3f47fa1e 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -49,6 +49,11 @@ export const Csv: Story = { render: render }; +export const Video: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewMp4' }, + render: render +}; + export const Unsupported: Story = { args: { ...uploadDocumentSurveyProps, preview: 'PreviewUnknown' }, render: render diff --git a/src/helpers/strings-de.ts b/src/helpers/strings-de.ts index 93ea1d295..09173c886 100644 --- a/src/helpers/strings-de.ts +++ b/src/helpers/strings-de.ts @@ -530,7 +530,7 @@ let strings: { [key: string]: string } = { "bonus": "Bonus", "download": "Herunterladen", "delete-file-confirm": "Sind Sie sicher, dass Sie diese Datei löschen möchten?", - "file-not-loaded": "Die Datei konnte nicht geladen werden. Bitte wenden Sie sich an den Support." + "file-not-loaded": "Die Datei konnte nicht geladen werden. Bitte wenden Sie sich an den Support.", "syncing-data": "Daten werden synchronisiert...", "health-connect-phr-sync-title": "Mit Health Connect synchronisieren", "health-connect-phr-sync-prompt": "Wähle Gesundheitsdaten zum Lesen und Schreiben in Health Connect aus" diff --git a/src/helpers/strings-es.ts b/src/helpers/strings-es.ts index b66a9460d..c7164d502 100644 --- a/src/helpers/strings-es.ts +++ b/src/helpers/strings-es.ts @@ -530,7 +530,7 @@ "bonus": "Bono", "download": "Descargar", "delete-file-confirm": "¿Estás seguro de que deseas eliminar este archivo?", - "file-not-loaded": "No se pudo cargar el archivo. Por favor, contacta con soporte." + "file-not-loaded": "No se pudo cargar el archivo. Por favor, contacta con soporte.", "syncing-data": "Sincronizando datos...", "health-connect-phr-sync-title": "Sincronizar con Health Connect", "health-connect-phr-sync-prompt": "Elige los registros de salud para leer y escribir en Health Connect" diff --git a/src/helpers/strings-fr.ts b/src/helpers/strings-fr.ts index 060476068..290e15f3b 100644 --- a/src/helpers/strings-fr.ts +++ b/src/helpers/strings-fr.ts @@ -530,7 +530,7 @@ let strings: { [key: string]: string } = { "bonus": "Bonus", "download": "Télécharger", "delete-file-confirm": "Êtes-vous sûr de vouloir supprimer ce fichier ?", - "file-not-loaded": "Le fichier n'a pas pu être chargé. Veuillez contacter le support." + "file-not-loaded": "Le fichier n'a pas pu être chargé. Veuillez contacter le support.", "syncing-data": "Synchronisation des données...", "health-connect-phr-sync-title": "Synchroniser avec Health Connect", "health-connect-phr-sync-prompt": "Choisissez les dossiers de santé à lire et à écrire avec Health Connect" diff --git a/src/helpers/strings-it.ts b/src/helpers/strings-it.ts index 5fdf618c4..102b5b5ca 100644 --- a/src/helpers/strings-it.ts +++ b/src/helpers/strings-it.ts @@ -530,7 +530,7 @@ let strings: { [key: string]: string } = { "bonus": "Bonus", "download": "Scarica", "delete-file-confirm": "Sei sicuro di voler eliminare questo file?", - "file-not-loaded": "Il file non è stato caricato. Per favore, contatta il supporto." + "file-not-loaded": "Il file non è stato caricato. Per favore, contatta il supporto.", "syncing-data": "Sincronizzazione dei dati...", "health-connect-phr-sync-title": "Sincronizza con Health Connect", "health-connect-phr-sync-prompt": "Scegli i dati sanitari da leggere e scrivere con Health Connect" diff --git a/src/helpers/strings-nl.ts b/src/helpers/strings-nl.ts index ac175c31e..6509d553e 100644 --- a/src/helpers/strings-nl.ts +++ b/src/helpers/strings-nl.ts @@ -529,7 +529,7 @@ let strings: { [key: string]: string } = { "bonus": "Bonus", "download": "Downloaden", "delete-file-confirm": "Weet je zeker dat je dit bestand wilt verwijderen?", - "file-not-loaded": "Het bestand kon niet worden geladen. Neem contact op met de ondersteuning." + "file-not-loaded": "Het bestand kon niet worden geladen. Neem contact op met de ondersteuning.", "syncing-data": "Gegevens synchroniseren...", "health-connect-phr-sync-title": "Synchroniseren met Health Connect", "health-connect-phr-sync-prompt": "Kies welke gezondheidsgegevens je wilt lezen en schrijven met Health Connect" diff --git a/src/helpers/strings-pt.ts b/src/helpers/strings-pt.ts index f54b2b161..8b171f200 100644 --- a/src/helpers/strings-pt.ts +++ b/src/helpers/strings-pt.ts @@ -530,7 +530,7 @@ let strings: { [key: string]: string } = { "bonus": "Bônus", "download": "Baixar", "delete-file-confirm": "Tem certeza de que deseja excluir este arquivo?", - "file-not-loaded": "Não foi possível carregar o arquivo. Por favor, entre em contato com o suporte." + "file-not-loaded": "Não foi possível carregar o arquivo. Por favor, entre em contato com o suporte.", "syncing-data": "Sincronizando dados...", "health-connect-phr-sync-title": "Sincronizar com Health Connect", "health-connect-phr-sync-prompt": "Escolha os registros de saúde para ler e escrever no Health Connect" From 8a554b3defd081d682174746f440c0659656064d Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 20 Feb 2025 10:55:48 -0500 Subject: [PATCH 05/50] Clean up delete. Do not show DetailView modal. Remove surveyName parameter from detail view --- .../DocumentDetailView.stories.tsx | 13 +------- .../DocumentDetailView/DocumentDetailView.tsx | 24 +++++++------- .../DocumentLibraryView.tsx | 6 ++-- src/helpers/index.ts | 2 +- src/helpers/query-all-survey-files.ts | 31 ++++++++++++++++--- 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index e3f47fa1e..c286451fa 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -21,7 +21,6 @@ const render = (args: DocumentDetailViewProps) => (); async function initialize() { const params: SurveyUploadedFileQueryParameters = { - uploadDocumentSurveyName: props.uploadDocumentSurveyName, fileResultIdentifier: props.fileResultIdentifier, typeResultIdentifier: props.typeResultIdentifier, nameResultIdentifier: props.nameResultIdentifier, @@ -90,7 +89,6 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp', '.tiff', '.svg', '.ico', '.avif']; const lowerCaseFileName = fileName.toLowerCase(); - return imageExtensions.some(ext => lowerCaseFileName.endsWith(ext)); } @@ -104,16 +102,16 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } } - const deleteFile = () => { + const deleteFile = async () => { if (!documentDetail?.fileKey || !documentDetail?.surveyResultId) { return; } if (window.confirm(language("delete-file-confirm"))) { - MyDataHelps.deleteSurveyResult(props.surveyResultId); - MyDataHelps.deleteFile(documentDetail?.fileKey!); - setDocumentDetail(undefined); - MyDataHelps.dismiss(); + deleteSurveyResultFiles(documentDetail.surveyResultId, documentDetail.fileKey).then(() => { + setDocumentDetail(undefined); + MyDataHelps.dismiss(); + }); } }; @@ -150,7 +148,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) {
{`${documentDetail?.title} - ${getShortDateString(documentDetail?.date!)}`}
{language("notes")}
{documentDetail?.notes}
- + } diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index e1250cd4a..7abf7c063 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -6,7 +6,7 @@ import { FontAwesomeSvgIcon } from "react-fontawesome-svg-icon"; import { faFileLines } from "@fortawesome/free-solid-svg-icons"; import MyDataHelps from "@careevolution/mydatahelps-js"; import { getShortDateString } from "../../../helpers/date-helpers"; -import queryAllSurveyFiles, { SurveyUploadedFile, SurveyUploadedFileQueryParameters } from "../../../helpers/query-all-survey-files"; +import { queryAllSurveyFiles, SurveyUploadedFile, SurveyUploadedFileQueryParameters } from "../../../helpers"; import { getPreviewData } from "./DocumentLibraryView.previewData"; export interface DocumentLibraryViewProps { @@ -47,7 +47,6 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { selectedSegment: selectedSegment, color: "var(--mdhui-color-primary)", onSegmentSelected: (segmentKey) => { - console.log(`Change in selected segment ${segmentKey}`); setSelectedSegment(segmentKey as "date" | "name" | "type"); }, style: { @@ -66,13 +65,12 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { if (props.documentViewBaseUrl) { const documentDetailViewUrl = props.documentViewBaseUrl + '?surveyResultId=' + encodeURIComponent(file.surveyResultId) - + '&uploadDocumentSurveyName=' + encodeURIComponent(props.uploadDocumentSurveyName) + '&fileResultIdentifier=' + encodeURIComponent(props.fileResultIdentifier) + '&typeResultIdentifier=' + encodeURIComponent(props.typeResultIdentifier) + '&nameResultIdentifier=' + encodeURIComponent(props.nameResultIdentifier) + '&dateResultIdentifier=' + encodeURIComponent(props.dateResultIdentifier) + '¬esResultIdentifier=' + encodeURIComponent(props.notesResultIdentifier); - MyDataHelps.openApplication(documentDetailViewUrl, { modal: true }); + MyDataHelps.openApplication(documentDetailViewUrl); } } diff --git a/src/helpers/index.ts b/src/helpers/index.ts index 265b3c308..946e74eb4 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -8,7 +8,7 @@ export * from './get-interval-start'; export * from './colors'; export * from './blood-pressure-data-providers' export * from './query-all-survey-answers'; -export * from './query-all-survey-files'; +export { queryAllSurveyFiles, deleteSurveyResultFiles, SurveyUploadedFileQueryParameters, SurveyUploadedFile} from './query-all-survey-files'; export * from './Initialization'; export * from './relative-activity'; export * from './BasicPointsAndBadges/PointsAndBadges'; diff --git a/src/helpers/query-all-survey-files.ts b/src/helpers/query-all-survey-files.ts index 5ce52f559..aaed7b245 100644 --- a/src/helpers/query-all-survey-files.ts +++ b/src/helpers/query-all-survey-files.ts @@ -1,4 +1,4 @@ -import { SurveyAnswer, SurveyAnswersQuery } from "@careevolution/mydatahelps-js"; +import MyDataHelps, { SurveyAnswer, SurveyAnswersQuery } from "@careevolution/mydatahelps-js"; import { parseISO } from "date-fns"; import queryAllSurveyAnswers from "./query-all-survey-answers"; @@ -13,7 +13,7 @@ export interface SurveyUploadedFile { } export interface SurveyUploadedFileQueryParameters { - uploadDocumentSurveyName: string, + uploadDocumentSurveyName?: string, fileResultIdentifier: string, typeResultIdentifier: string, nameResultIdentifier: string, @@ -22,7 +22,7 @@ export interface SurveyUploadedFileQueryParameters { surveyResultId?: string } -export default async function (props: SurveyUploadedFileQueryParameters): Promise { +export async function queryAllSurveyFiles(props: SurveyUploadedFileQueryParameters): Promise { async function groupSurveyAnswersByResults(answers: SurveyAnswer[]) { let uploadedFiles: SurveyUploadedFile[] = []; @@ -68,13 +68,20 @@ export default async function (props: SurveyUploadedFileQueryParameters): Promis return uploadedFiles; } + if (!props.uploadDocumentSurveyName && !props.surveyResultId) { + throw new Error("Either survey name or surveyResultId is required"); + } + let queryParameters: SurveyAnswersQuery = { - surveyName : props.uploadDocumentSurveyName, resultIdentifier : [props.fileResultIdentifier!, props.typeResultIdentifier!, props.nameResultIdentifier!, props.dateResultIdentifier!, props.notesResultIdentifier!] }; + if (props.uploadDocumentSurveyName) { + queryParameters.surveyName = props.uploadDocumentSurveyName; + } + if (props.surveyResultId) { queryParameters.surveyResultID = props.surveyResultId; } @@ -82,4 +89,18 @@ export default async function (props: SurveyUploadedFileQueryParameters): Promis return await queryAllSurveyAnswers(queryParameters).then((surveyAnswers: SurveyAnswer[]) => { return groupSurveyAnswersByResults(surveyAnswers); }); -} +}; + + +export async function deleteSurveyResultFiles(surveyResultId: string, fileKey: string) { + + if (!fileKey || !surveyResultId) return; + + return await MyDataHelps.deleteSurveyResult(surveyResultId).then(() => { + MyDataHelps.deleteFile(fileKey); + }).catch((error) => { + console.error('Error deleting survey results', error); + console.error('The survey must be configured to support result deletion'); + }); +}; + From 8a74f3f1271abfad344f08a002275d2856902555 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 20 Feb 2025 16:37:33 -0500 Subject: [PATCH 06/50] Unit tests for data layer --- .../helpers/query-all-survey-files.test.ts | 106 ++++++++++++++++++ src/helpers/query-all-survey-files.ts | 12 +- 2 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 __tests__/helpers/query-all-survey-files.test.ts diff --git a/__tests__/helpers/query-all-survey-files.test.ts b/__tests__/helpers/query-all-survey-files.test.ts new file mode 100644 index 000000000..2be19667b --- /dev/null +++ b/__tests__/helpers/query-all-survey-files.test.ts @@ -0,0 +1,106 @@ +import { deleteSurveyResultFiles, queryAllSurveyFiles, SurveyUploadedFile } from "../../src/helpers"; +import MyDataHelps, { SurveyAnswer } from '@careevolution/mydatahelps-js'; + +jest.mock('@careevolution/mydatahelps-js', () => { + const answers : SurveyAnswer[] = [ + {id: "abc123", surveyResultID: "abc123", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileName", answers: ["Colonoscopy Report"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "def456", surveyResultID: "abc123", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "file", answers: ["Colon.txt"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "ghi789", surveyResultID: "abc123", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileNotes", answers: ["Notes on colonoscopy"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "jkl012", surveyResultID: "abc123", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileType", answers: ["Other"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "mno345", surveyResultID: "abc123", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileDate", answers: ["2025-01-01"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "pqr678", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileName", answers: ["BCBS Insurance"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "stu901", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "file", answers: ["BCBS.png"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "vwx234", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileNotes", answers: ["From my phone"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "yza567", surveyResultID: "pqr6789", surveyName: "wrong-test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileType", answers: ["Insurance"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "bcd890", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileDate", answers: ["1-2-2025"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "efg123", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "result11", answers: ["answer11"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "a3c123", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2025-01-01", stepIdentifier: "step1", resultIdentifier: "fileName", answers: ["Mammography Report"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "d3f456", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2025-01-01", stepIdentifier: "step1", resultIdentifier: "file", answers: ["TestsResults.pdf"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "g3i789", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2025-01-01", stepIdentifier: "step1", resultIdentifier: "fileNotes", answers: ["These are in the portal"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "j3l012", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2025-01-01", stepIdentifier: "step1", resultIdentifier: "fileType", answers: ["Results"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "m3o345", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2024-01-01", stepIdentifier: "step1", resultIdentifier: "fileDate", answers: [""], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + ]; + + const answersPage = { + surveyAnswers: answers + }; + + return { + __esModule: true, + default: { + token: { access_token: '1' }, + getCurrentLanguage: () => jest.fn(), + deleteSurveyResult: jest.fn().mockResolvedValue(undefined), + deleteFile: jest.fn().mockResolvedValue(undefined), + querySurveyAnswers: jest.fn(() => { + return Promise.resolve(answersPage); + }), + on: jest.fn(), + off: jest.fn() + } + } +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +const colonoscopyReport : SurveyUploadedFile = { + surveyResultId: "abc123", + fileCategory: "surveyresult_abc123", + title: "Colonoscopy Report", + fileName: "Colon.txt", + type: "Other", + notes: "Notes on colonoscopy", + date: new Date("2025-01-01T00:00:00") +}; + +const mammographyReport : SurveyUploadedFile = { + surveyResultId: "456abc", + fileCategory: "surveyresult_456abc", + title: "Mammography Report", + fileName: "TestsResults.pdf", + type: "Results", + notes: "These are in the portal", + date: new Date("2024-01-01T00:00:00") //confirms use of result date when answer not on file +}; + +test("a SurveyUploadedFile is returned when all required fields are on file", async () => { + const surveyFiles = await queryAllSurveyFiles({ + uploadDocumentSurveyName: "test-survey", + fileResultIdentifier: "file", + typeResultIdentifier: "fileType", + nameResultIdentifier: "fileName", + dateResultIdentifier: "fileDate", + notesResultIdentifier: "fileNotes" + }); + + expect(surveyFiles).toHaveLength(2); + expect(surveyFiles).toContainEqual(mammographyReport); + expect(surveyFiles).toContainEqual(colonoscopyReport); +}); + +test("should call both MyDataHelps.deleteSurveyResult and MyDataHelps.deleteFile", async () => { + await deleteSurveyResultFiles("test-id", "test-file-key"); + expect(MyDataHelps.deleteSurveyResult).toHaveBeenCalledWith("test-id"); + expect(MyDataHelps.deleteFile).toHaveBeenCalledWith("test-file-key"); +}); + +test("should not delete file if MyDataHelps.deleteSurveyResult fails", async () => { + (MyDataHelps.deleteSurveyResult as jest.Mock).mockRejectedValueOnce(new Error("Failed to delete survey result")); + await deleteSurveyResultFiles("test-id", "test-file-key"); + expect(MyDataHelps.deleteSurveyResult).toHaveBeenCalledWith("test-id"); + expect(MyDataHelps.deleteFile).toHaveBeenCalledTimes(0); +}); + +test("should not call either MyDataHelps.deleteSurveyResult and MyDataHelps.deleteFile if surveyResultId is empty string", async () => { + await deleteSurveyResultFiles("", "test-file-key"); + expect(MyDataHelps.deleteSurveyResult).toHaveBeenCalledTimes(0); + expect(MyDataHelps.deleteFile).toHaveBeenCalledTimes(0); +}); + +test("should not call either MyDataHelps.deleteSurveyResult and MyDataHelps.deleteFile if fileKey is empty string", async () => { + await deleteSurveyResultFiles("test-id", ""); + expect(MyDataHelps.deleteSurveyResult).toHaveBeenCalledTimes(0); + expect(MyDataHelps.deleteFile).toHaveBeenCalledTimes(0); +}); \ No newline at end of file diff --git a/src/helpers/query-all-survey-files.ts b/src/helpers/query-all-survey-files.ts index aaed7b245..3b8788897 100644 --- a/src/helpers/query-all-survey-files.ts +++ b/src/helpers/query-all-survey-files.ts @@ -1,6 +1,7 @@ import MyDataHelps, { SurveyAnswer, SurveyAnswersQuery } from "@careevolution/mydatahelps-js"; import { parseISO } from "date-fns"; import queryAllSurveyAnswers from "./query-all-survey-answers"; +import { date } from "zod"; export interface SurveyUploadedFile { surveyResultId: string, @@ -30,13 +31,14 @@ export async function queryAllSurveyFiles(props: SurveyUploadedFileQueryParamete if (answers.length > 0) { let resultIds = [...new Set(answers.map(a => a.surveyResultID))]; resultIds.forEach(async (resultId) => { - var resultsForSubmission = answers.filter(a => a.surveyResultID == resultId); - var useDate = ""; + var resultsForSubmission = answers.filter(a => a.surveyResultID === resultId); + var useDate = resultsForSubmission[0].date; if (props.dateResultIdentifier) { var dateResults = resultsForSubmission.find(r => r.resultIdentifier == props.dateResultIdentifier); - useDate = dateResults && dateResults.answers ? dateResults.answers[0] : resultsForSubmission[0].date; - } else { - useDate = resultsForSubmission[0].date; + useDate = dateResults && dateResults.answers && dateResults.answers[0] ? dateResults.answers[0] : ''; + if (!useDate && dateResults) { + useDate = dateResults.date; + } } const titleResults = resultsForSubmission.find(r => r.resultIdentifier == props.nameResultIdentifier); const title = titleResults && titleResults.answers ? titleResults.answers[0] : ""; From f4133b93d2029e457d435f6bed6b0ed4f675aaf8 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 21 Feb 2025 12:52:33 -0500 Subject: [PATCH 07/50] DocumentLibraryPreview component + misc --- .../DocumentLibraryPreview.css | 4 + .../DocumentLibraryPreview.previewData.ts | 7 ++ .../DocumentLibraryPreview.stories.tsx | 54 +++++++++++ .../DocumentLibraryPreview.tsx | 90 +++++++++++++++++++ .../DocumentDetailView.stories.tsx | 18 +--- .../DocumentLibraryView.css | 0 .../DocumentLibraryView.stories.tsx | 4 +- src/helpers/strings-de.ts | 5 +- src/helpers/strings-en.ts | 5 +- src/helpers/strings-es.ts | 5 +- src/helpers/strings-fr.ts | 5 +- src/helpers/strings-it.ts | 5 +- src/helpers/strings-nl.ts | 5 +- src/helpers/strings-pl.ts | 5 +- src/helpers/strings-pt.ts | 5 +- 15 files changed, 192 insertions(+), 25 deletions(-) create mode 100644 src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.css create mode 100644 src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.previewData.ts create mode 100644 src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx create mode 100644 src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx delete mode 100644 src/components/view/DocumentLibraryView/DocumentLibraryView.css diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.css b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.css new file mode 100644 index 000000000..efb046aad --- /dev/null +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.css @@ -0,0 +1,4 @@ +.mdhui-document-library-preview .file-title { + font-size: .88em; + color: var(--mdhui-text-color-2); +} \ No newline at end of file diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.previewData.ts b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.previewData.ts new file mode 100644 index 000000000..cbf1a08fe --- /dev/null +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.previewData.ts @@ -0,0 +1,7 @@ +export function getPreviewData(): string[] { + return [ + "Insurance Card", + "Mammogram Results", + "Blood Test Results", + ]; +} \ No newline at end of file diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx new file mode 100644 index 000000000..601478c94 --- /dev/null +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx @@ -0,0 +1,54 @@ +import React from "react" +import { Meta, StoryObj } from "@storybook/react" +import { Description } from "@storybook/blocks" +import DocumentLibraryPreview, { DocumentLibraryPreviewProps } from "./DocumentLibraryPreview"; +import { Layout } from "../../presentational"; + +const meta: Meta = { + title: "Container/DocumentLibraryPreview", + component: DocumentLibraryPreview, + parameters: { + layout: 'fullscreen', + docs: { + Description: + } + } +}; + +export default meta; +type Story = StoryObj; + +const render = (args: DocumentLibraryPreviewProps) => + + + ; + +const defaultProps: DocumentLibraryPreviewProps = { + uploadDocumentSurveyName: 'UploadDocument', + fileResultIdentifier: 'document', + typeResultIdentifier: 'document_type', + nameResultIdentifier: 'document_name', + dateResultIdentifier: 'document_date', + notesResultIdentifier: 'document_notes', + documentViewBaseUrl: '' +}; + +export const NoUploadedFiles: Story = { + args: { ...defaultProps, preview: 'PreviewNoDocuments' }, + render: render +}; + +export const UploadedFiles: Story = { + args: { ...defaultProps, preview: 'PreviewDocuments' }, + render: render +}; + +export const Loading: Story = { + args: { ...defaultProps, preview: 'PreviewLoading' }, + render: render +}; + +export const Live: Story = { + args: { ...defaultProps }, + render: render +}; \ No newline at end of file diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx new file mode 100644 index 000000000..32692f539 --- /dev/null +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -0,0 +1,90 @@ +import React from "react"; +import { language, queryAllSurveyFiles, SurveyUploadedFile, SurveyUploadedFileQueryParameters, useInitializeView } from "../../../helpers"; +import { Action, Button, LoadingIndicator } from "../../presentational"; +import { FontAwesomeSvgIcon } from "react-fontawesome-svg-icon"; +import { faCamera } from "@fortawesome/free-solid-svg-icons"; +import MyDataHelps from "@careevolution/mydatahelps-js"; +import { getPreviewData } from "./DocumentLibraryPreview.previewData"; +import "./DocumentLibraryPreview.css"; + +export interface DocumentLibraryPreviewProps { + preview?: "PreviewNoDocuments" | "PreviewDocuments" | "PreviewLoading", + uploadDocumentSurveyName: string, + fileResultIdentifier: string, + typeResultIdentifier: string, + nameResultIdentifier: string, + dateResultIdentifier: string, + notesResultIdentifier: string, + documentViewBaseUrl: string, + innerRef?: React.Ref; +} + +export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProps) { + const [surveyFiles, setSurveyFiles] = React.useState(undefined); + + async function initialize() { + if (props.preview) { + if (props.preview === "PreviewNoDocuments") { + setSurveyFiles([]); + } else if (props.preview === "PreviewDocuments") { + setSurveyFiles(getPreviewData()); + } + return; + } + + const params: SurveyUploadedFileQueryParameters = { + uploadDocumentSurveyName: props.uploadDocumentSurveyName, + fileResultIdentifier: props.fileResultIdentifier, + typeResultIdentifier: props.typeResultIdentifier, + nameResultIdentifier: props.nameResultIdentifier, + dateResultIdentifier: props.dateResultIdentifier, + notesResultIdentifier: props.notesResultIdentifier + }; + + queryAllSurveyFiles({ ...params }).then((uploadedFiles: SurveyUploadedFile[]) => { + const sortedFiles = uploadedFiles.sort((a, b) => { + return a.date > b.date ? -1 : 1; + }); + + const top3Files = sortedFiles.slice(0, 3).map((file: SurveyUploadedFile, index: number) => + file.title + ); + setSurveyFiles(top3Files); + }); + } + + const onUploadClick = () => { + if (props.preview) return; + + setSurveyFiles(undefined); + MyDataHelps.startSurvey(props.uploadDocumentSurveyName); + } + + useInitializeView(() => { + initialize(); + }, [], []); + + return ( +
+ {!surveyFiles && } + {surveyFiles && + 0 + ? surveyFiles.map((file, index) =>
{file}
) + : undefined + } + titleIcon={} + indicatorValue={surveyFiles.length > 0 ? surveyFiles.length.toString() : undefined} + indicator={surveyFiles.length === 0 + ? + : undefined} + /> + } +
+ ) +} \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index c286451fa..99ea53a77 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; const render = (args: DocumentDetailViewProps) => ; const uploadDocumentSurveyProps: DocumentDetailViewProps = { + colorScheme: 'auto', surveyResultId: '', fileResultIdentifier: 'document', typeResultIdentifier: 'document_type', @@ -68,22 +69,7 @@ export const FileNotFound: Story = { render: render }; -export const LiveSingleLandscapePdf: Story = { +export const Live: Story = { args: { ...uploadDocumentSurveyProps, surveyResultId: '2e3f7062-87e8-ef11-bafe-0affe8024cad' }, render: render -}; - -export const LiveSinglePortraitPdf: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: '97477698-85e9-ef11-bafe-0affe8024cad' }, - render: render -}; - -export const LiveText: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: 'ad6d89b3-a1ef-ef11-bafe-0affe8024cad' }, - render: render -}; - -export const LiveImage: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: 'a90c0337-cfe4-ef11-bafe-0affe8024cad' }, - render: render }; \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.css b/src/components/view/DocumentLibraryView/DocumentLibraryView.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx index 89d282919..cbded7597 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx @@ -18,9 +18,11 @@ const meta: Meta = { export default meta; type Story = StoryObj; -const render = (args: DocumentLibraryViewProps) =>
; +const render = (args: DocumentLibraryViewProps) => + ; const defaultProps : DocumentLibraryViewProps = { + colorScheme: 'auto', uploadDocumentSurveyName: 'UploadDocument', fileResultIdentifier: 'document', typeResultIdentifier: 'document_type', diff --git a/src/helpers/strings-de.ts b/src/helpers/strings-de.ts index 09173c886..f4edc8e55 100644 --- a/src/helpers/strings-de.ts +++ b/src/helpers/strings-de.ts @@ -533,7 +533,10 @@ let strings: { [key: string]: string } = { "file-not-loaded": "Die Datei konnte nicht geladen werden. Bitte wenden Sie sich an den Support.", "syncing-data": "Daten werden synchronisiert...", "health-connect-phr-sync-title": "Mit Health Connect synchronisieren", - "health-connect-phr-sync-prompt": "Wähle Gesundheitsdaten zum Lesen und Schreiben in Health Connect aus" + "health-connect-phr-sync-prompt": "Wähle Gesundheitsdaten zum Lesen und Schreiben in Health Connect aus", + "uploaded-documents": "Hochgeladene Dokumente", + "upload-documents-subtitle": "Scanne und organisiere deine gedruckten medizinischen Unterlagen", + "upload-button": "Hochladen" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-en.ts b/src/helpers/strings-en.ts index 63676f2d2..006786e07 100644 --- a/src/helpers/strings-en.ts +++ b/src/helpers/strings-en.ts @@ -533,7 +533,10 @@ "file-not-loaded": "The file could not be loaded. Please contact support.", "syncing-data": "Syncing data...", "health-connect-phr-sync-title": "Sync with Health Connect", - "health-connect-phr-sync-prompt": "Choose health records to read from and write to Health Connect" + "health-connect-phr-sync-prompt": "Choose health records to read from and write to Health Connect", + "uploaded-documents": "Uploaded Documents", + "upload-documents-subtitle": "Scan and organize your printed medical records", + "upload-button": "Upload", }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-es.ts b/src/helpers/strings-es.ts index c7164d502..d61c884b5 100644 --- a/src/helpers/strings-es.ts +++ b/src/helpers/strings-es.ts @@ -533,7 +533,10 @@ "file-not-loaded": "No se pudo cargar el archivo. Por favor, contacta con soporte.", "syncing-data": "Sincronizando datos...", "health-connect-phr-sync-title": "Sincronizar con Health Connect", - "health-connect-phr-sync-prompt": "Elige los registros de salud para leer y escribir en Health Connect" + "health-connect-phr-sync-prompt": "Elige los registros de salud para leer y escribir en Health Connect", + "uploaded-documents": "Documentos Subidos", + "upload-documents-subtitle": "Escanea y organiza tus registros médicos impresos", + "upload-button": "Subir" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-fr.ts b/src/helpers/strings-fr.ts index 290e15f3b..abed56742 100644 --- a/src/helpers/strings-fr.ts +++ b/src/helpers/strings-fr.ts @@ -533,7 +533,10 @@ let strings: { [key: string]: string } = { "file-not-loaded": "Le fichier n'a pas pu être chargé. Veuillez contacter le support.", "syncing-data": "Synchronisation des données...", "health-connect-phr-sync-title": "Synchroniser avec Health Connect", - "health-connect-phr-sync-prompt": "Choisissez les dossiers de santé à lire et à écrire avec Health Connect" + "health-connect-phr-sync-prompt": "Choisissez les dossiers de santé à lire et à écrire avec Health Connect", + "uploaded-documents": "Documents Téléversés", + "upload-documents-subtitle": "Scannez et organisez vos dossiers médicaux imprimés", + "upload-button": "Téléverser" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-it.ts b/src/helpers/strings-it.ts index 102b5b5ca..a6daed4ea 100644 --- a/src/helpers/strings-it.ts +++ b/src/helpers/strings-it.ts @@ -533,7 +533,10 @@ let strings: { [key: string]: string } = { "file-not-loaded": "Il file non è stato caricato. Per favore, contatta il supporto.", "syncing-data": "Sincronizzazione dei dati...", "health-connect-phr-sync-title": "Sincronizza con Health Connect", - "health-connect-phr-sync-prompt": "Scegli i dati sanitari da leggere e scrivere con Health Connect" + "health-connect-phr-sync-prompt": "Scegli i dati sanitari da leggere e scrivere con Health Connect", + "uploaded-documents": "Documenti Caricati", + "upload-documents-subtitle": "Scansiona e organizza i tuoi registri medici stampati", + "upload-button": "Carica" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-nl.ts b/src/helpers/strings-nl.ts index 6509d553e..395906010 100644 --- a/src/helpers/strings-nl.ts +++ b/src/helpers/strings-nl.ts @@ -532,7 +532,10 @@ let strings: { [key: string]: string } = { "file-not-loaded": "Het bestand kon niet worden geladen. Neem contact op met de ondersteuning.", "syncing-data": "Gegevens synchroniseren...", "health-connect-phr-sync-title": "Synchroniseren met Health Connect", - "health-connect-phr-sync-prompt": "Kies welke gezondheidsgegevens je wilt lezen en schrijven met Health Connect" + "health-connect-phr-sync-prompt": "Kies welke gezondheidsgegevens je wilt lezen en schrijven met Health Connect", + "uploaded-documents": "Geüploade Documenten", + "upload-documents-subtitle": "Scan en organiseer je geprinte medische dossiers", + "upload-button": "Uploaden" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pl.ts b/src/helpers/strings-pl.ts index ec5391dcf..8065872a5 100644 --- a/src/helpers/strings-pl.ts +++ b/src/helpers/strings-pl.ts @@ -533,7 +533,10 @@ let strings: { [key: string]: string } = { "file-not-loaded": "Nie udało się załadować pliku. Proszę skontaktować się z pomocą techniczną.", "syncing-data": "Synchronizowanie danych...", "health-connect-phr-sync-title": "Synchronizuj z Health Connect", - "health-connect-phr-sync-prompt": "Wybierz rekordy zdrowotne do odczytu i zapisu w Health Connect" + "health-connect-phr-sync-prompt": "Wybierz rekordy zdrowotne do odczytu i zapisu w Health Connect", + "uploaded-documents": "Przesłane Dokumenty", + "upload-documents-subtitle": "Zeskanuj i uporządkuj swoje wydrukowane dokumenty medyczne", + "upload-button": "Prześlij" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pt.ts b/src/helpers/strings-pt.ts index 8b171f200..305bf51fb 100644 --- a/src/helpers/strings-pt.ts +++ b/src/helpers/strings-pt.ts @@ -533,7 +533,10 @@ let strings: { [key: string]: string } = { "file-not-loaded": "Não foi possível carregar o arquivo. Por favor, entre em contato com o suporte.", "syncing-data": "Sincronizando dados...", "health-connect-phr-sync-title": "Sincronizar com Health Connect", - "health-connect-phr-sync-prompt": "Escolha os registros de saúde para ler e escrever no Health Connect" + "health-connect-phr-sync-prompt": "Escolha os registros de saúde para ler e escrever no Health Connect", + "uploaded-documents": "Documentos Enviados", + "upload-documents-subtitle": "Escaneie e organize seus registros médicos impressos", + "upload-button": "Enviar" }; export default strings; \ No newline at end of file From a31ea2c97f0181d20349c9c5e857ee21d7f5b292 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 21 Feb 2025 13:30:00 -0500 Subject: [PATCH 08/50] 2.68.1-DocumentLibaryView.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3e65af34..5a1e3692d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.0", + "version": "2.68.1-DocumentLibaryView.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.0", + "version": "2.68.1-DocumentLibaryView.0", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 944e0c8f3..d2ede8894 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.0", + "version": "2.68.1-DocumentLibaryView.0", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 3976e4ccffc9266bbac9220814264c5321a520d5 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 21 Feb 2025 15:44:06 -0500 Subject: [PATCH 09/50] Add missing export of DocumentLibraryPreview --- src/components/container/DocumentLibraryPreview/index.ts | 1 + src/components/container/index.ts | 1 + 2 files changed, 2 insertions(+) create mode 100644 src/components/container/DocumentLibraryPreview/index.ts diff --git a/src/components/container/DocumentLibraryPreview/index.ts b/src/components/container/DocumentLibraryPreview/index.ts new file mode 100644 index 000000000..f851ec69d --- /dev/null +++ b/src/components/container/DocumentLibraryPreview/index.ts @@ -0,0 +1 @@ +export { default, DocumentLibraryPreviewProps } from "./DocumentLibraryPreview"; \ No newline at end of file diff --git a/src/components/container/index.ts b/src/components/container/index.ts index 11e0fa4b6..417cf646a 100644 --- a/src/components/container/index.ts +++ b/src/components/container/index.ts @@ -14,6 +14,7 @@ export { default as DailyDataChart } from "./DailyDataChart" export { default as DailyDataGoal } from "./DailyDataGoal" export { default as DeviceDataMonthChart, DeviceDataChartLine } from "./DeviceDataMonthChart" export { default as DeviceDataMonthCharts } from "./DeviceDataMonthCharts" +export { default as DocumentLibraryPreview } from "./DocumentLibraryPreview" export { default as EhrNewsFeed, EhrNewsFeedEventReference } from "./EhrNewsFeed" export { default as EhrNewsFeedEventDetail } from "./EhrNewsFeedEventDetail" export { default as ExternalAccountConnectionAlert } from "./ExternalAccountConnectionAlert" From d03503209dc4f88f1a02a0fd47730d4c1b3d3d89 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 21 Feb 2025 15:44:31 -0500 Subject: [PATCH 10/50] 2.68.1-DocumentLibaryView.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a1e3692d..f67f33070 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.0", + "version": "2.68.1-DocumentLibaryView.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.0", + "version": "2.68.1-DocumentLibaryView.1", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index d2ede8894..4c8727d88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.0", + "version": "2.68.1-DocumentLibaryView.1", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 545f56b559f01b23ebd424af55fb905b137ddd1f Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 21 Feb 2025 15:56:47 -0500 Subject: [PATCH 11/50] 2.68.1-DocumentLibaryView.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f67f33070..426e1b452 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.1", + "version": "2.68.1-DocumentLibaryView.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.1", + "version": "2.68.1-DocumentLibaryView.2", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 4c8727d88..f4d22e98f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.1", + "version": "2.68.1-DocumentLibaryView.2", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From e22b00541602ac126a30275daaafe69b95ca1294 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 21 Feb 2025 16:24:23 -0500 Subject: [PATCH 12/50] 2.68.1-DocumentLibaryView.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 426e1b452..1db1e6d99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.2", + "version": "2.68.1-DocumentLibaryView.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.2", + "version": "2.68.1-DocumentLibaryView.3", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index f4d22e98f..e80e1644a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.2", + "version": "2.68.1-DocumentLibaryView.3", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 272024cf242fe4a4a5bd8c58e58449f35123f740 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 24 Feb 2025 13:14:09 -0500 Subject: [PATCH 13/50] Update export --- src/components/container/DocumentLibraryPreview/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/container/DocumentLibraryPreview/index.ts b/src/components/container/DocumentLibraryPreview/index.ts index f851ec69d..e86ed556e 100644 --- a/src/components/container/DocumentLibraryPreview/index.ts +++ b/src/components/container/DocumentLibraryPreview/index.ts @@ -1 +1 @@ -export { default, DocumentLibraryPreviewProps } from "./DocumentLibraryPreview"; \ No newline at end of file +export { default } from "./DocumentLibraryPreview"; \ No newline at end of file From 471e45e8920748f60728515bc9898d91ce2f0e34 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 24 Feb 2025 13:14:33 -0500 Subject: [PATCH 14/50] 2.68.1-DocumentLibaryView.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1db1e6d99..f86cfa6dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.3", + "version": "2.68.1-DocumentLibaryView.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.3", + "version": "2.68.1-DocumentLibaryView.4", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index e80e1644a..6f4ae121d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.3", + "version": "2.68.1-DocumentLibaryView.4", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 954a415d49d7110d2a04a6d9a3ff44dc7afb9d50 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 24 Feb 2025 13:33:41 -0500 Subject: [PATCH 15/50] Undo version in package.json. --- package-lock.json | 13 +++++++------ package.json | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index f86cfa6dd..b719efadb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.4", + "version": "2.69.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.4", + "version": "2.69.0", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", @@ -70,7 +70,7 @@ "typescript": "^4.6.2" }, "peerDependencies": { - "@careevolution/mydatahelps-js": "^3.28.0", + "@careevolution/mydatahelps-js": "^3.29.0", "react": "^18.2.0", "react-dom": "^18.2.0" } @@ -1932,9 +1932,10 @@ "license": "MIT" }, "node_modules/@careevolution/mydatahelps-js": { - "version": "3.28.0", - "resolved": "https://registry.npmjs.org/@careevolution/mydatahelps-js/-/mydatahelps-js-3.28.0.tgz", - "integrity": "sha512-Dl2XeK6DGXDBPG/m3LXhRUqlWdtAUelSVgHmfv3eaUL63r+SkH/LqcKVlElyc2Fe4vk1PnH+AGKpGqfIOx5mcA==", + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/@careevolution/mydatahelps-js/-/mydatahelps-js-3.29.0.tgz", + "integrity": "sha512-NiITjy/LB07lRq0bojWIfnzRQhKR2g3CHtsPn3SHF2u/Ldq9lrIQ63fd+I+03Oo45lERbBjQ7VwGdT9YfueKKw==", + "license": "Apache-2.0", "peer": true }, "node_modules/@chromatic-com/storybook": { diff --git a/package.json b/package.json index 6f4ae121d..cff23e919 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.68.1-DocumentLibaryView.4", + "version": "2.69.0", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -101,7 +101,7 @@ "zod": "^3.23.8" }, "peerDependencies": { - "@careevolution/mydatahelps-js": "^3.28.0", + "@careevolution/mydatahelps-js": "^3.29.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, From e29a9e1658623ecdfece67c6103cf211dc059456 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 24 Feb 2025 13:42:01 -0500 Subject: [PATCH 16/50] 2.69.1-DocumentLibaryView.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b719efadb..eef2b3832 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.0", + "version": "2.69.1-DocumentLibaryView.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.0", + "version": "2.69.1-DocumentLibaryView.0", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index cff23e919..a5dbf3d56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.0", + "version": "2.69.1-DocumentLibaryView.0", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 75e5462e2591cb674f4cf11e6ad34bbdc73f253a Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 24 Feb 2025 16:26:19 -0500 Subject: [PATCH 17/50] Changes to onClick of DocumentLibraryPreview --- .../DocumentLibraryPreview.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index 32692f539..ed6583b2d 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -6,6 +6,7 @@ import { faCamera } from "@fortawesome/free-solid-svg-icons"; import MyDataHelps from "@careevolution/mydatahelps-js"; import { getPreviewData } from "./DocumentLibraryPreview.previewData"; import "./DocumentLibraryPreview.css"; +import { noop } from "../../../helpers/functions"; export interface DocumentLibraryPreviewProps { preview?: "PreviewNoDocuments" | "PreviewDocuments" | "PreviewLoading", @@ -53,11 +54,14 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp }); } - const onUploadClick = () => { + const onPreviewClick = () => { if (props.preview) return; - setSurveyFiles(undefined); - MyDataHelps.startSurvey(props.uploadDocumentSurveyName); + if (surveyFiles && surveyFiles.length > 0) { + MyDataHelps.openApplication(props.documentViewBaseUrl); + } else { + MyDataHelps.startSurvey(props.uploadDocumentSurveyName); + } } useInitializeView(() => { @@ -69,6 +73,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp {!surveyFiles && } {surveyFiles && } indicatorValue={surveyFiles.length > 0 ? surveyFiles.length.toString() : undefined} indicator={surveyFiles.length === 0 - ? + ? : undefined} /> } From 387c7f11f5d339d9d87ceb75708fccf3cb44a013 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 24 Feb 2025 16:28:05 -0500 Subject: [PATCH 18/50] 2.69.1-DocumentLibaryView.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index eef2b3832..8eab6306b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.0", + "version": "2.69.1-DocumentLibaryView.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.0", + "version": "2.69.1-DocumentLibaryView.1", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index a5dbf3d56..c1eee2d0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.0", + "version": "2.69.1-DocumentLibaryView.1", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 7c40963143dde64ddd29a6aa7aa3581c72e71b3d Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Tue, 25 Feb 2025 17:29:50 -0500 Subject: [PATCH 19/50] Fix count on document library preview --- .../DocumentLibraryPreview/DocumentLibraryPreview.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index ed6583b2d..7297e3004 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -22,12 +22,15 @@ export interface DocumentLibraryPreviewProps { export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProps) { const [surveyFiles, setSurveyFiles] = React.useState(undefined); + const [surveyCount, setSurveyCount] = React.useState(0); async function initialize() { if (props.preview) { if (props.preview === "PreviewNoDocuments") { + setSurveyCount(0); setSurveyFiles([]); } else if (props.preview === "PreviewDocuments") { + setSurveyCount(6); setSurveyFiles(getPreviewData()); } return; @@ -47,6 +50,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp return a.date > b.date ? -1 : 1; }); + setSurveyCount(uploadedFiles.length); const top3Files = sortedFiles.slice(0, 3).map((file: SurveyUploadedFile, index: number) => file.title ); @@ -84,7 +88,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp : undefined } titleIcon={} - indicatorValue={surveyFiles.length > 0 ? surveyFiles.length.toString() : undefined} + indicatorValue={surveyCount > 0 ? surveyCount.toString() : undefined} indicator={surveyFiles.length === 0 ? : undefined} From 238d20938586d978faf929eeaf4cd7745d894743 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Tue, 25 Feb 2025 17:32:32 -0500 Subject: [PATCH 20/50] 2.69.1-DocumentLibaryView.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8eab6306b..3aa07a2a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.1", + "version": "2.69.1-DocumentLibaryView.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.1", + "version": "2.69.1-DocumentLibaryView.2", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index c1eee2d0f..ac9e6ef5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.1", + "version": "2.69.1-DocumentLibaryView.2", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From fd8eb05a8921f2b59e109cdecd3c9424ffb8c61f Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 27 Feb 2025 11:50:26 -0500 Subject: [PATCH 21/50] Some clean up and layout experimentation --- .../DocumentLibraryPreview.tsx | 52 +++++++++++---- .../DocumentDetailView/DocumentDetailView.css | 37 ++++++++--- .../DocumentDetailView.stories.tsx | 15 ++++- .../DocumentDetailView/DocumentDetailView.tsx | 41 +++++++----- .../DocumentLibraryView.css | 10 +++ .../DocumentLibraryView.stories.tsx | 7 +- .../DocumentLibraryView.tsx | 64 ++++++++++++------- 7 files changed, 162 insertions(+), 64 deletions(-) create mode 100644 src/components/view/DocumentLibraryView/DocumentLibraryView.css diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index 7297e3004..2eac5ebc7 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -16,7 +16,7 @@ export interface DocumentLibraryPreviewProps { nameResultIdentifier: string, dateResultIdentifier: string, notesResultIdentifier: string, - documentViewBaseUrl: string, + documentLibraryViewBaseUrl: string, innerRef?: React.Ref; } @@ -58,14 +58,34 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp }); } - const onPreviewClick = () => { - if (props.preview) return; + const onShowDocumentLibraryClick = () => { + if (props.preview) { + console.log("onShowDocumentLibraryClick"); + return; + } - if (surveyFiles && surveyFiles.length > 0) { - MyDataHelps.openApplication(props.documentViewBaseUrl); - } else { - MyDataHelps.startSurvey(props.uploadDocumentSurveyName); + const params = new URLSearchParams({ + uploadDocumentSurveyName: props.uploadDocumentSurveyName, + fileResultIdentifier: props.fileResultIdentifier, + typeResultIdentifier: props.typeResultIdentifier, + nameResultIdentifier: props.nameResultIdentifier, + dateResultIdentifier: props.dateResultIdentifier, + notesResultIdentifier: props.notesResultIdentifier, + documentDetailViewBaseUrl: props.documentLibraryViewBaseUrl + }); + + const separator = props.documentLibraryViewBaseUrl.includes('?') ? '&' : '?'; + const documentLibraryViewUrl = `${props.documentLibraryViewBaseUrl}${separator}${params.toString()}`; + MyDataHelps.openApplication(documentLibraryViewUrl); + } + + const onUploadClick = () => { + if (props.preview) { + console.log("onUploadClick"); + return; } + + MyDataHelps.startSurvey(props.uploadDocumentSurveyName); } useInitializeView(() => { @@ -77,22 +97,26 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp {!surveyFiles && } {surveyFiles && 0 - ? surveyFiles.map((file, index) =>
{file}
) - : undefined - } titleIcon={} indicatorValue={surveyCount > 0 ? surveyCount.toString() : undefined} + onClick={surveyFiles.length === 0 + ? undefined : + onShowDocumentLibraryClick} indicator={surveyFiles.length === 0 - ? + ? : undefined} - /> + > + {surveyFiles.length > 0 + ? surveyFiles.map((file, index) =>
{file}
) + : undefined + } +
} ) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.css b/src/components/view/DocumentDetailView/DocumentDetailView.css index 89f76bb1d..c0d596509 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.css +++ b/src/components/view/DocumentDetailView/DocumentDetailView.css @@ -1,21 +1,23 @@ +.mdhui-survey-answer-details { + display: flex; + flex-direction: column; + margin: 16px; +} + .mdhui-survey-answer-file-container { - max-width: 600px; - margin: auto; - padding: 16px; border-radius: 8px; - background: #f9f9f9; - box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); } .mdhui-survey-answer-file-preview-container { width: 100%; height: 55vh; display: flex; + flex-direction: column; align-items: center; justify-content: center; - background: #fff; border-radius: 8px; overflow: hidden; + background-color: var(--mdhui-background-color-2); } .mdhui-survey-answer-file-preview-content { @@ -25,23 +27,30 @@ width: 90%; } +.mdhui-survey-answer-file-preview-file { + background-color: white; +} + .mdhui-survey-answer-file-image-preview { + margin-top: 16px; object-fit: contain; } .mdhui-survey-answer-file-document-file-name { display: flex; justify-content: center; - margin-top: 10px; + padding-top: var(--mdhui-padding-sm); + margin-bottom: var(--mdhui-padding-sm); + padding-bottom: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-document-details-parent { - padding: 10px; + padding-top: 15px; } .mdhui-survey-answer-file-document-details { font-size: .88em; - margin: 5px; + padding-bottom: var(--mdhui-padding-xs); } .mdhui-survey-answer-file-download-button { @@ -49,5 +58,15 @@ flex-direction: column; align-items: flex-end; justify-content: flex-end; + margin-top: 15px; + margin-bottom: 10px; +} + +.mdhui-survey-answer-file-delete-button { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin-top: 15px; margin-bottom: 10px; } \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index 99ea53a77..e1bd7c207 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -69,7 +69,18 @@ export const FileNotFound: Story = { render: render }; -export const Live: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: '2e3f7062-87e8-ef11-bafe-0affe8024cad' }, +export const LiveText: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: '536298d2-79f4-ef11-bafe-0affe8024cad' }, + render: render +}; + + +export const LivePdf: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: 'ad038eea-79f4-ef11-bafe-0affe8024cad' }, + render: render +}; + +export const LiveImage: Story = { + args: { ...uploadDocumentSurveyProps, surveyResultId: 'a90c0337-cfe4-ef11-bafe-0affe8024cad' }, render: render }; \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 0b8c08640..b429fef53 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Button, Layout, LoadingIndicator, Title } from "../../presentational"; +import { Button, Layout, LoadingIndicator, NavigationBar, Title } from "../../presentational"; import MyDataHelps from "@careevolution/mydatahelps-js"; import { language, SurveyUploadedFileQueryParameters, queryAllSurveyFiles, SurveyUploadedFile, useInitializeView, deleteSurveyResultFiles } from "../../../helpers"; import "./DocumentDetailView.css"; @@ -31,6 +31,7 @@ export interface DocumentDetail extends SurveyUploadedFile { */ export default function DocumentDetailView(props: DocumentDetailViewProps) { let [documentDetail, setDocumentDetail] = React.useState(); + let [loading, setLoading] = React.useState(false); async function initialize() { const params: SurveyUploadedFileQueryParameters = { @@ -108,9 +109,14 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } if (window.confirm(language("delete-file-confirm"))) { + setLoading(true); deleteSurveyResultFiles(documentDetail.surveyResultId, documentDetail.fileKey).then(() => { setDocumentDetail(undefined); MyDataHelps.dismiss(); + }).catch(error => { + console.error('Failed to delete file:', error); + }).finally(() => { + setLoading(false); }); } }; @@ -121,26 +127,29 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { }, [], []); return ( - - {(!documentDetail) && } - {documentDetail?.showDownload && -
- -
- } - + + + {documentDetail?.showDownload && +
+ +
+ } +
+ {(!documentDetail || loading) && } {documentDetail && - <> -
+
+
{documentDetail?.presignedDocUrl && - } + } {documentDetail?.presignedImageUrl && {language("file-not-loaded")}} {!documentDetail.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
} +
{documentDetail?.fileName}
-
{documentDetail?.fileName}
+ {/*
{documentDetail?.fileName}
*/}
@@ -148,9 +157,11 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) {
{`${documentDetail?.title} - ${getShortDateString(documentDetail?.date!)}`}
{language("notes")}
{documentDetail?.notes}
-
- +
+ +
+
} ); diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.css b/src/components/view/DocumentLibraryView/DocumentLibraryView.css new file mode 100644 index 000000000..2d549d03f --- /dev/null +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.css @@ -0,0 +1,10 @@ +.mdhui-document-library-view-segment-control { + margin: 16px; +} + +.mdhui-document-library-view-title-div { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx index cbded7597..f9640aa29 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx @@ -29,7 +29,7 @@ const defaultProps : DocumentLibraryViewProps = { nameResultIdentifier: 'document_name', dateResultIdentifier: 'document_date', notesResultIdentifier: 'document_notes', - documentViewBaseUrl: '' + documentDetailViewBaseUrl: '' }; export const Default: Story = { @@ -37,6 +37,11 @@ export const Default: Story = { render: render }; +export const NoFiles: Story = { + args: { ...defaultProps, preview: 'PreviewNoFiles' }, + render: render +}; + export const Loading: Story = { args: { ...defaultProps, preview: 'PreviewLoading' }, render: render diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index 7abf7c063..6ac7a3148 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Action, Button, Layout, LoadingIndicator, Title } from "../../presentational"; +import { Action, Button, Card, Layout, LoadingIndicator, NavigationBar, Title } from "../../presentational"; import { language, useInitializeView } from "../../../helpers"; import SegmentedControl, { SegmentedControlProps } from "../../presentational/SegmentedControl/SegmentedControl"; import { FontAwesomeSvgIcon } from "react-fontawesome-svg-icon"; @@ -8,16 +8,17 @@ import MyDataHelps from "@careevolution/mydatahelps-js"; import { getShortDateString } from "../../../helpers/date-helpers"; import { queryAllSurveyFiles, SurveyUploadedFile, SurveyUploadedFileQueryParameters } from "../../../helpers"; import { getPreviewData } from "./DocumentLibraryView.previewData"; +import "./DocumentLibraryView.css"; export interface DocumentLibraryViewProps { - preview?: "Preview" | "PreviewLoading", + preview?: "Preview" | "PreviewNoFiles" | "PreviewLoading", uploadDocumentSurveyName: string, fileResultIdentifier: string, typeResultIdentifier: string, nameResultIdentifier: string, dateResultIdentifier: string, notesResultIdentifier: string, - documentViewBaseUrl: string, + documentDetailViewBaseUrl: string, colorScheme?: "auto" | "light" | "dark" } @@ -61,15 +62,20 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { } const onFileClick = (file: SurveyUploadedFile) => { - //console.log(`Opening File ${file.title} ${file.fileName} ${file.type} ${file.date} SurveyResultID: ${file.surveyResultId}`); + console.log(`Opening File ${file.title} ${file.fileName} ${file.type} ${file.date} SurveyResultID: ${file.surveyResultId}`); - if (props.documentViewBaseUrl) { - const documentDetailViewUrl = props.documentViewBaseUrl + '?surveyResultId=' + encodeURIComponent(file.surveyResultId) - + '&fileResultIdentifier=' + encodeURIComponent(props.fileResultIdentifier) - + '&typeResultIdentifier=' + encodeURIComponent(props.typeResultIdentifier) - + '&nameResultIdentifier=' + encodeURIComponent(props.nameResultIdentifier) - + '&dateResultIdentifier=' + encodeURIComponent(props.dateResultIdentifier) - + '¬esResultIdentifier=' + encodeURIComponent(props.notesResultIdentifier); + if (!props.preview) { + const params = new URLSearchParams({ + surveyResultId: file.surveyResultId, + fileResultIdentifier: props.fileResultIdentifier, + typeResultIdentifier: props.typeResultIdentifier, + nameResultIdentifier: props.nameResultIdentifier, + dateResultIdentifier: props.dateResultIdentifier, + notesResultIdentifier: props.notesResultIdentifier + }); + + const separator = props.documentDetailViewBaseUrl.includes('?') ? '&' : '?'; + const documentDetailViewUrl = `${props.documentDetailViewBaseUrl}${separator}${params.toString()}`; MyDataHelps.openApplication(documentDetailViewUrl); } } @@ -78,8 +84,12 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { setLoading(true); if (props.preview) { + let previewData : SurveyUploadedFile[] = []; if (props.preview === "Preview") { - setFiles(getPreviewData()); + previewData = getPreviewData(); + } + if (props.preview !== "PreviewLoading") { + setFiles(previewData); setLoading(false); } return; @@ -96,6 +106,9 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { queryAllSurveyFiles({ ...params }).then((uploadedFiles: SurveyUploadedFile[]) => { setFiles(uploadedFiles); + }).catch(error => { + console.error('Failed to query files:', error); + }).finally(() => { setLoading(false); }); } @@ -112,10 +125,12 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { }); return sortedFiles.map((file: SurveyUploadedFile, index: number) => - } - onClick={() => onFileClick(file)}> + + } + onClick={() => onFileClick(file)}> + ); } @@ -124,15 +139,18 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { }, [], []); return ( - + + +
+ {language('documents')} + {!loading && } +
+
{loading && } {!loading && <> -
- {language('documents')} - -
- - + {files.length > 0 && buildFileList(files, selectedSegment)} }
From a97d3690a1c3c4a8726a748cea34bef3179825d8 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 27 Feb 2025 11:52:49 -0500 Subject: [PATCH 22/50] 2.69.1-DocumentLibaryView.3 --- package-lock.json | 4 +- package.json | 2 +- .../DocumentLibraryPreview.stories.tsx | 2 +- .../DocumentLibraryPreview.tsx | 48 ++++++++++--------- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3aa07a2a6..1880239a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.2", + "version": "2.69.1-DocumentLibaryView.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.2", + "version": "2.69.1-DocumentLibaryView.3", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index ac9e6ef5d..172a019cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.2", + "version": "2.69.1-DocumentLibaryView.3", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx index 601478c94..da27a121d 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx @@ -30,7 +30,7 @@ const defaultProps: DocumentLibraryPreviewProps = { nameResultIdentifier: 'document_name', dateResultIdentifier: 'document_date', notesResultIdentifier: 'document_notes', - documentViewBaseUrl: '' + documentLibraryViewBaseUrl: '' }; export const NoUploadedFiles: Story = { diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index 2eac5ebc7..5b0446a5d 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -1,6 +1,6 @@ import React from "react"; import { language, queryAllSurveyFiles, SurveyUploadedFile, SurveyUploadedFileQueryParameters, useInitializeView } from "../../../helpers"; -import { Action, Button, LoadingIndicator } from "../../presentational"; +import { Action, Button, Card, LoadingIndicator } from "../../presentational"; import { FontAwesomeSvgIcon } from "react-fontawesome-svg-icon"; import { faCamera } from "@fortawesome/free-solid-svg-icons"; import MyDataHelps from "@careevolution/mydatahelps-js"; @@ -59,7 +59,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp } const onShowDocumentLibraryClick = () => { - if (props.preview) { + if (props.preview || !props.documentLibraryViewBaseUrl) { console.log("onShowDocumentLibraryClick"); return; } @@ -96,27 +96,29 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp
{!surveyFiles && } {surveyFiles && - } - indicatorValue={surveyCount > 0 ? surveyCount.toString() : undefined} - onClick={surveyFiles.length === 0 - ? undefined : - onShowDocumentLibraryClick} - indicator={surveyFiles.length === 0 - ? - : undefined} - > - {surveyFiles.length > 0 - ? surveyFiles.map((file, index) =>
{file}
) - : undefined - } -
+ + } + indicatorValue={surveyCount > 0 ? surveyCount.toString() : undefined} + onClick={surveyFiles.length === 0 + ? undefined : + onShowDocumentLibraryClick} + indicator={surveyFiles.length === 0 + ? + : undefined} + > + {surveyFiles.length > 0 + ? surveyFiles.map((file, index) =>
{file}
) + : undefined + } +
+
}
) From 41ffb57ff2fcf8d087832f608fe3e531f3afb088 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 27 Feb 2025 12:26:20 -0500 Subject: [PATCH 23/50] More --- .../container/DocumentLibraryPreview/DocumentLibraryPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index 5b0446a5d..c8df29062 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -82,7 +82,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp const onUploadClick = () => { if (props.preview) { console.log("onUploadClick"); - return; + return; } MyDataHelps.startSurvey(props.uploadDocumentSurveyName); From 8082b77b043383602200d7ffcf3bf65a9f761dda Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 27 Feb 2025 12:28:45 -0500 Subject: [PATCH 24/50] 2.69.1-DocumentLibaryView.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1880239a8..8ebd06c7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.3", + "version": "2.69.1-DocumentLibaryView.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.3", + "version": "2.69.1-DocumentLibaryView.4", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 172a019cf..7f937501a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.69.1-DocumentLibaryView.3", + "version": "2.69.1-DocumentLibaryView.4", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 3bc95c08fdd373e808d10a0b38f7fccddb99781e Mon Sep 17 00:00:00 2001 From: Garrett Reinard Date: Thu, 27 Feb 2025 15:19:42 -0500 Subject: [PATCH 25/50] 2.72.1-DocumentLibaryView.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80a264ddb..f3357fb39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.0", + "version": "2.72.1-DocumentLibaryView.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.0", + "version": "2.72.1-DocumentLibaryView.0", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index adae9fb0d..1e73486db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.0", + "version": "2.72.1-DocumentLibaryView.0", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From a02003ef254943a2e50e71d6d81de494db2e2a3f Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 28 Feb 2025 10:31:09 -0500 Subject: [PATCH 26/50] manually copy in rollup fixes --- .../container/SurveyTaskList/SurveyTaskList.previewdata.tsx | 2 +- src/helpers/daily-data-types/air-quality.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/container/SurveyTaskList/SurveyTaskList.previewdata.tsx b/src/components/container/SurveyTaskList/SurveyTaskList.previewdata.tsx index 34f28d39f..ca9131847 100644 --- a/src/components/container/SurveyTaskList/SurveyTaskList.previewdata.tsx +++ b/src/components/container/SurveyTaskList/SurveyTaskList.previewdata.tsx @@ -37,7 +37,7 @@ export var previewIncompleteTasks: SurveyTask[] = "surveyDescription": "10 minutes", "status": "incomplete", "hasSavedProgress": false, - "dueDate": null, + "dueDate": undefined, "insertedDate": "2022-03-15T16:56:26.703Z", "modifiedDate": "2022-03-15T16:56:26.703Z", linkIdentifier: "1" diff --git a/src/helpers/daily-data-types/air-quality.tsx b/src/helpers/daily-data-types/air-quality.tsx index 888ac418f..f69136f01 100644 --- a/src/helpers/daily-data-types/air-quality.tsx +++ b/src/helpers/daily-data-types/air-quality.tsx @@ -1,7 +1,6 @@ import { FontAwesomeSvgIcon } from "react-fontawesome-svg-icon"; import { DailyDataType, DailyDataTypeDefinition } from "../daily-data-types"; import { faWind } from "@fortawesome/free-solid-svg-icons"; -import language, { Language } from "../language"; import React from "react"; import { defaultFormatter } from "./formatters"; import { airQualityDataProvider, homeAirQualityDataProvider, workAirQualityDataProvider } from "../daily-data-providers"; From 04dde7ce74e6ef7633860d9799ee19485f321eac Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 28 Feb 2025 10:38:29 -0500 Subject: [PATCH 27/50] 2.72.1-DocumentLibaryView.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3357fb39..ae03b6721 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.0", + "version": "2.72.1-DocumentLibaryView.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.0", + "version": "2.72.1-DocumentLibaryView.1", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 1e73486db..7442d1744 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.0", + "version": "2.72.1-DocumentLibaryView.1", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 146b40bcfd925421fe1da32b575cdf356cfc0939 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 28 Feb 2025 12:36:50 -0500 Subject: [PATCH 28/50] Remove unnecassary urlsearchparam --- .../DocumentLibraryPreview/DocumentLibraryPreview.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index c8df29062..da70f6d69 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -70,8 +70,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp typeResultIdentifier: props.typeResultIdentifier, nameResultIdentifier: props.nameResultIdentifier, dateResultIdentifier: props.dateResultIdentifier, - notesResultIdentifier: props.notesResultIdentifier, - documentDetailViewBaseUrl: props.documentLibraryViewBaseUrl + notesResultIdentifier: props.notesResultIdentifier }); const separator = props.documentLibraryViewBaseUrl.includes('?') ? '&' : '?'; From 5593bdbeac926716eb79bbc4b0695ec7c43d0736 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 28 Feb 2025 12:39:28 -0500 Subject: [PATCH 29/50] 2.72.1-DocumentLibaryView.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae03b6721..8dde1b9de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.1", + "version": "2.72.1-DocumentLibaryView.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.1", + "version": "2.72.1-DocumentLibaryView.2", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 7442d1744..205e4d83e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.1", + "version": "2.72.1-DocumentLibaryView.2", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 00e000281aa1bb489ba9090510e42f23ec9a5e52 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Fri, 28 Feb 2025 12:39:28 -0500 Subject: [PATCH 30/50] 2.72.1-DocumentLibaryView.2 --- package-lock.json | 4 ++-- package.json | 2 +- .../view/DocumentLibraryView/DocumentLibraryView.tsx | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae03b6721..8dde1b9de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.1", + "version": "2.72.1-DocumentLibaryView.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.1", + "version": "2.72.1-DocumentLibaryView.2", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 7442d1744..205e4d83e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.1", + "version": "2.72.1-DocumentLibaryView.2", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index 6ac7a3148..094831d4c 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -62,7 +62,7 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { } const onFileClick = (file: SurveyUploadedFile) => { - console.log(`Opening File ${file.title} ${file.fileName} ${file.type} ${file.date} SurveyResultID: ${file.surveyResultId}`); + console.log(`Opening File ${file.title} ${file.fileName} ${file.type} ${file.date} SurveyResultID: ${file.surveyResultId}`); //TODO: Remove if (!props.preview) { const params = new URLSearchParams({ @@ -141,8 +141,7 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { return ( + showBackButton={true}>
{language('documents')} {!loading && } From 1dda0b118b4580281d280d917b059371dec80e87 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 3 Mar 2025 15:55:54 -0500 Subject: [PATCH 31/50] Replace iFrame with download button --- .../DocumentDetailView/DocumentDetailView.tsx | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index b429fef53..3a0474178 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -22,7 +22,6 @@ export interface DocumentDetailViewProps { export interface DocumentDetail extends SurveyUploadedFile { presignedDocUrl: string, presignedImageUrl: string, - showDownload: boolean, fileKey: string } @@ -30,8 +29,9 @@ export interface DocumentDetail extends SurveyUploadedFile { * The survey must be configured to allow deleting of survey results */ export default function DocumentDetailView(props: DocumentDetailViewProps) { - let [documentDetail, setDocumentDetail] = React.useState(); - let [loading, setLoading] = React.useState(false); + const [documentDetail, setDocumentDetail] = React.useState(); + const [loading, setLoading] = React.useState(false); + const [downloadAsWeb, setDownloadAsWeb] = React.useState(true); async function initialize() { const params: SurveyUploadedFileQueryParameters = { @@ -55,6 +55,8 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { MyDataHelps.getDeviceInfo(), queryAllSurveyFiles({ ...params }) ]).then(([deviceInfo, uploadedFiles]) => { + setDownloadAsWeb(!deviceInfo || deviceInfo.platform === "Web"); + if (uploadedFiles.length > 0) { const file = uploadedFiles[0]; MyDataHelps.queryFiles({ category: file.fileCategory }).then(function (files) { @@ -68,7 +70,6 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { ...file, presignedDocUrl: "", presignedImageUrl: "", - showDownload: !["iOS", "Android"].includes(deviceInfo?.platform) && !file.fileName.endsWith("pdf"), fileKey: files.files[0].key }; @@ -94,9 +95,8 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } async function downloadFile() { - const deviceInfo = await MyDataHelps.getDeviceInfo(); - if (!deviceInfo || deviceInfo.platform == "Web") { + if (downloadAsWeb) { window.open(documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl, "_blank"); } else { (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl }); @@ -130,11 +130,6 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { - {documentDetail?.showDownload && -
- -
- }
{(!documentDetail || loading) && } {documentDetail && @@ -142,14 +137,14 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) {
{documentDetail?.presignedDocUrl && - } + + } {documentDetail?.presignedImageUrl && {language("file-not-loaded")}} {!documentDetail.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
}
{documentDetail?.fileName}
- {/*
{documentDetail?.fileName}
*/}
From cab510d4585dc2f1b568f32606c707b0b0d425a7 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 3 Mar 2025 15:59:14 -0500 Subject: [PATCH 32/50] Remove showDownload from Preview data --- .../DocumentDetailView/DocumentDetailView.previewData.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts index aba440bce..efb4e27e8 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts +++ b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts @@ -31,7 +31,6 @@ const previewPdfData: DocumentDetail = { date: new Date(), presignedDocUrl: "https://freelawlibrary.org/wp-content/uploads/2022/10/The-Constitution-Full-Text-The-National-Constitution-Center.pdf", presignedImageUrl: "", - showDownload: false, fileKey: "file key" }; @@ -45,7 +44,6 @@ const previewTxtData: DocumentDetail = { date: new Date(), presignedDocUrl: "https://www.gutenberg.org/cache/epub/42671/pg42671.txt", presignedImageUrl: "", - showDownload: false, fileKey: "file key" }; @@ -59,7 +57,6 @@ const previewImageData: DocumentDetail = { date: new Date(), presignedDocUrl: "", presignedImageUrl: "https://careevolution.com/wp-content/themes/careevolution-2023/assets/images/logo.svg", - showDownload: false, fileKey: "file key" }; @@ -73,7 +70,6 @@ const previewFileNotFoundData: DocumentDetail = { date: new Date(), presignedDocUrl: "", presignedImageUrl: "", - showDownload: false, fileKey: "file key" }; @@ -87,7 +83,6 @@ const previewCsvFile: DocumentDetail = { date: new Date(), presignedDocUrl: "https://people.sc.fsu.edu/~jburkardt/data/csv/airtravel.csv", presignedImageUrl: "", - showDownload: false, fileKey: "file key" }; @@ -101,7 +96,6 @@ const previewMp4: DocumentDetail = { date: new Date(), presignedDocUrl: "https://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4", presignedImageUrl: "", - showDownload: false, fileKey: "file key" }; @@ -115,6 +109,5 @@ const previewFileNotSupported: DocumentDetail = { date: new Date(), presignedDocUrl: "https:/abc.123.org/AFailingDocument.zip", presignedImageUrl: "", - showDownload: false, fileKey: "file key" }; From 94f8fdac6090b061995ef79b957d6c99e4d0a08f Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Tue, 4 Mar 2025 09:43:02 -0500 Subject: [PATCH 33/50] 2.72.1-DocumentLibaryView.3 --- package-lock.json | 4 ++-- package.json | 2 +- .../DocumentLibraryPreview.stories.tsx | 2 +- .../DocumentLibraryPreview.tsx | 6 +++--- .../DocumentDetailView/DocumentDetailView.tsx | 19 +++++++++++++------ .../DocumentLibraryView.stories.tsx | 4 ++-- .../DocumentLibraryView.tsx | 10 +++++----- 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8dde1b9de..9dcf21775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.2", + "version": "2.72.1-DocumentLibaryView.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.2", + "version": "2.72.1-DocumentLibaryView.3", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 205e4d83e..b19267574 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.2", + "version": "2.72.1-DocumentLibaryView.3", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx index da27a121d..5c736ff9f 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.stories.tsx @@ -18,7 +18,7 @@ const meta: Meta = { export default meta; type Story = StoryObj; -const render = (args: DocumentLibraryPreviewProps) => +const render = (args: DocumentLibraryPreviewProps) => ; diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index da70f6d69..c95df2b43 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -81,7 +81,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp const onUploadClick = () => { if (props.preview) { console.log("onUploadClick"); - return; + return; } MyDataHelps.startSurvey(props.uploadDocumentSurveyName); @@ -105,8 +105,8 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp : ""} titleIcon={} indicatorValue={surveyCount > 0 ? surveyCount.toString() : undefined} - onClick={surveyFiles.length === 0 - ? undefined : + onClick={surveyFiles.length === 0 + ? undefined : onShowDocumentLibraryClick} indicator={surveyFiles.length === 0 ? diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 3a0474178..2fc6093c7 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -56,7 +56,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { queryAllSurveyFiles({ ...params }) ]).then(([deviceInfo, uploadedFiles]) => { setDownloadAsWeb(!deviceInfo || deviceInfo.platform === "Web"); - + if (uploadedFiles.length > 0) { const file = uploadedFiles[0]; MyDataHelps.queryFiles({ category: file.fileCategory }).then(function (files) { @@ -96,11 +96,18 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { async function downloadFile() { - if (downloadAsWeb) { + /* if (downloadAsWeb) { window.open(documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl, "_blank"); } else { - (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl }); - } + (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + } */ + MyDataHelps.getDeviceInfo().then(function (deviceInfo) { + if (!deviceInfo || deviceInfo.platform == "Web") { + window.open(documentDetail?.presignedDocUrl); + } else { + (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + } + }); } const deleteFile = async () => { @@ -143,7 +150,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { {language("file-not-loaded")}} {!documentDetail.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
} -
{documentDetail?.fileName}
+
{documentDetail?.fileName}
@@ -154,7 +161,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) {
{documentDetail?.notes}
- +
} diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx index f9640aa29..0eadd9b81 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.stories.tsx @@ -18,10 +18,10 @@ const meta: Meta = { export default meta; type Story = StoryObj; -const render = (args: DocumentLibraryViewProps) => +const render = (args: DocumentLibraryViewProps) => ; -const defaultProps : DocumentLibraryViewProps = { +const defaultProps: DocumentLibraryViewProps = { colorScheme: 'auto', uploadDocumentSurveyName: 'UploadDocument', fileResultIdentifier: 'document', diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index 094831d4c..3a289655d 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -84,7 +84,7 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { setLoading(true); if (props.preview) { - let previewData : SurveyUploadedFile[] = []; + let previewData: SurveyUploadedFile[] = []; if (props.preview === "Preview") { previewData = getPreviewData(); } @@ -142,10 +142,10 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { -
- {language('documents')} - {!loading && } -
+
+ {language('documents')} + {!loading && } +
{loading && } {!loading && <> From 9c761eb0c5fbdc1606a791d997f4a05621121311 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Tue, 4 Mar 2025 13:29:23 -0500 Subject: [PATCH 34/50] 2.72.1-DocumentLibaryView.4 --- package-lock.json | 4 ++-- package.json | 2 +- src/components/view/DocumentDetailView/DocumentDetailView.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9dcf21775..c3e7c4e42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.3", + "version": "2.72.1-DocumentLibaryView.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.3", + "version": "2.72.1-DocumentLibaryView.4", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index b19267574..55db13bec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.3", + "version": "2.72.1-DocumentLibaryView.4", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 2fc6093c7..0a81679be 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -103,9 +103,9 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } */ MyDataHelps.getDeviceInfo().then(function (deviceInfo) { if (!deviceInfo || deviceInfo.platform == "Web") { - window.open(documentDetail?.presignedDocUrl); + return window.open(documentDetail?.presignedDocUrl); } else { - (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + return (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); } }); } From b679caf0adf2fc4b72df8bda25a0a2c2f269554d Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Tue, 4 Mar 2025 14:13:53 -0500 Subject: [PATCH 35/50] 2.72.1-DocumentLibaryView.5 --- package-lock.json | 4 ++-- package.json | 2 +- .../view/DocumentDetailView/DocumentDetailView.tsx | 14 +++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3e7c4e42..837615410 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.4", + "version": "2.72.1-DocumentLibaryView.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.4", + "version": "2.72.1-DocumentLibaryView.5", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 55db13bec..a38bb2646 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.4", + "version": "2.72.1-DocumentLibaryView.5", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 0a81679be..65118365b 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -110,6 +110,14 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { }); } + function openWindowsFile() { + window.open(documentDetail?.presignedDocUrl, "_blank"); + } + + function openiOSFile() { + (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + } + const deleteFile = async () => { if (!documentDetail?.fileKey || !documentDetail?.surveyResultId) { return; @@ -144,7 +152,11 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) {
{documentDetail?.presignedDocUrl && - + <> + + + + } {documentDetail?.presignedImageUrl && {language("file-not-loaded")} Date: Tue, 4 Mar 2025 15:05:39 -0500 Subject: [PATCH 36/50] 2.72.1-DocumentLibaryView.6 --- package-lock.json | 4 ++-- package.json | 2 +- .../DocumentDetailView/DocumentDetailView.stories.tsx | 2 +- .../view/DocumentDetailView/DocumentDetailView.tsx | 11 ++++++++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 837615410..2609698df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.5", + "version": "2.72.1-DocumentLibaryView.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.5", + "version": "2.72.1-DocumentLibaryView.6", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index a38bb2646..8a240cce7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.5", + "version": "2.72.1-DocumentLibaryView.6", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index e1bd7c207..a1885d7dc 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -76,7 +76,7 @@ export const LiveText: Story = { export const LivePdf: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: 'ad038eea-79f4-ef11-bafe-0affe8024cad' }, + args: { ...uploadDocumentSurveyProps, surveyResultId: 'c8fd5680-d4f9-ef11-baff-0affe8024cad' }, render: render }; diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 65118365b..6ce6be961 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -103,9 +103,9 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } */ MyDataHelps.getDeviceInfo().then(function (deviceInfo) { if (!deviceInfo || deviceInfo.platform == "Web") { - return window.open(documentDetail?.presignedDocUrl); + window.open(documentDetail?.presignedDocUrl); } else { - return (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); } }); } @@ -115,7 +115,12 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } function openiOSFile() { - (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + //(window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); + if (documentDetail?.presignedDocUrl) { + MyDataHelps.openEmbeddedUrl(documentDetail?.presignedDocUrl); + } else { + window.confirm("the file url is empty"); + } } const deleteFile = async () => { From 0cd783035e217baf3e48426c2bc4fe6923df0099 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Wed, 5 Mar 2025 14:06:05 -0500 Subject: [PATCH 37/50] 2.72.1-DocumentLibaryView.7 --- package-lock.json | 4 +-- package.json | 2 +- .../DocumentDetailView.previewData.ts | 15 --------- .../DocumentDetailView.stories.tsx | 18 +---------- .../DocumentDetailView/DocumentDetailView.tsx | 31 ++----------------- .../DocumentLibraryView.tsx | 14 ++++----- 6 files changed, 13 insertions(+), 71 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2609698df..a101281eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.6", + "version": "2.72.1-DocumentLibaryView.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.6", + "version": "2.72.1-DocumentLibaryView.7", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 8a240cce7..23aa56b7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.6", + "version": "2.72.1-DocumentLibaryView.7", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts index efb4e27e8..a9b2d6d93 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts +++ b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts @@ -14,8 +14,6 @@ export function getPreviewData(preview: DocumentDetailViewPreviewType): Document return previewMp4; case "PreviewFileNotFound": return previewFileNotFoundData; - case "PreviewUnknown": - return previewFileNotSupported; default: return undefined; } @@ -98,16 +96,3 @@ const previewMp4: DocumentDetail = { presignedImageUrl: "", fileKey: "file key" }; - -const previewFileNotSupported: DocumentDetail = { - surveyResultId: "12345", - fileCategory: "test category", - title: "Failing Document", - fileName: "AFailingDocument.zip", - type: "Zip", - notes: "This should display an error message", - date: new Date(), - presignedDocUrl: "https:/abc.123.org/AFailingDocument.zip", - presignedImageUrl: "", - fileKey: "file key" -}; diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index a1885d7dc..223c813d7 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -54,11 +54,6 @@ export const Video: Story = { render: render }; -export const Unsupported: Story = { - args: { ...uploadDocumentSurveyProps, preview: 'PreviewUnknown' }, - render: render -}; - export const Loading: Story = { args: { ...uploadDocumentSurveyProps, preview: 'PreviewLoading' }, render: render @@ -69,18 +64,7 @@ export const FileNotFound: Story = { render: render }; -export const LiveText: Story = { +export const Live: Story = { args: { ...uploadDocumentSurveyProps, surveyResultId: '536298d2-79f4-ef11-bafe-0affe8024cad' }, render: render -}; - - -export const LivePdf: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: 'c8fd5680-d4f9-ef11-baff-0affe8024cad' }, - render: render -}; - -export const LiveImage: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: 'a90c0337-cfe4-ef11-bafe-0affe8024cad' }, - render: render }; \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 6ce6be961..533c13754 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -95,31 +95,10 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } async function downloadFile() { - - /* if (downloadAsWeb) { + if (downloadAsWeb) { window.open(documentDetail?.presignedDocUrl ?? documentDetail?.presignedImageUrl, "_blank"); } else { - (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); - } */ - MyDataHelps.getDeviceInfo().then(function (deviceInfo) { - if (!deviceInfo || deviceInfo.platform == "Web") { - window.open(documentDetail?.presignedDocUrl); - } else { - (window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); - } - }); - } - - function openWindowsFile() { - window.open(documentDetail?.presignedDocUrl, "_blank"); - } - - function openiOSFile() { - //(window as any).webkit.messageHandlers.OpenFile.postMessage({ url: documentDetail?.presignedDocUrl }); - if (documentDetail?.presignedDocUrl) { - MyDataHelps.openEmbeddedUrl(documentDetail?.presignedDocUrl); - } else { - window.confirm("the file url is empty"); + MyDataHelps.openEmbeddedUrl(documentDetail?.presignedDocUrl!); } } @@ -157,11 +136,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) {
{documentDetail?.presignedDocUrl && - <> - - - - + } {documentDetail?.presignedImageUrl && {language("file-not-loaded")}(false); - const [selectedSegment, setSelectedSegment] = React.useState<"date" | "name" | "type">("date"); - const [files, setFiles] = React.useState([]); + const [loading, setLoading] = useState(false); + const [selectedSegment, setSelectedSegment] = useState<"date" | "name" | "type">("date"); + const [files, setFiles] = useState([]); const segmentedControlProps: SegmentedControlProps = { segments: [ @@ -147,11 +147,9 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { {!loading && }
+ {loading && } - {!loading && <> - - {files.length > 0 && buildFileList(files, selectedSegment)} - } + {!loading && buildFileList(files, selectedSegment)} ) } \ No newline at end of file From feb7032f9584be9aab449f2b41f44311c832eac2 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Wed, 5 Mar 2025 15:48:41 -0500 Subject: [PATCH 38/50] 2.72.1-DocumentLibaryView.8 --- package-lock.json | 4 ++-- package.json | 2 +- .../view/DocumentLibraryView/DocumentLibraryView.tsx | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index a101281eb..b5b876681 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.7", + "version": "2.72.1-DocumentLibaryView.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.7", + "version": "2.72.1-DocumentLibaryView.8", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 23aa56b7b..f8fe77c61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.7", + "version": "2.72.1-DocumentLibaryView.8", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index 5ee985008..654a37add 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useMemo, useState } from "react"; import { Action, Button, Card, Layout, LoadingIndicator, NavigationBar, Title } from "../../presentational"; import { language, useInitializeView } from "../../../helpers"; import SegmentedControl, { SegmentedControlProps } from "../../presentational/SegmentedControl/SegmentedControl"; @@ -138,6 +138,8 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { initialize(); }, [], []); + const fileList = useMemo(() => buildFileList(files, selectedSegment), [files, selectedSegment]); + return ( {loading && } - {!loading && buildFileList(files, selectedSegment)} + {!loading && fileList} ) } \ No newline at end of file From 6161bcdbab5a0006ad4ce69d4dcf4b17e91af69d Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Wed, 5 Mar 2025 16:05:27 -0500 Subject: [PATCH 39/50] 2.72.1-DocumentLibaryView.9 --- package-lock.json | 4 +- package.json | 2 +- .../DocumentLibraryPreview.tsx | 2 +- .../DocumentDetailView/DocumentDetailView.css | 37 +++++-------------- .../DocumentDetailView.stories.tsx | 2 +- .../DocumentDetailView/DocumentDetailView.tsx | 4 +- .../DocumentLibraryView.css | 7 ---- .../DocumentLibraryView.tsx | 7 ++-- src/helpers/strings-de.ts | 3 +- src/helpers/strings-en.ts | 3 +- src/helpers/strings-es.ts | 3 +- src/helpers/strings-fr.ts | 3 +- src/helpers/strings-it.ts | 3 +- src/helpers/strings-nl.ts | 3 +- src/helpers/strings-pl.ts | 3 +- src/helpers/strings-pt.ts | 3 +- 16 files changed, 27 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index b5b876681..e6dc1d6f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.8", + "version": "2.72.1-DocumentLibaryView.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.8", + "version": "2.72.1-DocumentLibaryView.9", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index f8fe77c61..ba44bf972 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.8", + "version": "2.72.1-DocumentLibaryView.9", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx index c95df2b43..c6dcef83b 100644 --- a/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx +++ b/src/components/container/DocumentLibraryPreview/DocumentLibraryPreview.tsx @@ -109,7 +109,7 @@ export default function DocumentLibraryPreview(props: DocumentLibraryPreviewProp ? undefined : onShowDocumentLibraryClick} indicator={surveyFiles.length === 0 - ? + ? : undefined} > {surveyFiles.length > 0 diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.css b/src/components/view/DocumentDetailView/DocumentDetailView.css index c0d596509..590e53eee 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.css +++ b/src/components/view/DocumentDetailView/DocumentDetailView.css @@ -1,7 +1,7 @@ .mdhui-survey-answer-details { display: flex; flex-direction: column; - margin: 16px; + margin: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-container { @@ -10,42 +10,32 @@ .mdhui-survey-answer-file-preview-container { width: 100%; - height: 55vh; display: flex; flex-direction: column; align-items: center; - justify-content: center; + justify-content: space-around; border-radius: 8px; overflow: hidden; background-color: var(--mdhui-background-color-2); + padding-top: var(--mdhui-padding-sm); + padding-bottom: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-preview-content { max-width: 100%; max-height: 100%; - height: 90%; - width: 90%; -} - -.mdhui-survey-answer-file-preview-file { - background-color: white; -} - -.mdhui-survey-answer-file-image-preview { - margin-top: 16px; + height: 55vh; + width: 100%; object-fit: contain; } .mdhui-survey-answer-file-document-file-name { display: flex; justify-content: center; - padding-top: var(--mdhui-padding-sm); - margin-bottom: var(--mdhui-padding-sm); - padding-bottom: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-document-details-parent { - padding-top: 15px; + padding-top: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-document-details { @@ -53,20 +43,11 @@ padding-bottom: var(--mdhui-padding-xs); } -.mdhui-survey-answer-file-download-button { - display: flex; - flex-direction: column; - align-items: flex-end; - justify-content: flex-end; - margin-top: 15px; - margin-bottom: 10px; -} - .mdhui-survey-answer-file-delete-button { display: flex; flex-direction: column; align-items: center; justify-content: center; - margin-top: 15px; - margin-bottom: 10px; + margin-top: var(--mdhui-padding-sm); + margin-bottom: var(--mdhui-padding-sm); } \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index 223c813d7..5395947fa 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -65,6 +65,6 @@ export const FileNotFound: Story = { }; export const Live: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: '536298d2-79f4-ef11-bafe-0affe8024cad' }, + args: { ...uploadDocumentSurveyProps, surveyResultId: '005030fa-d5f9-ef11-baff-0affe8024cad' }, render: render }; \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 533c13754..92f23bea2 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -126,7 +126,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { }, [], []); return ( - + @@ -140,7 +140,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { } {documentDetail?.presignedImageUrl && {language("file-not-loaded")}} + className="mdhui-survey-answer-file-preview-content" />} {!documentDetail.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
}
{documentDetail?.fileName}
diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.css b/src/components/view/DocumentLibraryView/DocumentLibraryView.css index 2d549d03f..40b2bfc72 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.css +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.css @@ -1,10 +1,3 @@ .mdhui-document-library-view-segment-control { margin: 16px; -} - -.mdhui-document-library-view-title-div { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; } \ No newline at end of file diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index 654a37add..d24be959c 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -138,16 +138,15 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { initialize(); }, [], []); + //Getting some blinking when returning from DocumentDetailView. useMemo is not helping. const fileList = useMemo(() => buildFileList(files, selectedSegment), [files, selectedSegment]); return ( -
- {language('documents')} - {!loading && } -
+ onUploadClick()}>{language('upload')}</Button>} >{language('documents')}
{loading && } diff --git a/src/helpers/strings-de.ts b/src/helpers/strings-de.ts index 9a42f6a34..a3c48ebb9 100644 --- a/src/helpers/strings-de.ts +++ b/src/helpers/strings-de.ts @@ -537,8 +537,7 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Mit Health Connect synchronisieren", "health-connect-phr-sync-prompt": "Wähle Gesundheitsdaten zum Lesen und Schreiben in Health Connect aus", "uploaded-documents": "Hochgeladene Dokumente", - "upload-documents-subtitle": "Scanne und organisiere deine gedruckten medizinischen Unterlagen", - "upload-button": "Hochladen" + "upload-documents-subtitle": "Scanne und organisiere deine gedruckten medizinischen Unterlagen" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-en.ts b/src/helpers/strings-en.ts index 29873cfa2..bd95eaed1 100644 --- a/src/helpers/strings-en.ts +++ b/src/helpers/strings-en.ts @@ -537,8 +537,7 @@ "health-connect-phr-sync-title": "Sync with Health Connect", "health-connect-phr-sync-prompt": "Choose health records to read from and write to Health Connect", "uploaded-documents": "Uploaded Documents", - "upload-documents-subtitle": "Scan and organize your printed medical records", - "upload-button": "Upload", + "upload-documents-subtitle": "Scan and organize your printed medical records" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-es.ts b/src/helpers/strings-es.ts index 71f2740e3..48c5f31a4 100644 --- a/src/helpers/strings-es.ts +++ b/src/helpers/strings-es.ts @@ -537,8 +537,7 @@ "health-connect-phr-sync-title": "Sincronizar con Health Connect", "health-connect-phr-sync-prompt": "Elige los registros de salud para leer y escribir en Health Connect", "uploaded-documents": "Documentos Subidos", - "upload-documents-subtitle": "Escanea y organiza tus registros médicos impresos", - "upload-button": "Subir" + "upload-documents-subtitle": "Escanea y organiza tus registros médicos impresos" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-fr.ts b/src/helpers/strings-fr.ts index d90a22cb2..de64da3d4 100644 --- a/src/helpers/strings-fr.ts +++ b/src/helpers/strings-fr.ts @@ -537,8 +537,7 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Synchroniser avec Health Connect", "health-connect-phr-sync-prompt": "Choisissez les dossiers de santé à lire et à écrire avec Health Connect", "uploaded-documents": "Documents Téléversés", - "upload-documents-subtitle": "Scannez et organisez vos dossiers médicaux imprimés", - "upload-button": "Téléverser" + "upload-documents-subtitle": "Scannez et organisez vos dossiers médicaux imprimés" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-it.ts b/src/helpers/strings-it.ts index 4f38854cb..837942c88 100644 --- a/src/helpers/strings-it.ts +++ b/src/helpers/strings-it.ts @@ -537,8 +537,7 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Sincronizza con Health Connect", "health-connect-phr-sync-prompt": "Scegli i dati sanitari da leggere e scrivere con Health Connect", "uploaded-documents": "Documenti Caricati", - "upload-documents-subtitle": "Scansiona e organizza i tuoi registri medici stampati", - "upload-button": "Carica" + "upload-documents-subtitle": "Scansiona e organizza i tuoi registri medici stampati" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-nl.ts b/src/helpers/strings-nl.ts index 3097f9fdb..e5949703e 100644 --- a/src/helpers/strings-nl.ts +++ b/src/helpers/strings-nl.ts @@ -536,8 +536,7 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Synchroniseren met Health Connect", "health-connect-phr-sync-prompt": "Kies welke gezondheidsgegevens je wilt lezen en schrijven met Health Connect", "uploaded-documents": "Geüploade Documenten", - "upload-documents-subtitle": "Scan en organiseer je geprinte medische dossiers", - "upload-button": "Uploaden" + "upload-documents-subtitle": "Scan en organiseer je geprinte medische dossiers" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pl.ts b/src/helpers/strings-pl.ts index ad4acbaa3..c7cdea634 100644 --- a/src/helpers/strings-pl.ts +++ b/src/helpers/strings-pl.ts @@ -537,8 +537,7 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Synchronizuj z Health Connect", "health-connect-phr-sync-prompt": "Wybierz rekordy zdrowotne do odczytu i zapisu w Health Connect", "uploaded-documents": "Przesłane Dokumenty", - "upload-documents-subtitle": "Zeskanuj i uporządkuj swoje wydrukowane dokumenty medyczne", - "upload-button": "Prześlij" + "upload-documents-subtitle": "Zeskanuj i uporządkuj swoje wydrukowane dokumenty medyczne" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pt.ts b/src/helpers/strings-pt.ts index 8f7d1f903..45af8b7ab 100644 --- a/src/helpers/strings-pt.ts +++ b/src/helpers/strings-pt.ts @@ -537,8 +537,7 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Sincronizar com Health Connect", "health-connect-phr-sync-prompt": "Escolha os registros de saúde para ler e escrever no Health Connect", "uploaded-documents": "Documentos Enviados", - "upload-documents-subtitle": "Escaneie e organize seus registros médicos impressos", - "upload-button": "Enviar" + "upload-documents-subtitle": "Escaneie e organize seus registros médicos impressos" }; export default strings; \ No newline at end of file From 8131c9f75cab78e484cb2fbef4e2d593a56418a6 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 6 Mar 2025 11:02:25 -0500 Subject: [PATCH 40/50] 2.72.1-DocumentLibaryView.10 --- package-lock.json | 4 ++-- package.json | 2 +- src/components/view/DocumentDetailView/DocumentDetailView.css | 4 ++-- .../view/DocumentDetailView/DocumentDetailView.stories.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6dc1d6f0..73e044743 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.9", + "version": "2.72.1-DocumentLibaryView.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.9", + "version": "2.72.1-DocumentLibaryView.10", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index ba44bf972..298d6aecd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.9", + "version": "2.72.1-DocumentLibaryView.10", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.css b/src/components/view/DocumentDetailView/DocumentDetailView.css index 590e53eee..f46094405 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.css +++ b/src/components/view/DocumentDetailView/DocumentDetailView.css @@ -18,14 +18,14 @@ overflow: hidden; background-color: var(--mdhui-background-color-2); padding-top: var(--mdhui-padding-sm); - padding-bottom: var(--mdhui-padding-sm); + padding-bottom: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-preview-content { max-width: 100%; max-height: 100%; height: 55vh; - width: 100%; + width: 90vw; object-fit: contain; } diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index 5395947fa..cb7d043f2 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -65,6 +65,6 @@ export const FileNotFound: Story = { }; export const Live: Story = { - args: { ...uploadDocumentSurveyProps, surveyResultId: '005030fa-d5f9-ef11-baff-0affe8024cad' }, + args: { ...uploadDocumentSurveyProps, surveyResultId: 'c8fd5680-d4f9-ef11-baff-0affe8024cad' }, render: render }; \ No newline at end of file From 514efccb038e0f5030943aa48a8d7404c1b2abc8 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Thu, 6 Mar 2025 11:44:14 -0500 Subject: [PATCH 41/50] 2.72.1-DocumentLibaryView.11 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73e044743..3a19abb9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.10", + "version": "2.72.1-DocumentLibaryView.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.10", + "version": "2.72.1-DocumentLibaryView.11", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 298d6aecd..07357796e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.10", + "version": "2.72.1-DocumentLibaryView.11", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 28197728afc56dd7f96dc899af4faf370669fbe8 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 13:58:41 -0400 Subject: [PATCH 42/50] Improve display across viewports and with empty optional fields --- .../DocumentDetailView/DocumentDetailView.css | 52 ++++++++++++++----- .../DocumentDetailView.previewData.ts | 2 + .../DocumentDetailView.stories.tsx | 7 ++- .../DocumentDetailView/DocumentDetailView.tsx | 50 ++++++++++++------ src/helpers/query-all-survey-files.ts | 12 ++--- src/helpers/strings-de.ts | 3 +- src/helpers/strings-en.ts | 3 +- src/helpers/strings-es.ts | 3 +- src/helpers/strings-fr.ts | 3 +- src/helpers/strings-it.ts | 3 +- src/helpers/strings-nl.ts | 3 +- src/helpers/strings-pl.ts | 3 +- src/helpers/strings-pt.ts | 3 +- 13 files changed, 102 insertions(+), 45 deletions(-) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.css b/src/components/view/DocumentDetailView/DocumentDetailView.css index f46094405..20871559c 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.css +++ b/src/components/view/DocumentDetailView/DocumentDetailView.css @@ -1,7 +1,8 @@ .mdhui-survey-answer-details { + padding: var(--mdhui-padding-sm); + box-sizing: border-box; display: flex; flex-direction: column; - margin: var(--mdhui-padding-sm); } .mdhui-survey-answer-file-container { @@ -17,7 +18,7 @@ border-radius: 8px; overflow: hidden; background-color: var(--mdhui-background-color-2); - padding-top: var(--mdhui-padding-sm); + padding-top: var(--mdhui-padding-sm); padding-bottom: var(--mdhui-padding-sm); } @@ -29,25 +30,50 @@ object-fit: contain; } -.mdhui-survey-answer-file-document-file-name { +.mdhui-survey-answer-file-document-info-row-parent { + padding-top: var(--mdhui-padding-sm); display: flex; - justify-content: center; + flex-direction: column; + justify-content: space-between; + flex-wrap: wrap; } -.mdhui-survey-answer-file-document-details-parent { - padding-top: var(--mdhui-padding-sm); +@media screen and (min-width: 576px) { + .mdhui-survey-answer-file-document-info-row { + display: flex; + justify-content: space-between; + } } -.mdhui-survey-answer-file-document-details { - font-size: .88em; - padding-bottom: var(--mdhui-padding-xs); +@media screen and (max-width: 576px) { + .mdhui-survey-answer-file-document-info-row { + display: flex; + justify-content: flex-start; + flex-direction: column; + align-items: flex-start; + } } -.mdhui-survey-answer-file-delete-button { +.mdhui-survey-answer-file-document-type { + margin-top: var(--mdhui-padding-sm); display: flex; - flex-direction: column; align-items: center; - justify-content: center; +} + +.mdhui-survey-answer-file-document-type-text { + padding-left: var(--mdhui-padding-xs); +} + +.mdhui-survey-answer-file-document-notes { margin-top: var(--mdhui-padding-sm); - margin-bottom: var(--mdhui-padding-sm); +} + +.mdhui-survey-answer-file-button-row { + display: flex; + justify-content: space-between; + padding-top: var(--mdhui-padding-md); +} + +.mdhui-survey-answer-file-button-row>button:only-child { + margin-left: auto; } \ No newline at end of file diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts index a9b2d6d93..26c9753b0 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts +++ b/src/components/view/DocumentDetailView/DocumentDetailView.previewData.ts @@ -4,6 +4,8 @@ export function getPreviewData(preview: DocumentDetailViewPreviewType): Document switch (preview) { case "PreviewPdf": return previewPdfData; + case "PreviewOptionalFields": + return {...previewPdfData, type: "", notes: ""}; case "PreviewText": return previewTxtData; case "PreviewImage": diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx index cb7d043f2..a5c71e4ac 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.stories.tsx @@ -29,11 +29,16 @@ const uploadDocumentSurveyProps: DocumentDetailViewProps = { notesResultIdentifier: 'document_notes' } -export const Pdf: Story = { +export const AllFields: Story = { args: { ...uploadDocumentSurveyProps, preview: 'PreviewPdf' }, render: render }; +export const EmptyOptionalFields: Story = { + args: { ...uploadDocumentSurveyProps, preview: 'PreviewOptionalFields' }, + render: render +}; + export const Text: Story = { args: { ...uploadDocumentSurveyProps, preview: 'PreviewText' }, render: render diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index 92f23bea2..f3ae1d55e 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -6,7 +6,7 @@ import "./DocumentDetailView.css"; import { getShortDateString } from "../../../helpers/date-helpers"; import { getPreviewData } from "./DocumentDetailView.previewData"; -export type DocumentDetailViewPreviewType = "PreviewPdf" | "PreviewText" | "PreviewImage" | "PreviewUnknown" | "PreviewCsvFile" | "PreviewMp4" | "PreviewFileNotFound" | "PreviewLoading"; +export type DocumentDetailViewPreviewType = "PreviewPdf" | "PreviewOptionalFields" | "PreviewText" | "PreviewImage" | "PreviewUnknown" | "PreviewCsvFile" | "PreviewMp4" | "PreviewFileNotFound" | "PreviewLoading"; export interface DocumentDetailViewProps { preview?: DocumentDetailViewPreviewType, @@ -134,26 +134,42 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { {documentDetail &&
-
- {documentDetail?.presignedDocUrl && - - } - {documentDetail?.presignedImageUrl && + {documentDetail?.presignedImageUrl && +
{language("file-not-loaded")}} - {!documentDetail.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
} -
{documentDetail?.fileName}
-
+ className="mdhui-survey-answer-file-preview-content" /> + +
+ } + {!documentDetail?.presignedDocUrl && !documentDetail.presignedImageUrl &&
{language("file-not-loaded")}
}
-
- {documentDetail?.type} -
{`${documentDetail?.title} - ${getShortDateString(documentDetail?.date!)}`}
- {language("notes")} -
{documentDetail?.notes}
+
+
+ {documentDetail?.title} +
{documentDetail?.fileName}
+
+
+ {documentDetail?.type && +
+ {language("document-type")}: +
{documentDetail?.type}
+
+ } +
{getShortDateString(documentDetail?.date!)}
+
+ {documentDetail?.notes && +
+ {language("notes")} +
{documentDetail?.notes}
+
+ }
-
- +
+ + {documentDetail?.presignedDocUrl && + + }
} diff --git a/src/helpers/query-all-survey-files.ts b/src/helpers/query-all-survey-files.ts index 3b8788897..abc04a9a0 100644 --- a/src/helpers/query-all-survey-files.ts +++ b/src/helpers/query-all-survey-files.ts @@ -51,7 +51,7 @@ export async function queryAllSurveyFiles(props: SurveyUploadedFileQueryParamete const notes = notesResults && notesResults.answers ? notesResults.answers[0] : ""; if (!Number.isNaN(Date.parse(useDate)) && - title && fileName && type) { + title && fileName) { const useFileDate = parseISO(useDate); const newUploadedFile: SurveyUploadedFile = { surveyResultId: `${resultId}`, @@ -62,7 +62,7 @@ export async function queryAllSurveyFiles(props: SurveyUploadedFileQueryParamete notes: notes, date: useFileDate }; - + uploadedFiles.push(newUploadedFile); } }); @@ -75,9 +75,9 @@ export async function queryAllSurveyFiles(props: SurveyUploadedFileQueryParamete } let queryParameters: SurveyAnswersQuery = { - resultIdentifier : [props.fileResultIdentifier!, - props.typeResultIdentifier!, props.nameResultIdentifier!, - props.dateResultIdentifier!, props.notesResultIdentifier!] + resultIdentifier: [props.fileResultIdentifier!, + props.typeResultIdentifier!, props.nameResultIdentifier!, + props.dateResultIdentifier!, props.notesResultIdentifier!] }; if (props.uploadDocumentSurveyName) { @@ -102,7 +102,7 @@ export async function deleteSurveyResultFiles(surveyResultId: string, fileKey: s MyDataHelps.deleteFile(fileKey); }).catch((error) => { console.error('Error deleting survey results', error); - console.error('The survey must be configured to support result deletion'); + console.error('The survey must be configured to support result deletion'); }); }; diff --git a/src/helpers/strings-de.ts b/src/helpers/strings-de.ts index a3c48ebb9..e62cd6721 100644 --- a/src/helpers/strings-de.ts +++ b/src/helpers/strings-de.ts @@ -537,7 +537,8 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Mit Health Connect synchronisieren", "health-connect-phr-sync-prompt": "Wähle Gesundheitsdaten zum Lesen und Schreiben in Health Connect aus", "uploaded-documents": "Hochgeladene Dokumente", - "upload-documents-subtitle": "Scanne und organisiere deine gedruckten medizinischen Unterlagen" + "upload-documents-subtitle": "Scanne und organisiere deine gedruckten medizinischen Unterlagen", + "document-type": "Dokumenttyp" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-en.ts b/src/helpers/strings-en.ts index bd95eaed1..0b59c2a26 100644 --- a/src/helpers/strings-en.ts +++ b/src/helpers/strings-en.ts @@ -537,7 +537,8 @@ "health-connect-phr-sync-title": "Sync with Health Connect", "health-connect-phr-sync-prompt": "Choose health records to read from and write to Health Connect", "uploaded-documents": "Uploaded Documents", - "upload-documents-subtitle": "Scan and organize your printed medical records" + "upload-documents-subtitle": "Scan and organize your printed medical records", + "document-type": "Document Type" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-es.ts b/src/helpers/strings-es.ts index 48c5f31a4..c6fa8dccc 100644 --- a/src/helpers/strings-es.ts +++ b/src/helpers/strings-es.ts @@ -537,7 +537,8 @@ "health-connect-phr-sync-title": "Sincronizar con Health Connect", "health-connect-phr-sync-prompt": "Elige los registros de salud para leer y escribir en Health Connect", "uploaded-documents": "Documentos Subidos", - "upload-documents-subtitle": "Escanea y organiza tus registros médicos impresos" + "upload-documents-subtitle": "Escanea y organiza tus registros médicos impresos", + "document-type": "Tipo de documento" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-fr.ts b/src/helpers/strings-fr.ts index de64da3d4..96b453611 100644 --- a/src/helpers/strings-fr.ts +++ b/src/helpers/strings-fr.ts @@ -537,7 +537,8 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Synchroniser avec Health Connect", "health-connect-phr-sync-prompt": "Choisissez les dossiers de santé à lire et à écrire avec Health Connect", "uploaded-documents": "Documents Téléversés", - "upload-documents-subtitle": "Scannez et organisez vos dossiers médicaux imprimés" + "upload-documents-subtitle": "Scannez et organisez vos dossiers médicaux imprimés", + "document-type": "Type de document" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-it.ts b/src/helpers/strings-it.ts index 837942c88..b9cc98277 100644 --- a/src/helpers/strings-it.ts +++ b/src/helpers/strings-it.ts @@ -537,7 +537,8 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Sincronizza con Health Connect", "health-connect-phr-sync-prompt": "Scegli i dati sanitari da leggere e scrivere con Health Connect", "uploaded-documents": "Documenti Caricati", - "upload-documents-subtitle": "Scansiona e organizza i tuoi registri medici stampati" + "upload-documents-subtitle": "Scansiona e organizza i tuoi registri medici stampati", + "document-type": "Tipo di documento" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-nl.ts b/src/helpers/strings-nl.ts index e5949703e..1ffd82e2e 100644 --- a/src/helpers/strings-nl.ts +++ b/src/helpers/strings-nl.ts @@ -536,7 +536,8 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Synchroniseren met Health Connect", "health-connect-phr-sync-prompt": "Kies welke gezondheidsgegevens je wilt lezen en schrijven met Health Connect", "uploaded-documents": "Geüploade Documenten", - "upload-documents-subtitle": "Scan en organiseer je geprinte medische dossiers" + "upload-documents-subtitle": "Scan en organiseer je geprinte medische dossiers", + "document-type": "Documenttype" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pl.ts b/src/helpers/strings-pl.ts index c7cdea634..35451cde0 100644 --- a/src/helpers/strings-pl.ts +++ b/src/helpers/strings-pl.ts @@ -537,7 +537,8 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Synchronizuj z Health Connect", "health-connect-phr-sync-prompt": "Wybierz rekordy zdrowotne do odczytu i zapisu w Health Connect", "uploaded-documents": "Przesłane Dokumenty", - "upload-documents-subtitle": "Zeskanuj i uporządkuj swoje wydrukowane dokumenty medyczne" + "upload-documents-subtitle": "Zeskanuj i uporządkuj swoje wydrukowane dokumenty medyczne", + "document-type": "Typ dokumentu" }; export default strings; \ No newline at end of file diff --git a/src/helpers/strings-pt.ts b/src/helpers/strings-pt.ts index 45af8b7ab..1c1f7c1b0 100644 --- a/src/helpers/strings-pt.ts +++ b/src/helpers/strings-pt.ts @@ -537,7 +537,8 @@ let strings: { [key: string]: string } = { "health-connect-phr-sync-title": "Sincronizar com Health Connect", "health-connect-phr-sync-prompt": "Escolha os registros de saúde para ler e escrever no Health Connect", "uploaded-documents": "Documentos Enviados", - "upload-documents-subtitle": "Escaneie e organize seus registros médicos impressos" + "upload-documents-subtitle": "Escaneie e organize seus registros médicos impressos", + "document-type": "Tipo de documento" }; export default strings; \ No newline at end of file From a3793c6028b13ee29f06b36b577f57fdc361eb4b Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 14:27:13 -0400 Subject: [PATCH 43/50] Tighten up code for optional fields --- __tests__/helpers/query-all-survey-files.test.ts | 15 ++++++++++++--- src/helpers/query-all-survey-files.ts | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/__tests__/helpers/query-all-survey-files.test.ts b/__tests__/helpers/query-all-survey-files.test.ts index 2be19667b..e1d14b417 100644 --- a/__tests__/helpers/query-all-survey-files.test.ts +++ b/__tests__/helpers/query-all-survey-files.test.ts @@ -10,9 +10,9 @@ jest.mock('@careevolution/mydatahelps-js', () => { {id: "mno345", surveyResultID: "abc123", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileDate", answers: ["2025-01-01"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, {id: "pqr678", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileName", answers: ["BCBS Insurance"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, {id: "stu901", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "file", answers: ["BCBS.png"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, - {id: "vwx234", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileNotes", answers: ["From my phone"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "vwx234", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileNotes", answers: [], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, {id: "yza567", surveyResultID: "pqr6789", surveyName: "wrong-test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileType", answers: ["Insurance"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, - {id: "bcd890", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileDate", answers: ["1-2-2025"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, + {id: "bcd890", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "fileDate", answers: ["2025-02-01"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, {id: "efg123", surveyResultID: "pqr678", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2021-01-01", stepIdentifier: "step1", resultIdentifier: "result11", answers: ["answer11"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, {id: "a3c123", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2025-01-01", stepIdentifier: "step1", resultIdentifier: "fileName", answers: ["Mammography Report"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, {id: "d3f456", surveyResultID: "456abc", surveyName: "test-survey", surveyDisplayName: "Test Survey", date: "2025-01-01", stepIdentifier: "step1", resultIdentifier: "file", answers: ["TestsResults.pdf"], insertedDate: "2021-01-01", surveyID: "123456", surveyVersion: 1}, @@ -65,6 +65,14 @@ const mammographyReport : SurveyUploadedFile = { date: new Date("2024-01-01T00:00:00") //confirms use of result date when answer not on file }; +const emptyOptionalFieldsReport : SurveyUploadedFile = { + surveyResultId: "pqr678", + fileCategory: "surveyresult_pqr678", + title: "BCBS Insurance", + fileName: "BCBS.png", + date: new Date("2025-02-01T00:00:00") +}; + test("a SurveyUploadedFile is returned when all required fields are on file", async () => { const surveyFiles = await queryAllSurveyFiles({ uploadDocumentSurveyName: "test-survey", @@ -75,9 +83,10 @@ test("a SurveyUploadedFile is returned when all required fields are on file", as notesResultIdentifier: "fileNotes" }); - expect(surveyFiles).toHaveLength(2); + expect(surveyFiles).toHaveLength(3); expect(surveyFiles).toContainEqual(mammographyReport); expect(surveyFiles).toContainEqual(colonoscopyReport); + expect(surveyFiles).toContainEqual(emptyOptionalFieldsReport); }); test("should call both MyDataHelps.deleteSurveyResult and MyDataHelps.deleteFile", async () => { diff --git a/src/helpers/query-all-survey-files.ts b/src/helpers/query-all-survey-files.ts index abc04a9a0..75f4fea15 100644 --- a/src/helpers/query-all-survey-files.ts +++ b/src/helpers/query-all-survey-files.ts @@ -8,7 +8,7 @@ export interface SurveyUploadedFile { fileCategory: string, title: string, fileName: string, - type: string, + type?: string, notes?: string, date: Date } @@ -46,9 +46,9 @@ export async function queryAllSurveyFiles(props: SurveyUploadedFileQueryParamete const fileName = fileNameResults && fileNameResults.answers ? fileNameResults.answers[0] : ""; const fileNameResultID = fileNameResults && fileNameResults.surveyResultID ? `${fileNameResults.surveyResultID}` : ""; var typeResults = resultsForSubmission.find(r => r.resultIdentifier == props.typeResultIdentifier); - const type = typeResults && typeResults.answers ? typeResults.answers[0] : ""; + const type = typeResults && typeResults.answers ? typeResults.answers[0] : undefined; var notesResults = resultsForSubmission.find(r => r.resultIdentifier == props.notesResultIdentifier); - const notes = notesResults && notesResults.answers ? notesResults.answers[0] : ""; + const notes = notesResults && notesResults.answers ? notesResults.answers[0] : undefined; if (!Number.isNaN(Date.parse(useDate)) && title && fileName) { From e0a5fb531190e780a8309ec289c49774b1247b46 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 14:29:49 -0400 Subject: [PATCH 44/50] 2.72.1-DocumentLibaryView.12 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a19abb9a..29234a5f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.11", + "version": "2.72.1-DocumentLibaryView.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.11", + "version": "2.72.1-DocumentLibaryView.12", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 07357796e..911ea12e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.11", + "version": "2.72.1-DocumentLibaryView.12", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From a4bfad0d1aa1c63d45afaa253b897abb587ddcf5 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 14:46:43 -0400 Subject: [PATCH 45/50] More support for undefined type --- .../DocumentLibraryView.previewData.ts | 8 ++++++-- .../view/DocumentLibraryView/DocumentLibraryView.tsx | 11 +++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts b/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts index ee38e85d0..ca4359b77 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.previewData.ts @@ -8,11 +8,15 @@ export function getPreviewData(): SurveyUploadedFile[] { createUploadedFile("Sample Image File", "CareevolutionLogo.svg", "Images", "These are some notes for a sample image file"), createUploadedFile("Second Sample Portrait PDF", "PDF32000_2008.pdf", "Test Results", "These are some notes for a sample PDF"), createUploadedFile("Second Sample Text File", "MITLicense.MD", "Other", "These are some notes for a sample text file"), - createUploadedFile("Second Sample Image File", "CareevolutionLogo.svg", "Images", "These are some notes for a sample image file") + createUploadedFile("Second Sample Image File", "CareevolutionLogo.svg", "Images", "These are some notes for a sample image file"), + createUploadedFile("One File W Optional Fields", "CareevolutionLogo1.svg"), + createUploadedFile("Second File W Optional Fields", "CareevolutionLogo2.svg"), + createUploadedFile("Third File W Optional Fields", "CareevolutionLogo3.svg"), + createUploadedFile("Fourth File W Optional Fields", "CareevolutionLogo4.svg") ]; } -function createUploadedFile(title: string, fileName: string, type: string, notes?: string): SurveyUploadedFile { +function createUploadedFile(title: string, fileName: string, type?: string, notes?: string): SurveyUploadedFile { return { surveyResultId: "12345", fileCategory: "", diff --git a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx index d24be959c..6cab9f0a3 100644 --- a/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx +++ b/src/components/view/DocumentLibraryView/DocumentLibraryView.tsx @@ -120,13 +120,20 @@ export default function DocumentLibraryView(props: DocumentLibraryViewProps) { } else if (selectedSegment === "name") { return a.title < b.title ? -1 : 1; } else { - return a.type < b.type ? -1 : 1; + return (a.type ?? "") > (b.type ?? "") ? -1 : 1; } }); + function getFileName(title: string, type?: string) { + if (type) { + return `${title} (${type})`; + } + return title; + } + return sortedFiles.map((file: SurveyUploadedFile, index: number) => - } onClick={() => onFileClick(file)}> From 385754fb10813edceba6709345ff855d16be27c1 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 14:51:47 -0400 Subject: [PATCH 46/50] 2.72.1-DocumentLibaryView.13 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29234a5f2..9c831ab6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.12", + "version": "2.72.1-DocumentLibaryView.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.12", + "version": "2.72.1-DocumentLibaryView.13", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index 911ea12e6..ea915be5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.12", + "version": "2.72.1-DocumentLibaryView.13", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From 9c5cdf8cf36babf22c91d77fcab9fbe7d71ce758 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 15:23:57 -0400 Subject: [PATCH 47/50] Use back vs dismiss --- src/components/view/DocumentDetailView/DocumentDetailView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.tsx b/src/components/view/DocumentDetailView/DocumentDetailView.tsx index f3ae1d55e..0515f6008 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.tsx +++ b/src/components/view/DocumentDetailView/DocumentDetailView.tsx @@ -111,7 +111,7 @@ export default function DocumentDetailView(props: DocumentDetailViewProps) { setLoading(true); deleteSurveyResultFiles(documentDetail.surveyResultId, documentDetail.fileKey).then(() => { setDocumentDetail(undefined); - MyDataHelps.dismiss(); + MyDataHelps.back(); }).catch(error => { console.error('Failed to delete file:', error); }).finally(() => { From 9000851310cca82adfd7e32963475feffab76a9d Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 15:28:03 -0400 Subject: [PATCH 48/50] 2.72.1-DocumentLibaryView.14 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c831ab6f..915d3c922 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.13", + "version": "2.72.1-DocumentLibaryView.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.13", + "version": "2.72.1-DocumentLibaryView.14", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index ea915be5e..cdb7b0f09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.13", + "version": "2.72.1-DocumentLibaryView.14", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From ea5a06843cf3e4a08e3295684da2b951299f31ed Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 16:16:23 -0400 Subject: [PATCH 49/50] Long notes wrap --- src/components/view/DocumentDetailView/DocumentDetailView.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/view/DocumentDetailView/DocumentDetailView.css b/src/components/view/DocumentDetailView/DocumentDetailView.css index 20871559c..9959e5ffe 100644 --- a/src/components/view/DocumentDetailView/DocumentDetailView.css +++ b/src/components/view/DocumentDetailView/DocumentDetailView.css @@ -66,6 +66,7 @@ .mdhui-survey-answer-file-document-notes { margin-top: var(--mdhui-padding-sm); + overflow-wrap: anywhere; } .mdhui-survey-answer-file-button-row { From 644a25550a47ee189b85a664e185fe298fe86821 Mon Sep 17 00:00:00 2001 From: Renee Fromhold Date: Mon, 10 Mar 2025 16:21:41 -0400 Subject: [PATCH 50/50] 2.72.1-DocumentLibaryView.15 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 915d3c922..46894bb14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.14", + "version": "2.72.1-DocumentLibaryView.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.14", + "version": "2.72.1-DocumentLibaryView.15", "license": "MIT", "dependencies": { "@emotion/react": "11.11.3", diff --git a/package.json b/package.json index cdb7b0f09..a6d0e9222 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@careevolution/mydatahelps-ui", - "version": "2.72.1-DocumentLibaryView.14", + "version": "2.72.1-DocumentLibaryView.15", "description": "MyDataHelps UI Library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js",