Skip to content

Commit

Permalink
Merge pull request #3172 from dzhw/ewolf47/issue3166/disappearingHints
Browse files Browse the repository at this point in the history
#3166: fixed disappearing for hints that dont have error messages
  • Loading branch information
ewolf47 committed Dec 5, 2022
2 parents 2ca96a8 + ef0e111 commit bf4ec70
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
md-maxlength="2000"
ng-model="$ctrl.package.dataSourceUrl" autocomplete="off">
<div class="fdz-input-hint"
ng-if="!$ctrl.currentForm['analysisDataPackagesDataSourceUrl_' + $ctrl.index].$dirty && !$ctrl.currentForm['analysisDataPackagesDataSourceUrl_' + $ctrl.index].$touched">
ng-if="$ctrl.currentForm['analysisDataPackagesDataSourceUrl_' + $ctrl.index].$viewValue == null
|| $ctrl.currentForm['analysisDataPackagesDataSourceUrl_' + $ctrl.index].$viewValue == ''">
{{ 'analysis-package-management.edit.hints.external-data-package.data-source-url' | translate}}
</div>
<div multiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
ng-model="ctrl.analysisPackage.annotations.de"
rows="4"></textarea>
<div class="fdz-input-hint"
ng-if="!analysisPackageForm.annotationsDe.$dirty && !analysisPackageForm.annotationsDe.$touched">
ng-if="ctrl.analysisPackage.annotations.de == null || ctrl.analysisPackage.annotations.de == ''">
{{'analysis-package-management.edit.hints.annotations.de' | translate}}
</div>
<div multiple
Expand All @@ -65,7 +65,7 @@
ng-model="ctrl.analysisPackage.annotations.en"
rows="4"></textarea>
<div class="fdz-input-hint"
ng-if="!analysisPackageForm.annotationsEn.$dirty && !analysisPackageForm.annotationsEn.$touched">
ng-if="ctrl.analysisPackage.annotations.en == null || ctrl.analysisPackage.annotations.en == ''">
{{'analysis-package-management.edit.hints.annotations.en' | translate}}
</div>
<div multiple
Expand Down Expand Up @@ -395,7 +395,6 @@
tags="ctrl.analysisPackage.tags"></tag-editor>
</md-card-content>
</md-card>

<url-component
current-form="analysisPackageForm"
content="ctrl.analysisPackage.additionalLinks"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<input fdz-required="!ctrl.attachmentMetadata.description.de" md-maxlength="512" ng-model="ctrl.attachmentMetadata.description.en" name="descriptionEn" lang="en" md-no-asterisk>
<div ng-if="!attachmentForm.descriptionEn.$dirty && !attachmentForm.descriptionEn.$touched" class="fdz-input-hint">{{'attachment.hint.description.en' | translate}}</div>
<div ng-messages="attachmentForm.descriptionEn.$error" multiple>
<div ng-message="fdz-required">{{'atthiuzguachment.error.description.i18n-string-not-empty' | translate}}</div>
<div ng-message="fdz-required">{{'attachment.error.description.i18n-string-not-empty' | translate}}</div>
<div ng-message="md-maxlength">{{'attachment.error.description.i18n-string-size' | translate}}</div>
</div>
</md-input-container>
Expand All @@ -121,7 +121,7 @@
<md-input-container flex="50" class="ms-flex" md-is-error="!attachmentForm.doi.$valid && (attachmentForm.doi.$dirty || attachmentForm.doi.$touched)">
<label>{{'attachment.label.doi' | translate}}</label>
<input ng-pattern="/^https:\/\/doi.org\/?([_A-Za-z0-9äöüÄÖÜß\-\/\:.]{2,}$)/" md-maxlength="512" name="doi" ng-model="ctrl.attachmentMetadata.doi">
<div class="fdz-input-hint" ng-if="!attachmentForm.doi.$dirty && !attachmentForm.doi.$touched" >
<div class="fdz-input-hint" ng-if="ctrl.attachmentMetadata.doi == null || ctrl.attachmentMetadata.doi == ''">
{{'attachment.hint.doi' | translate}}
</div>
<div multiple ng-messages="attachmentForm.doi.$error">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
autocomplete="off">
<div
class="fdz-input-hint"
ng-if="!form[$ctrl.peopleId + 'MiddleName_' + $index].$dirty && !form[$ctrl.peopleId + 'MiddleName_' + $index].$touched">
ng-if="person.middleName == null || person.middleName == ''">
{{ $ctrl.translationKeys.hints.middleName | translate}}
</div>
<div multiple ng-messages="form[$ctrl.peopleId + 'MiddleName_' + $index].$error">
Expand Down
12 changes: 10 additions & 2 deletions src/main/webapp/scripts/common/text/text-bilingual.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
rows="4"></textarea>
<div
class="fdz-input-hint"
ng-if="!$ctrl.currentForm[$ctrl.controlName + 'De_' + $ctrl.index].$dirty && !$ctrl.currentForm[$ctrl.controlName + 'De_' + $ctrl.index].$touched">
ng-if="(
(!$ctrl.notNull && ($ctrl.content.de == null || $ctrl.content.de == '')) ||
($ctrl.notNull && !$ctrl.currentForm[$ctrl.controlName + 'De_' + $ctrl.index].$dirty
&& !$ctrl.currentForm[$ctrl.controlName + 'De_' + $ctrl.index].$touched)
)">
{{$ctrl.translationKeyManagement + '.edit.hints.' + $ctrl.translationKeyPackage + '.' + $ctrl.translationKeyName + '.de' | translate}}
</div>
<div multiple
Expand Down Expand Up @@ -51,7 +55,11 @@
rows="4"></textarea>
<div
class="fdz-input-hint"
ng-if="!$ctrl.currentForm[$ctrl.controlName + 'En_' + $ctrl.index].$dirty && !$ctrl.currentForm[$ctrl.controlName + 'En_' + $ctrl.index].$touched">
ng-if="(
(!$ctrl.notNull && ($ctrl.content.en == null || $ctrl.content.en == '')) ||
($ctrl.notNull && !$ctrl.currentForm[$ctrl.controlName + 'En_' + $ctrl.index].$dirty
&& !$ctrl.currentForm[$ctrl.controlName + 'En_' + $ctrl.index].$touched)
)">
{{$ctrl.translationKeyManagement + '.edit.hints.' + $ctrl.translationKeyPackage + '.' + $ctrl.translationKeyName + '.en' | translate}}
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
rows="4"></textarea>
<div
class="fdz-input-hint"
ng-if="!$ctrl.currentForm[$ctrl.translationKeyName].$dirty && !$ctrl.currentForm[$ctrl.translationKeyName].$touched">
ng-if="$ctrl.content == null || $ctrl.content == ''">
{{$ctrl.translationKeyPackage + '-management.edit.hints.' + $ctrl.translationKeyName | translate}}
</div>
<div
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/scripts/common/url/additional-links.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
ng-model="link.displayText.de" autocomplete="off">
<div
class="fdz-input-hint"
ng-if="!$ctrl.currentForm['linkDisplayTextDe_' + $index].$dirty && !$ctrl.currentForm['linkDisplayTextDe_' + $index].$touched">
ng-if="link.displayText.de == null || link.displayText.de == ''">
{{ 'analysis-package-management.edit.hints.additional-links.display-text.de' | translate}}
</div>
<div multiple
Expand All @@ -79,7 +79,7 @@
ng-model="link.displayText.en" autocomplete="off">
<div
class="fdz-input-hint"
ng-if="!$ctrl.currentForm['linkDisplayTextEn_' + $index].$dirty && !$ctrl.currentForm['linkDisplayTextEn_' + $index].$touched">
ng-if="link.displayText.en == null || link.displayText.en == ''">
{{ 'analysis-package-management.edit.hints.additional-links.display-text.en' | translate}}
</div>
<div multiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<md-input-container flex="50" md-is-error="!conceptForm.doi.$valid && (conceptForm.doi.$dirty || conceptForm.doi.$touched)" class="ms-flex">
<label>{{'concept-management.detail.label.doi' | translate}}</label>
<input md-maxlength="512" name="doi" ng-model="ctrl.concept.doi">
<div class="fdz-input-hint" ng-if="!conceptForm.doi.$dirty && !conceptForm.doi.$touched">
<div class="fdz-input-hint" ng-if="ctrl.concept.doi == null || ctrl.concept.doi == ''">
{{'concept-management.edit.hints.doi' | translate}}
</div>
<div multiple ng-messages="conceptForm.doi.$error">
Expand Down Expand Up @@ -162,7 +162,7 @@
<md-input-container md-is-error="!conceptForm.license.$valid && (conceptForm.license.$dirty || conceptForm.license.$touched)" class="ms-flex w-100">
<label>{{'concept-management.detail.label.license-edit' | translate}}<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea md-maxlength="1048576" name="license" ng-model="ctrl.concept.license" ng-trim="true" rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!conceptForm.license.$dirty && !conceptForm.license.$touched">
<div class="fdz-input-hint" ng-if="ctrl.concept.license == null || ctrl.concept.license == ''">
{{'concept-management.edit.hints.license' | translate}}
</div>
<div multiple ng-messages="conceptForm.license.$error">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ angular.module('metadatamanagementApp').config(
}
},
'additional-links': {
'invalid-url': 'Die angegebene URL ist ungültig',
'invalid-url': 'Die angegebene URL ist ungültig (korrektes Beispiel: https://www.dzhw.eu)',
'url-size': 'Die Maximallänge der URL ist 2000 Zeichen.',
'url-not-empty': 'Die URL darf nicht leer sein.',
'display-text-size': 'Die Maximallänge des Anzeigetextes ist 512 Zeichen.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<md-not-found>
{{'search-management.filter.study-series-filter.not-found' | translate}}
</md-not-found>
<div class="fdz-input-hint" ng-if="!dataPackageForm.studySeriesDe.$dirty && !dataPackageForm.studySeriesDe.$touched">
<div class="fdz-input-hint" ng-if="ctrl.dataPackage.studySeries.de == null || ctrl.dataPackage.studySeries.de == ''">
{{'data-package-management.edit.hints.study-series.de' | translate}}
</div>
<div multiple ng-messages="dataPackageForm.studySeriesDe.$error">
Expand Down Expand Up @@ -110,7 +110,7 @@
<md-not-found>
{{'search-management.filter.study-series-filter.not-found' | translate}}
</md-not-found>
<div class="fdz-input-hint" ng-if="!dataPackageForm.studySeriesEn.$dirty && !dataPackageForm.studySeriesEn.$touched">
<div class="fdz-input-hint" ng-if="ctrl.dataPackage.studySeries.en == null || ctrl.dataPackage.studySeries.en == ''">
{{'data-package-management.edit.hints.study-series.en' | translate}}
</div>
<div multiple ng-messages="dataPackageForm.studySeriesEn.$error">
Expand Down Expand Up @@ -156,7 +156,7 @@
translate}})<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea lang="de" md-maxlength="2048" name="annotationsDe" ng-model="ctrl.dataPackage.annotations.de"
rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!dataPackageForm.annotationsDe.$dirty && !dataPackageForm.annotationsDe.$touched">
<div class="fdz-input-hint" ng-if="ctrl.dataPackage.annotations.de == null || ctrl.dataPackage.annotations.de == ''">
{{'data-package-management.edit.hints.annotations.de' | translate}}
</div>
<div class="fdz-input-hint">
Expand All @@ -180,7 +180,7 @@
translate}})<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea lang="en" md-maxlength="2048" name="annotationsEn" ng-model="ctrl.dataPackage.annotations.en"
rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!dataPackageForm.annotationsEn.$dirty && !dataPackageForm.annotationsEn.$touched">
<div class="fdz-input-hint" ng-if="ctrl.dataPackage.annotations.en == null || ctrl.dataPackage.annotations.en == ''">
{{'data-package-management.edit.hints.annotations.en' | translate}}
</div>
<div class="fdz-input-hint">
Expand Down Expand Up @@ -581,7 +581,7 @@
ng-model="link.displayText.de" autocomplete="off">
<div
class="fdz-input-hint"
ng-if="!dataPackageForm['linkDisplayTextDe_' + $index].$dirty && !dataPackageForm['linkDisplayTextDe_' + $index].$touched">
ng-if="link.displayText.de == null || link.displayText.de == ''">
{{ 'data-package-management.edit.hints.additional-links.display-text.de' | translate}}
</div>
<div multiple ng-messages="dataPackageForm['linkDisplayTextDe_' + $index].$error">
Expand All @@ -596,7 +596,7 @@
ng-model="link.displayText.en" autocomplete="off">
<div
class="fdz-input-hint"
ng-if="!dataPackageForm['linkDisplayTextEn_' + $index].$dirty && !dataPackageForm['linkDisplayTextEn_' + $index].$touched">
ng-if="link.displayText.en == null || link.displayText.en == ''">
{{ 'data-package-management.edit.hints.additional-links.display-text.en' | translate}}
</div>
<div multiple ng-messages="dataPackageForm['linkDisplayTextEn_' + $index].$error">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<md-select name="format" ng-model="ctrl.dataSet.format" ng-model-options="{trackBy: '$value.de'}">
<md-option ng-repeat="format in ctrl.formats" ng-value="format">{{format[currentLanguage]}}</md-option>
</md-select>
<div class="fdz-input-hint" ng-if="!dataSetForm.format.$dirty && !dataSetForm.format.$touched">
<div class="fdz-input-hint" ng-if="ctrl.dataSet.format == null || ctrl.dataSet.format == ''">
{{'data-set-management.edit.hints.format' | translate}}
</div>
<div multiple ng-messages="dataSetForm.format.$error">
Expand Down Expand Up @@ -113,7 +113,7 @@
<label>{{'data-set-management.detail.label.annotations' | translate}} ({{'global.in-german' |
translate}})<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea lang="de" md-maxlength="2048" md-no-asterisk name="annotationsDe" ng-model="ctrl.dataSet.annotations.de" rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!dataSetForm.annotationsDe.$dirty && !dataSetForm.annotationsDe.$touched">{{'data-set-management.edit.hints.annotations.de' | translate}}
<div class="fdz-input-hint" ng-if="ctrl.dataSet.annotations.de == null || ctrl.dataSet.annotations.de == ''">{{'data-set-management.edit.hints.annotations.de' | translate}}
</div>
<div multiple ng-messages="dataSetForm.annotationsDe.$error">
<div ng-message="md-maxlength">{{'data-set-management.error.data-set.annotations.i18n-string-size' |
Expand All @@ -125,7 +125,7 @@
<label>{{'data-set-management.detail.label.annotations' | translate}} ({{'global.in-english' |
translate}})<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea lang="en" md-maxlength="2048" md-no-asterisk name="annotationsEn" ng-model="ctrl.dataSet.annotations.en" rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!dataSetForm.annotationsEn.$dirty && !dataSetForm.annotationsEn.$touched">{{'data-set-management.edit.hints.annotations.en' | translate}}
<div class="fdz-input-hint" ng-if="ctrl.dataSet.annotations.en == null || ctrl.dataSet.annotations.en == ''">{{'data-set-management.edit.hints.annotations.en' | translate}}
</div>
<div multiple ng-messages="dataSetForm.annotationsEn.$error">
<div ng-message="md-maxlength">{{'data-set-management.error.data-set.annotations.i18n-string-size' |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<label>{{'instrument-management.detail.label.subtitle' | translate}} ({{'global.in-german' |
translate}})</label>
<input lang="de" md-maxlength="2048" md-no-asterisk name="subtitleDe" ng-model="ctrl.instrument.subtitle.de">
<div class="fdz-input-hint" ng-if="!instrumentForm.subtitleDe.$dirty && !instrumentForm.subtitleDe.$touched">{{'instrument-management.edit.hints.subtitle.de' | translate}}
<div class="fdz-input-hint" ng-if="ctrl.instrument.subtitle.de == null || ctrl.instrument.subtitle.de == ''">{{'instrument-management.edit.hints.subtitle.de' | translate}}
</div>
<div multiple ng-messages="instrumentForm.subtitleDe.$error">
<div ng-message="md-maxlength">{{'instrument-management.error.instrument.subtitle.i18n-string-size' |
Expand All @@ -98,7 +98,7 @@
<label>{{'instrument-management.detail.label.subtitle' | translate}} ({{'global.in-english' |
translate}})</label>
<input lang="en" md-maxlength="2048" md-no-asterisk name="subtitleEn" ng-model="ctrl.instrument.subtitle.en">
<div class="fdz-input-hint" ng-if="!instrumentForm.subtitleEn.$dirty && !instrumentForm.subtitleEn.$touched">{{'instrument-management.edit.hints.subtitle.en' | translate}}
<div class="fdz-input-hint" ng-if="ctrl.instrument.subtitle.en == null || ctrl.instrument.subtitle.en == ''">{{'instrument-management.edit.hints.subtitle.en' | translate}}
</div>
<div multiple ng-messages="instrumentForm.subtitleEn.$error">
<div ng-message="md-maxlength">{{'instrument-management.error.instrument.subtitle.i18n-string-size' |
Expand Down Expand Up @@ -159,7 +159,7 @@
<label>{{'instrument-management.detail.label.annotations' | translate}} ({{'global.in-german' |
translate}})<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea lang="de" md-maxlength="2048" md-no-asterisk name="annotationsDe" ng-model="ctrl.instrument.annotations.de" rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!instrumentForm.annotationsDe.$dirty && !instrumentForm.annotationsDe.$touched">{{'instrument-management.edit.hints.annotations.de' | translate}}
<div class="fdz-input-hint" ng-if="ctrl.instrument.annotations.de == null || ctrl.instrument.annotations.de == ''">{{'instrument-management.edit.hints.annotations.de' | translate}}
</div>
<div multiple ng-messages="instrumentForm.annotationsDe.$error">
<div ng-message="md-maxlength">{{'instrument-management.error.instrument.annotations.i18n-string-size' |
Expand All @@ -171,7 +171,7 @@
<label>{{'instrument-management.detail.label.annotations' | translate}} ({{'global.in-english' |
translate}})<md-icon md-svg-src="assets/images/icons/markdown.svg"></md-icon></label>
<textarea lang="en" md-maxlength="2048" md-no-asterisk name="annotationsEn" ng-model="ctrl.instrument.annotations.en" rows="4"></textarea>
<div class="fdz-input-hint" ng-if="!instrumentForm.annotationsEn.$dirty && !instrumentForm.annotationsEn.$touched">{{'instrument-management.edit.hints.annotations.en' | translate}}
<div class="fdz-input-hint" ng-if="ctrl.instrument.annotations.en == null || ctrl.instrument.annotations.en == ''">{{'instrument-management.edit.hints.annotations.en' | translate}}
</div>
<div multiple ng-messages="instrumentForm.annotationsEn.$error">
<div ng-message="md-maxlength">{{'instrument-management.error.instrument.annotations.i18n-string-size' |
Expand Down

0 comments on commit bf4ec70

Please sign in to comment.