Skip to content

Commit

Permalink
[NOREF] - Added model name to success message for document add (#969)
Browse files Browse the repository at this point in the history
Added model name to success message for document add
  • Loading branch information
patrickseguraoddball authored Feb 22, 2024
1 parent 330133d commit 719c973
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/views/ModelPlan/Documents/AddDocument/documentUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useState } from 'react';
import React, { useContext, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory, useParams } from 'react-router-dom';
import { useMutation } from '@apollo/client';
Expand All @@ -24,6 +24,7 @@ import { DocumentType } from 'types/graphql-global-types';
import flattenErrors from 'utils/flattenErrors';
import { translateDocumentType } from 'utils/modelPlan';
import { DocumentUploadValidationSchema } from 'validations/documentUploadSchema';
import { ModelInfoContext } from 'views/ModelInfoWrapper';

const DocumentUpload = ({
solutionDetailsLink,
Expand All @@ -40,6 +41,8 @@ const DocumentUpload = ({
const { showMessageOnNextPage } = useMessage();
const formikRef = useRef<FormikProps<FileUploadForm>>(null);

const { modelName } = useContext(ModelInfoContext);

// State management for mutation errors
const [mutationError, setMutationError] = useState<boolean>(false);

Expand All @@ -52,7 +55,8 @@ const DocumentUpload = ({
<Alert type="success" slim className="margin-y-4" aria-live="assertive">
<span className="mandatory-fields-alert__text">
{t(message, {
documentName: fileName
documentName: fileName,
modelName
})}
</span>
</Alert>
Expand Down

0 comments on commit 719c973

Please sign in to comment.