@@ -633,9 +655,10 @@ export default class MetadataEditorV extends Vue {
reloadExisting = false;
loadStatus = 'waiting';
checkingUuid = false;
+ loadingIntoEditor = false;
loadEditor = false;
error = false; // whether an error has occurred
- warning: 'none' | 'uuid' | 'rename' = 'none'; // used for duplicate uuid warning
+ warning: 'none' | 'uuid' | 'rename' | 'blank' = 'none'; // used for duplicate uuid warning
configLang = 'en';
currLang = 'en'; // page language
showDropdown = false;
@@ -1821,16 +1844,28 @@ export default class MetadataEditorV extends Vue {
}
checkUuid = throttle(300, (rename?: boolean): void => {
- if (rename) this.checkingUuid = true;
+ if (rename || !this.loadExisting) this.checkingUuid = true;
if (!this.loadExisting || rename) {
+ if (!rename && !this.uuid) {
+ if (!this.loadExisting) {
+ this.error = true;
+ this.warning = 'blank';
+ }
+ this.checkingUuid = false;
+ return;
+ }
// If renaming, show the loading spinner while we check whether the UUID is taken.
fetch(this.apiUrl + `/check/${rename ? this.changeUuid : this.uuid}`).then((res: Response) => {
if (res.status !== 404) {
this.warning = rename ? 'rename' : 'uuid';
+
+ if (!this.loadExisting) {
+ this.error = true;
+ }
}
- if (rename) this.checkingUuid = false;
+ if (rename || !this.loadExisting) this.checkingUuid = false;
fetch(this.apiUrl + `/retrieveMessages`)
.then((res: any) => {
@@ -1935,34 +1970,40 @@ export default class MetadataEditorV extends Vue {
* Called when 'next' button is pressed on metadata page to continue to main editor.
*/
continueToEditor(): void {
- if (!this.checkRequiredFields()) {
- return;
- }
- if (this.loadExisting) {
- if (this.configs[this.configLang] !== undefined && this.uuid === this.configFileStructure?.uuid) {
- this.loadEditor = true;
- this.saveMetadata(false);
- this.updateEditorPath();
+ this.loadingIntoEditor = true;
+
+ // Needed in order to show the loading spinner at all
+ // Although it shows, it's still frozen (since app's really just lagging until editor's in)
+ setTimeout(() => {
+ if (!this.checkRequiredFields()) {
+ return;
+ }
+ if (this.loadExisting) {
+ if (this.configs[this.configLang] !== undefined && this.uuid === this.configFileStructure?.uuid) {
+ this.loadEditor = true;
+ this.saveMetadata(false);
+ this.updateEditorPath();
+ } else {
+ Message.error(this.$t('editor.editMetadata.message.error.noConfig'));
+ }
+ } else if (!this.uuid) {
+ Message.error(this.$t('editor.warning.mustEnterUuid'));
+ this.error = true;
} else {
- Message.error(this.$t('editor.editMetadata.message.error.noConfig'));
+ // We have a new product that is going to the main editor route, so its UUID is now locked.
+ // Therefore, we also lock it in the server so that another user does not create a new product
+ // with the same UUID until the user's session is in progress.
+ this.lockStore
+ .lockStoryline(this.uuid)
+ .then(() => {
+ this.generateNewConfig();
+ })
+ .catch(() => {
+ this.error = true;
+ Message.error(this.$t('editor.editMetadata.message.error.unauthorized'));
+ });
}
- } else if (!this.uuid) {
- Message.error(this.$t('editor.warning.mustEnterUuid'));
- this.error = true;
- } else {
- // We have a new product that is going to the main editor route, so its UUID is now locked.
- // Therefore, we also lock it in the server so that another user does not create a new product
- // with the same UUID until the user's session is in progress.
- this.lockStore
- .lockStoryline(this.uuid)
- .then(() => {
- this.generateNewConfig();
- })
- .catch(() => {
- this.error = true;
- Message.error(this.$t('editor.editMetadata.message.error.unauthorized'));
- });
- }
+ }, 25);
}
/**
@@ -2161,4 +2202,8 @@ $font-list: 'Segoe UI', system-ui, ui-sans-serif, Tahoma, Geneva, Verdana, sans-
outline-color: #eab308;
}
}
+
+.edit-metadata-content {
+ padding-top: 0 !important;
+}
diff --git a/src/lang/lang.csv b/src/lang/lang.csv
index 22aa49ed3..5f4583c5d 100644
--- a/src/lang/lang.csv
+++ b/src/lang/lang.csv
@@ -97,11 +97,12 @@ editor.uuid.required,(required),1,(obligatoire),0
editor.uuid.new,New UUID,1,New UUID,0
editor.warning.mustEnterUuid,You must first enter a UUID.,1,Vous devez d'abord saisir un UUID.,0
editor.warning.retrievalFailed,"Failed to load product, no response from server.",1,"Échec du chargement du produit, aucune réponse du serveur.",0
-editor.warning.uuid,UUID already exists. Saving this will overwrite existing product.,1,L’IDUU existe déjà. Enregistrer ce produit écrasera le produit existant.,1
+editor.warning.uuid,UUID already exists. Please choose a different one.,1,L’IDUU existe déjà. Veuillez en choisir un autre.,0
editor.warning.uuidNotFound,The requested UUID '{uuid}' does not exist.,1,L'UUID '{uuid}' demandé n'existe pas,0
editor.metadata.uuidInstructions,"Please enter the UUID of an existing storylines product, then click the 'Load' button.",1,"Veuillez saisir l'UUID d'un produit de scénario existant, puis cliquez sur le bouton « Charger ».",0
editor.metadata.newUuidInstructions,"Enter a unique ID for your new storyline. One has been auto-generated for you, but you can also enter your own.",1,"Entrez un identifiant unique pour votre nouveau scénario. Un a été généré automatiquement pour vous, mais vous pouvez également saisir le vôtre.",0
editor.warning.rename,UUID already in use. Please choose a different ID.,1,UUID déjà utilisé. Veuillez choisir un autre identifiant.,0
+editor.warning.blank,UUID field cannot be blank. Please enter a unique UUID.,1,Le champ UUID ne peut pas être vide. Veuillez saisir un UUID unique.,0
editor.warning.renameFailed,Failed to rename product.,1,Échec du renommage du produit.,0
editor.changeUuid,Click here to change UUID,1,Cliquez ici pour changer,0
editor.title,Title,1,Titre,1