Merge pull request 'Connect-Admin release 19th June 2023' (#2) from develop into master

Reviewed-on: #2
This commit is contained in:
Konstantinos Triantafyllou 2023-06-20 08:37:42 +02:00
commit 58688d67de
4 changed files with 38 additions and 10 deletions

View File

@ -49,7 +49,6 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
}
ngOnInit() {
this.reset();
this.loading = false;
this.subscriptions.push(this.vocabulariesService.getVocabularyByType('fos', null, properties).subscribe((fos: any[]) => {
this.fos = fos.map(element => element.id);
@ -60,6 +59,9 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
}
ngOnChanges(changes: SimpleChanges) {
if(changes.selectionCriteria){
this.reset();
}
this.calculateMaxHeight();
}
@ -86,10 +88,11 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
}
reset() {
this.selectionCriteriaForm = this.fb.group({
criteria: this.fb.array([])
});
if (this.selectionCriteria?.criteria) {
this.selectionCriteriaForm = this.fb.group({
criteria: this.fb.array([])
});
this.selectionCriteria.criteria.forEach(criterion => {
let constraintArray: UntypedFormArray = this.fb.array([]);
criterion.constraint.forEach(constraint => {

View File

@ -26,6 +26,7 @@ declare var UIkit;
class="uk-float-right uk-border-rounded uk-margin-top uk-margin-right uk-background-muted uk-button uk-button-link">
<icon name="delete" [defaultSize]="true" [flex]="true"></icon>
</a>
<div class="uk-text-small uk-margin-large-top uk-text-center" [class.uk-light]="!light">Lorem ipsum dolor sit amet...</div>
</div>
</div>
<div *ngIf="background.imageFile" class="uk-margin-top">
@ -51,7 +52,7 @@ export class BackgroundUploadComponent implements OnInit {
@Input() oldBackground;
// @Input() light:boolean;
@Input() communityId: string = "";
@Input() light:boolean; //fonts mode
public file: File;
// public photo: string | ArrayBuffer;
private maxsize: number = 2000 * 1024;

View File

@ -17,7 +17,7 @@ import {CustomizationOptions} from '../../openaireLibrary/connect/community/Cust
</div>
</div>
<div class="uk-text-warning uk-text-xsmall uk-margin-small-left" *ngIf="warningForContrast(color)">Contrast ratio may be too low.</div>
<div class="uk-text-warning uk-text-xsmall uk-margin-small-left" [class.uk-invisible]="!warningForContrast(color)">Contrast ratio may be too low.</div>
`,
styles:[
`

View File

@ -207,11 +207,35 @@
<background label="Light" [background]="draftCustomizationOptions.backgrounds.light"
[light]="true"></background>
<background label="Hero section" [background]="draftCustomizationOptions.backgrounds.form"
[light]="true"
[light]="draftCustomizationOptions.backgrounds.form.fontsDarkMode"
[oldBackground]="publishedCustomizationOptions.backgrounds.form"
[communityId]="communityId" description="The area under menu"></background>
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-large-top uk-flex uk-flex-middle">
Hero section image
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-large-top uk-flex uk-flex-middle uk-heading-divider">
Hero section
</div>
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-medium-top uk-flex uk-flex-middle">
Fonts
<a *ngIf="( publishedCustomizationOptions.backgrounds.form.fontsDarkMode != draftCustomizationOptions.backgrounds.form.fontsDarkMode )
&& draftCustomizationOptions.backgroundsIsCustom"
(click)="draftCustomizationOptions.backgrounds.form.fontsDarkMode=publishedCustomizationOptions.backgrounds.form.fontsDarkMode;" class="uk-margin-small-left uk-button-link"
uk-tooltip="title:<div class='uk-width-large'>Reset to previously saved options</div>">
<icon name="settings_backup_restore" flex="true"></icon>
</a>
</div>
<div class="uk-margin-small-top">
<span>Dark mode </span>
<span>
<mat-slide-toggle class="uk-margin-large-left"
[checked]="draftCustomizationOptions.backgrounds.form.fontsDarkMode"
(change)="draftCustomizationOptions.backgrounds.form.fontsDarkMode=!draftCustomizationOptions.backgrounds.form.fontsDarkMode;"
[attr.uk-tooltip]="'title:<div class=\'uk-width-large\'>' +
(draftCustomizationOptions.backgrounds.form.fontsDarkMode?'Change to light color mode if the hero section background is dark':'Change to dark mode if the hero section background is light')+'</div>'"
>
</mat-slide-toggle>
</span>
</div>
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-medium-top uk-flex uk-flex-middle">
Image
<a *ngIf="(formHasChanges(publishedCustomizationOptions, draftCustomizationOptions) )
&& draftCustomizationOptions.backgroundsIsCustom"
(click)="resetImageTo(publishedCustomizationOptions.backgrounds);" class="uk-margin-small-left uk-button-link"
@ -222,7 +246,7 @@
<div class="uk-margin-medium-bottom">
<background-upload label="Form" [background]="draftCustomizationOptions.backgrounds.form"
[oldBackground]="publishedCustomizationOptions.backgrounds.form"
[communityId]="communityId"></background-upload>
[communityId]="communityId" [light]="draftCustomizationOptions.backgrounds.form.fontsDarkMode" ></background-upload>
</div>
</div>
</div>