diff --git a/client/config/webpack.common.ts b/client/config/webpack.common.ts index 98f0dade73..ffaa95c5ca 100644 --- a/client/config/webpack.common.ts +++ b/client/config/webpack.common.ts @@ -1,5 +1,5 @@ import path from "path"; -import { Configuration, WatchIgnorePlugin } from "webpack"; +import { Configuration } from "webpack"; // import CaseSensitivePathsWebpackPlugin from "case-sensitive-paths-webpack-plugin"; import CopyPlugin from "copy-webpack-plugin"; import Dotenv from "dotenv-webpack"; @@ -181,8 +181,8 @@ const config: Configuration = { to: pathTo("../dist/manifest.json"), }, { - from: pathTo("../public/template_application_import.csv"), - to: pathTo("../dist/template_application_import.csv"), + from: pathTo("../public/templates"), + to: pathTo("../dist/templates"), }, ], }), diff --git a/client/src/app/pages/assessment-management/assessment-settings/questionnaire-template.yaml b/client/public/templates/questionnaire-template.yaml similarity index 100% rename from client/src/app/pages/assessment-management/assessment-settings/questionnaire-template.yaml rename to client/public/templates/questionnaire-template.yaml diff --git a/client/public/template_application_import.csv b/client/public/templates/template_application_import.csv similarity index 100% rename from client/public/template_application_import.csv rename to client/public/templates/template_application_import.csv diff --git a/client/src/app/pages/applications/manage-imports/manage-imports.tsx b/client/src/app/pages/applications/manage-imports/manage-imports.tsx index c93ac64f18..ed07a061cf 100644 --- a/client/src/app/pages/applications/manage-imports/manage-imports.tsx +++ b/client/src/app/pages/applications/manage-imports/manage-imports.tsx @@ -196,7 +196,7 @@ export const ManageImports: React.FC = () => { )} > diff --git a/client/src/app/pages/assessment-management/assessment-settings/assessment-settings-page.tsx b/client/src/app/pages/assessment-management/assessment-settings/assessment-settings-page.tsx index 9734e319ad..51b5000b8b 100644 --- a/client/src/app/pages/assessment-management/assessment-settings/assessment-settings-page.tsx +++ b/client/src/app/pages/assessment-management/assessment-settings/assessment-settings-page.tsx @@ -56,9 +56,6 @@ import { ExportQuestionnaireDropdownItem } from "./components/export-questionnai import dayjs from "dayjs"; import { QuestionnaireQuestionsColumn } from "./components/questionnaire-questions-column"; import { QuestionnaireThresholdsColumn } from "./components/questionnaire-thresholds-column"; -import saveAs from "file-saver"; -import { load } from "js-yaml"; -import questionnaireTemplateFile from "./questionnaire-template.yaml"; const AssessmentSettings: React.FC = () => { const { t } = useTranslation(); @@ -157,14 +154,6 @@ const AssessmentSettings: React.FC = () => { // TODO: Check RBAC access const rbacWriteAccess = true; // checkAccess(userScopes, questionnaireWriteScopes); - const downloadTemplate = () => { - const parsedContent = load(questionnaireTemplateFile); - const blob = new Blob([JSON.stringify(parsedContent, null, 2)], { - type: "application/x-yaml", - }); - saveAs(blob, "questionnaire-template.yaml"); - }; - return ( <> @@ -211,7 +200,9 @@ const AssessmentSettings: React.FC = () => { id="download-yaml-template" aria-label="Download questionnaire" variant={ButtonVariant.link} - onClick={downloadTemplate} + component="a" + download + href="/templates/questionnaire-template.yaml" > {t("dialog.title.download", { what: t("terms.YAMLTemplate"),