From 14c7770ae9eea302e068392b82312a60d2739d94 Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Wed, 7 Apr 2021 19:19:22 +0300 Subject: [PATCH] User guide patch. Sorting available profiles in dmp editor. Portuguese on guide tour. --- dmp-frontend/src/app/app.component.html | 5 ++- .../available-profiles.component.ts | 5 ++- .../dataset-info/dataset-info.component.html | 2 +- .../dataset-info/dataset-info.component.ts | 20 +++++++++ .../app/ui/dmp/editor/dmp-editor.component.ts | 11 +++++ .../form-composite-title.component.scss | 2 +- .../user-guide-content.component.html | 2 +- .../user-guide-content.component.ts | 41 +++++++++++++++++-- dmp-frontend/src/assets/i18n/de.json | 4 +- dmp-frontend/src/assets/i18n/en.json | 4 +- dmp-frontend/src/assets/i18n/es.json | 4 +- dmp-frontend/src/assets/i18n/gr.json | 4 +- dmp-frontend/src/assets/i18n/pt.json | 18 ++++---- dmp-frontend/src/assets/i18n/sk.json | 4 +- dmp-frontend/src/assets/i18n/sr.json | 4 +- dmp-frontend/src/assets/i18n/tr.json | 4 +- 16 files changed, 110 insertions(+), 24 deletions(-) diff --git a/dmp-frontend/src/app/app.component.html b/dmp-frontend/src/app/app.component.html index fbe96e3b4..87b6099ed 100644 --- a/dmp-frontend/src/app/app.component.html +++ b/dmp-frontend/src/app/app.component.html @@ -25,4 +25,7 @@ - + diff --git a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts index 2e2476e77..165d7554c 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/available-profiles/available-profiles.component.ts @@ -35,7 +35,10 @@ export class AvailableProfilesComponent extends BaseComponent implements OnInit this.datasetService.getDatasetProfiles(profileRequestItem) .pipe(takeUntil(this._destroyed)) .subscribe(data => { - this.profiles = data; + + const dataArray = data; + dataArray.sort((a,b)=> (a.label as string).localeCompare(b.label)); + this.profiles = dataArray; }); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html index b46adb5fc..bd09b9352 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html @@ -14,7 +14,7 @@
{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}} - + {{formGroup.get('profiles').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index b86c77098..d8756f2fc 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -68,6 +68,17 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { } ngOnInit() { + + try{ + const profiles = this.formGroup.get('profiles').value as {id:string, label:string}[]; + profiles.sort((a,b)=>a.label.localeCompare(b.label)); + }catch{ + console.info('Could not sort profiles'); + } + + + + this.profilesAutoCompleteConfiguration = { filterFn: this.filterProfiles.bind(this), initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), @@ -237,4 +248,13 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { } }); } + onOptionSelected(){ + console.log('this option selected emited'); + try{ + const profiles = this.formGroup.get('profiles').value as {id:string, label:string}[]; + profiles.sort((a,b)=> a.label.localeCompare(b.label)); + }catch{ + console.info('Could not sort Dataset Templates') + } + } } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index e6aef200c..76dc2c6ff 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -411,11 +411,22 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC // } // else { // console.log("update ", this.formGroup); + /* if (!this.isFormValid()) { this.showValidationErrorsDialog(); this.hintErrors = true; return; } + */ + + // if(!this.formval) + + if(!this._isDMPDescriptionValid()){ + const errmess = this._buildDMPDescriptionErrorMessages(); + this.showValidationErrorsDialog(undefined, errmess); + this.hintErrors = true; + return; + } this.onSubmit(addNew, showAddDatasetDialog); // } } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss index d2962a5c9..b49bac376 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.component.scss @@ -18,6 +18,6 @@ } h6 { - text-transform: capitalize; + // text-transform: capitalize; font-weight: 400; } diff --git a/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.html b/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.html index e795bc016..7a78d1d08 100644 --- a/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.html +++ b/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.html @@ -1,6 +1,6 @@
- +
diff --git a/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.ts b/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.ts index b2f0ee14b..aa89424c3 100644 --- a/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.ts +++ b/dmp-frontend/src/app/ui/user-guide/user-guide-content/user-guide-content.component.ts @@ -53,10 +53,10 @@ export class UserGuideContentComponent extends BaseComponent implements OnInit { } else { this.guideHTMLUrl = this.sanitizer.bypassSecurityTrustResourceUrl((window.URL ? URL : webkitURL).createObjectURL(blob)); //GK: In case the app is in localhost (dev/debug build) apply the following transformation - //in order to show the user guide's images - if (this.guideHTMLUrl && this.configurationService.app.includes('localhost')) { - interval(1000).pipe(takeUntil(this._transformed)).subscribe(() => this.transform()); - } + // in order to show the user guide's images + // if (this.guideHTMLUrl && this.configurationService.app.includes('localhost')) { + // interval(1000).pipe(takeUntil(this._transformed)).subscribe(() => this.transform()); + // } } // this.guideHTML = this.sanitizer.sanitize(SecurityContext.HTML, blob); @@ -149,4 +149,37 @@ export class UserGuideContentComponent extends BaseComponent implements OnInit { element.setAttribute('path', href.slice(hashtagIndex + 1)); } + + onIFrameLoad(iframe:HTMLIFrameElement){ + + try{ + // const contentDocument = iframe.contentDocument; + // const URI = contentDocument.URL; + // const refs = contentDocument.getElementsByTagName('a'); + // const navLinks:HTMLAnchorElement[] = [];//only navigation links + // for(let i =0; ia.href = URI+a.hash); + + const images =iframe.contentWindow.document.getElementsByTagName('img'); + + for(let i=0; i< images.length; i++){ + const tempDiv = document.createElement('div'); + const currentImage = images.item(i); + tempDiv.innerHTML = currentImage.outerHTML.trim(); + currentImage.src = (tempDiv.firstChild as HTMLImageElement).src; + } + + // const elem = tempDiv.firstChild as HTMLImageElement; + // console.log('eleme', elem); + // firstimage.src = elem.src; + + }catch{ + console.warn('Could not find contentDocument'); + } + } } diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 7059422e8..776766a17 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 9e73ad88b..294ed0c56 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 74e450794..05a5d026b 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index df2c2db15..58d3fd7ee 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index c9bcbb7b7..af0477c79 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -86,7 +86,7 @@ "RDA-SPECIFICATIONS": "de acordo com as especificações da RDA", "MACHINE-ACTIONABLE": "para PGDs acionáveis por máquina", "UPLOAD-FILE": "Carregar Ficheiro", - "REPLACE-FILE": "Replace File" + "REPLACE-FILE": "Substituir Ficheiro" }, "INVITATION-DIALOG": { "HINT": "Prima vírgula ou \"Enter\" entre os autores", @@ -1114,7 +1114,7 @@ "NEW": "Novo Plano de Gestão de Dados", "EDIT": "Editar", "INTRO": "Um Plano de Gestão de Dados (PGD) permite uma maior proximidade com o local onde os seus dados são gerados, analisados e armazenados. O Argos é uma ferramenta aberta, extensível e colaborativa que disponibiliza Planos de Gestão de Dados FAIR e Abertos.", - "INTRO-TIP": "Tip: Add new datasets to describe different types of data or disciplinary data to avoid mixing information." + "INTRO-TIP": "Dica: Adicione tantos conjuntos de dados quantos os que tiver para descrever, para não gerar confusão na descrição da informação." }, "FIELDS": { "NAME": "Designação do Dataset", @@ -1155,7 +1155,7 @@ "EXTERNAL-LINK": "Forneça uma ligação URL externa" }, "HINT": { - "DESCRIPTION": "Briefly describe the context and purpose of the Dataset", + "DESCRIPTION": "Descrever brevemente o contexto e o objetivo do conjunto de dados", "TITLE": "Uma breve descrição do que o/a ", "TITLE-REST": "é sobre o seu âmbito e objetivos." }, @@ -1487,12 +1487,14 @@ "ADD-DMP-DESCRIPTION": "Adicione uma descrição ao PGD" }, "TOUR-GUIDE": { - "DMP": "This is your dashboard. You can view and edit all DMPs that you have either contributed to or created yourself.", - "START-NEW": "Create your DMP with Start new DMP.", - "IMPORT-DMP": "You can import a DMP", - "START-WIZARD": "or create new in Argos.", + "DMP": "Aqui pode visualizar e editar todos os PGDs para os quais tenha contribuído ou criado.", + "START-NEW": "Crie o seu PGD através do botão “Iniciar novo PGD”.", + "IMPORT-DMP": "Aqui pode importar um PGD pré-existente...", + "START-WIZARD": "... ou criar um novo no Argos!", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Ok, entendi!", + "LEAVE-TOUR":"Saltar a Apresentação" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 878d67c2c..4390a3fa5 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index da0777101..53132c489 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index a6728551e..77232301c 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1492,7 +1492,9 @@ "IMPORT-DMP": "You can import a DMP", "START-WIZARD": "or create new in Argos.", "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", - "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process.", + "GOT-IT":"Got it!", + "LEAVE-TOUR":"Leave Tour" } }, "USER-DIALOG": {