[Monitor Dashboard | Trunk]: 1. Number Indicator form arrows on jsonpath. 2. Add warning message on logoUrl.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@60162 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2020-12-18 11:01:58 +00:00
parent 1f953e598c
commit 08cd0a90cd
2 changed files with 28 additions and 7 deletions

View File

@ -74,11 +74,11 @@ declare var UIkit;
</div>
</div>
</div>
<div class="uk-margin-remove-top uk-width-1-1">
<div *ngIf="!stakeholderFb.get('isUpload').value && !secure" class="uk-margin-remove-top uk-width-1-1">
<div class="uk-flex uk-flex-right" uk-grid>
<div class="uk-width-3-5@l uk-width-1-1 uk-text-small">
<span class="uk-text-bold">Note:</span> Prefer urls like "<span class="uk-text-bold">https://example.com/my-secure-image.png</span>" instead
of "http://example.com/my-image.png".
<div class="uk-width-3-5@l uk-width-1-1 uk-text-small uk-text-warning">
<span class="uk-text-bold">Note:</span> Prefer urls like "<span class="uk-text-bold">https://</span>example.com/my-secure-image.png"
instead of "<span class="uk-text-bold">http://</span>example.com/my-image.png".
<span class="uk-text-bold">Browsers may not load non secure content.</span>
</div>
</div>
@ -112,6 +112,7 @@ export class EditStakeholderComponent implements OnDestroy {
@Input()
public disableAlias: boolean = false;
public stakeholderFb: FormGroup;
public secure: boolean = false;
public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
public defaultStakeholdersOptions: Option[];
public defaultStakeholders: Stakeholder[];
@ -173,8 +174,28 @@ export class EditStakeholderComponent implements OnDestroy {
type: this.fb.control(this.stakeholder.type, Validators.required),
topics: this.fb.control(this.stakeholder.topics),
isUpload: this.fb.control(this.stakeholder.isUpload),
logoUrl: this.fb.control(this.stakeholder.logoUrl, StringUtils.urlValidator()),
logoUrl: this.fb.control(this.stakeholder.logoUrl),
});
if (this.stakeholder.isUpload) {
this.stakeholderFb.get('logoUrl').clearValidators();
this.stakeholderFb.get('logoUrl').updateValueAndValidity();
} else {
this.stakeholderFb.get('logoUrl').setValidators([StringUtils.urlValidator()]);
this.stakeholderFb.get('logoUrl').updateValueAndValidity();
}
this.subscriptions.push(this.stakeholderFb.get('isUpload').valueChanges.subscribe(value => {
if (value == true) {
this.stakeholderFb.get('logoUrl').clearValidators();
this.stakeholderFb.updateValueAndValidity();
} else {
this.stakeholderFb.get('logoUrl').setValidators([StringUtils.urlValidator()]);
this.stakeholderFb.updateValueAndValidity();
}
}));
this.secure = (!this.stakeholderFb.get('logoUrl').value || this.stakeholderFb.get('logoUrl').value.includes('https://'));
this.subscriptions.push(this.stakeholderFb.get('logoUrl').valueChanges.subscribe(value => {
this.secure = (!value || value.includes('https://'));
}));
this.initPhoto();
if (!isDefault) {
this.subscriptions.push(this.stakeholderFb.get('type').valueChanges.subscribe(value => {
@ -362,7 +383,7 @@ export class EditStakeholderComponent implements OnDestroy {
this.stakeholderFb.get('isUpload').setValue(false);
this.stakeholderFb.get('isUpload').markAsDirty();
this.removePhoto();
this.stakeholderFb.setControl('logoUrl', this.fb.control(null));
this.stakeholderFb.get('logoUrl').setValue(null);
if (this.stakeholder.isUpload) {
this.deleteCurrentPhoto = true;
}

View File

@ -296,7 +296,7 @@
<icon name="close"></icon>
</span>
<span class="uk-text-center uk-margin-left">
<icon name="arrow_right"></icon>
<icon *ngIf="indicator.defaultId === null || j < (getJsonPath(i).controls.length - 1)" name="arrow_right"></icon>
</span>
</div>
</div>