feat(frontend): Verbeteringen i18n en standaardleerpad bij het aanmaken
This commit is contained in:
		
							parent
							
								
									60d11e5b0d
								
							
						
					
					
						commit
						bf1a90313d
					
				
					 7 changed files with 28 additions and 13 deletions
				
			
		|  | @ -44,11 +44,11 @@ export class LearningPathController extends BaseController { | ||||||
|         return await this.get<LearningPathDTO[]>("/", { admin }); |         return await this.get<LearningPathDTO[]>("/", { admin }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async postLearningPath(learningPath: LearningPathDTO): Promise<LearningPathDTO> { |     async postLearningPath(learningPath: Partial<LearningPathDTO>): Promise<LearningPathDTO> { | ||||||
|         return await this.post<LearningPathDTO>("/", learningPath); |         return await this.post<LearningPathDTO>("/", learningPath); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async putLearningPath(learningPath: LearningPathDTO): Promise<LearningPathDTO> { |     async putLearningPath(learningPath: Partial<LearningPathDTO>): Promise<LearningPathDTO> { | ||||||
|         return await this.put<LearningPathDTO>(`/${learningPath.hruid}/${learningPath.language}`, learningPath); |         return await this.put<LearningPathDTO>(`/${learningPath.hruid}/${learningPath.language}`, learningPath); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -162,5 +162,9 @@ | ||||||
|     "ownLearningContentTitle": "Eigene Lerninhalte", |     "ownLearningContentTitle": "Eigene Lerninhalte", | ||||||
|     "ownLearningContentDescription": "Erstellen und verwalten Sie eigene Lernobjekte und Lernpfade. Nur für fortgeschrittene Nutzer.", |     "ownLearningContentDescription": "Erstellen und verwalten Sie eigene Lernobjekte und Lernpfade. Nur für fortgeschrittene Nutzer.", | ||||||
|     "learningPathNotFound": "Dieser Lernpfad konnte nicht gefunden werden.", |     "learningPathNotFound": "Dieser Lernpfad konnte nicht gefunden werden.", | ||||||
|     "emptyLearningPath": "Dieser Lernpfad enthält keine Lernobjekte." |     "emptyLearningPath": "Dieser Lernpfad enthält keine Lernobjekte.", | ||||||
|  |     "pathContainsNonExistingLearningObjects": "Mindestens eines der in diesem Pfad referenzierten Lernobjekte existiert nicht.", | ||||||
|  |     "targetAgesMandatory": "Zielalter müssen angegeben werden.", | ||||||
|  |     "hintRemoveIfUnconditionalTransition": "(entfernen, wenn dies ein bedingungsloser Übergang sein soll)", | ||||||
|  |     "hintKeywordsSeparatedBySpaces": "Schlüsselwörter durch Leerzeichen getrennt" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -162,5 +162,9 @@ | ||||||
|     "ownLearningContentTitle": "Own learning content", |     "ownLearningContentTitle": "Own learning content", | ||||||
|     "ownLearningContentDescription": "Create and administrate your own learning objects and learning paths. For advanced users only.", |     "ownLearningContentDescription": "Create and administrate your own learning objects and learning paths. For advanced users only.", | ||||||
|     "learningPathNotFound": "This learning path could not be found.", |     "learningPathNotFound": "This learning path could not be found.", | ||||||
|     "emptyLearningPath": "This learning path does not contain any learning objects." |     "emptyLearningPath": "This learning path does not contain any learning objects.", | ||||||
|  |     "pathContainsNonExistingLearningObjects": "At least one of the learning objects referenced in this path does not exist.", | ||||||
|  |     "targetAgesMandatory": "Target ages must be specified.", | ||||||
|  |     "hintRemoveIfUnconditionalTransition": "(remove this if this should be an unconditional transition)", | ||||||
|  |     "hintKeywordsSeparatedBySpaces": "Keywords separated by spaces" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -163,5 +163,9 @@ | ||||||
|     "ownLearningContentTitle": "Contenu d’apprentissage personnel", |     "ownLearningContentTitle": "Contenu d’apprentissage personnel", | ||||||
|     "ownLearningContentDescription": "Créez et gérez vos propres objets et parcours d’apprentissage. Réservé aux utilisateurs avancés.", |     "ownLearningContentDescription": "Créez et gérez vos propres objets et parcours d’apprentissage. Réservé aux utilisateurs avancés.", | ||||||
|     "learningPathNotFound": "Ce parcours d'apprentissage est introuvable.", |     "learningPathNotFound": "Ce parcours d'apprentissage est introuvable.", | ||||||
|     "emptyLearningPath": "Ce parcours d'apprentissage ne contient aucun objet d'apprentissage." |     "emptyLearningPath": "Ce parcours d'apprentissage ne contient aucun objet d'apprentissage.", | ||||||
|  |     "pathContainsNonExistingLearningObjects": "Au moins un des objets d’apprentissage référencés dans ce chemin n’existe pas.", | ||||||
|  |     "targetAgesMandatory": "Les âges cibles doivent être spécifiés.", | ||||||
|  |     "hintRemoveIfUnconditionalTransition": "(supprimer ceci s’il s’agit d’une transition inconditionnelle)", | ||||||
|  |     "hintKeywordsSeparatedBySpaces": "Mots-clés séparés par des espaces" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -162,5 +162,9 @@ | ||||||
|     "ownLearningContentTitle": "Eigen leerinhoud", |     "ownLearningContentTitle": "Eigen leerinhoud", | ||||||
|     "ownLearningContentDescription": "Maak en beheer je eigen leerobjecten en leerpads. Alleen voor gevorderde gebruikers.", |     "ownLearningContentDescription": "Maak en beheer je eigen leerobjecten en leerpads. Alleen voor gevorderde gebruikers.", | ||||||
|     "learningPathNotFound": "Dit leerpad kon niet gevonden worden.", |     "learningPathNotFound": "Dit leerpad kon niet gevonden worden.", | ||||||
|     "emptyLearningPath": "Dit leerpad bevat geen leerobjecten." |     "emptyLearningPath": "Dit leerpad bevat geen leerobjecten.", | ||||||
|  |     "pathContainsNonExistingLearningObjects": "Ten minste één van de leerobjecten in dit pad bestaat niet.", | ||||||
|  |     "targetAgesMandatory": "Doelleeftijden moeten worden opgegeven.", | ||||||
|  |     "hintRemoveIfUnconditionalTransition": "(verwijder dit voor onvoorwaardelijke overgangen)", | ||||||
|  |     "hintKeywordsSeparatedBySpaces": "Trefwoorden gescheiden door spaties" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ export function useGetAllLearningPathsByAdminQuery( | ||||||
| export function usePostLearningPathMutation(): UseMutationReturnType< | export function usePostLearningPathMutation(): UseMutationReturnType< | ||||||
|     LearningPathDTO, |     LearningPathDTO, | ||||||
|     AxiosError, |     AxiosError, | ||||||
|     { learningPath: LearningPathDTO }, |     { learningPath: Partial<LearningPathDTO> }, | ||||||
|     unknown |     unknown | ||||||
| > { | > { | ||||||
|     const queryClient = useQueryClient(); |     const queryClient = useQueryClient(); | ||||||
|  | @ -68,7 +68,7 @@ export function usePostLearningPathMutation(): UseMutationReturnType< | ||||||
| export function usePutLearningPathMutation(): UseMutationReturnType< | export function usePutLearningPathMutation(): UseMutationReturnType< | ||||||
|     LearningPathDTO, |     LearningPathDTO, | ||||||
|     AxiosError, |     AxiosError, | ||||||
|     { learningPath: LearningPathDTO }, |     { learningPath: Partial<LearningPathDTO> }, | ||||||
|     unknown |     unknown | ||||||
| > { | > { | ||||||
|     const queryClient = useQueryClient(); |     const queryClient = useQueryClient(); | ||||||
|  |  | ||||||
|  | @ -21,7 +21,7 @@ | ||||||
| 
 | 
 | ||||||
|     const { isPending, mutate, error: deleteError, isSuccess: deleteSuccess } = useDeleteLearningPathMutation(); |     const { isPending, mutate, error: deleteError, isSuccess: deleteSuccess } = useDeleteLearningPathMutation(); | ||||||
| 
 | 
 | ||||||
|     const DEFAULT_LEARNING_PATH: LearningPath = { |     const DEFAULT_LEARNING_PATH: Partial<LearningPath> = { | ||||||
|         language: "en", |         language: "en", | ||||||
|         hruid: "...", |         hruid: "...", | ||||||
|         title: "...", |         title: "...", | ||||||
|  | @ -35,7 +35,7 @@ | ||||||
|                 transitions: [ |                 transitions: [ | ||||||
|                     { |                     { | ||||||
|                         default: true, |                         default: true, | ||||||
|                         condition: "(remove if the transition should be unconditinal)", |                         condition: t("hintRemoveIfUnconditionalTransition"), | ||||||
|                         next: { |                         next: { | ||||||
|                             hruid: "...", |                             hruid: "...", | ||||||
|                             version: 1, |                             version: 1, | ||||||
|  | @ -45,14 +45,13 @@ | ||||||
|                 ], |                 ], | ||||||
|             }, |             }, | ||||||
|         ], |         ], | ||||||
|         keywords: "Keywords separated by spaces", |         keywords: t("hintKeywordsSeparatedBySpaces") | ||||||
|         target_ages: [], |  | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     const { isPending: isPostPending, error: postError, mutate: doPost } = usePostLearningPathMutation(); |     const { isPending: isPostPending, error: postError, mutate: doPost } = usePostLearningPathMutation(); | ||||||
|     const { isPending: isPutPending, error: putError, mutate: doPut } = usePutLearningPathMutation(); |     const { isPending: isPutPending, error: putError, mutate: doPut } = usePutLearningPathMutation(); | ||||||
| 
 | 
 | ||||||
|     const learningPath: Ref<LearningPath | string> = ref(DEFAULT_LEARNING_PATH); |     const learningPath: Ref<Partial<LearningPath> | string> = ref(DEFAULT_LEARNING_PATH); | ||||||
| 
 | 
 | ||||||
|     const parsedLearningPath = computed(() => |     const parsedLearningPath = computed(() => | ||||||
|         typeof learningPath.value === "string" ? (JSON.parse(learningPath.value) as LearningPath) : learningPath.value, |         typeof learningPath.value === "string" ? (JSON.parse(learningPath.value) as LearningPath) : learningPath.value, | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger