From c55c95805f69419a6600288251573fe59874c021 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Sun, 11 Feb 2024 12:05:58 -0800 Subject: [PATCH] strings --- teachertool/src/constants.ts | 2 ++ teachertool/src/state/helpers.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/teachertool/src/constants.ts b/teachertool/src/constants.ts index b225308084a4..3e9287dee58a 100644 --- a/teachertool/src/constants.ts +++ b/teachertool/src/constants.ts @@ -2,6 +2,8 @@ export namespace Strings { export const ConfirmReplaceRubric = lf("This will replace your current rubric. Continue?"); + export const UntitledProject = lf("Untitled Project"); + export const UntitledRubric = lf("Untitled Rubric"); } namespace Constants { diff --git a/teachertool/src/state/helpers.ts b/teachertool/src/state/helpers.ts index 94c58993973e..c332620da6c9 100644 --- a/teachertool/src/state/helpers.ts +++ b/teachertool/src/state/helpers.ts @@ -4,6 +4,7 @@ import { ErrorCode } from "../types/errorCode"; import { Rubric } from "../types/rubric"; import { stateAndDispatch } from "./appStateContext"; import { AppState } from "./state"; +import { Strings } from "../constants"; export function getCatalogCriteriaWithId(id: string): CatalogCriteria | undefined { const { state } = stateAndDispatch(); @@ -53,12 +54,12 @@ export function isRubricLoaded(state: AppState): boolean { export function getSafeProjectName(state: AppState): string | undefined { if (state.projectMetadata) { - return state.projectMetadata.name ?? lf("Untitled Project"); + return state.projectMetadata.name ?? Strings.UntitledProject; } } export function getSafeRubricName(state: AppState): string | undefined { - return state.rubric.name || lf("Untitled Rubric"); + return state.rubric.name || Strings.UntitledRubric; } export function getSelectableCatalogCriteria(state: AppState): CatalogCriteria[] {