Ajout des configurations

This commit is contained in:
FyloZ 2021-05-28 22:09:03 -04:00
parent 1b7fbe335a
commit 05986a0a31
2 changed files with 8 additions and 3 deletions

View File

@ -18,6 +18,7 @@ import {ActivatedRoute, Router} from '@angular/router'
import {formatDateTime, readFile} from '../shared/utils/utils'
import {FormControl, Validators} from '@angular/forms'
import {ConfirmBoxComponent} from '../shared/components/confirm-box/confirm-box.component'
import {environment} from '../../../environments/environment'
@Directive({
selector: 'cre-config-label'
@ -145,6 +146,10 @@ export class CreImageConfig extends CreConfig {
updateImage(file: File): any {
readFile(file, (content) => this.updatedImage = content)
}
get imageUrl(): string {
return `${environment.apiUrl}/file?path=${this.configuration.content}`
}
}
@Component({
@ -153,8 +158,8 @@ export class CreImageConfig extends CreConfig {
})
export class CreBoolConfig extends CreConfig {
setConfig(config: Config) {
super.setConfig(config);
this.config.control.setValue(config.content === "true")
super.setConfig(config)
this.config.control.setValue(config.content === 'true')
}
}

View File

@ -17,7 +17,7 @@
<div class="image-wrapper d-flex flex-column justify-content-end">
<div>
<img
[src]="updatedImage ? updatedImage : configuration.content"
[src]="updatedImage ? updatedImage : imageUrl"
[attr.width]="previewWidth ? previewWidth : null"
class="mat-elevation-z3"/>
</div>