Pull request #324: RED-3115
Merge in RED/ui from RED-3115 to master * commit '02e14fded84b73b6079c2ed47b9cd6e9fbcce541': update configuration.initializer trim time from date refactored get valid() and removed / from input and img changed input date format changed placeholder and attributes reload
This commit is contained in:
commit
fa6106151d
@ -16,12 +16,16 @@
|
||||
class="iqser-input-group"
|
||||
>
|
||||
<label>{{ attr.label }}</label>
|
||||
<input
|
||||
|
||||
<ng-container
|
||||
*ngIf="isSpecificType(attr, dossierAttributeConfigTypes.NUMBER) || isSpecificType(attr, dossierAttributeConfigTypes.TEXT)"
|
||||
[formControlName]="attr.id"
|
||||
[name]="attr.id"
|
||||
[type]="isSpecificType(attr, dossierAttributeConfigTypes.NUMBER) ? 'number' : 'text'"
|
||||
/>
|
||||
>
|
||||
<input
|
||||
[formControlName]="attr.id"
|
||||
[name]="attr.id"
|
||||
[type]="isSpecificType(attr, dossierAttributeConfigTypes.NUMBER) ? 'number' : 'text'"
|
||||
/>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isSpecificType(attr, dossierAttributeConfigTypes.DATE)">
|
||||
<input [formControlName]="attr.id" [matDatepicker]="picker" placeholder="dd/mm/yy" />
|
||||
|
||||
@ -53,7 +53,7 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
}
|
||||
|
||||
get valid(): boolean {
|
||||
return this.form.valid;
|
||||
return !!this.form?.valid;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
@ -66,7 +66,9 @@ export class EditDossierAttributesComponent implements EditDossierSectionInterfa
|
||||
async save(): EditDossierSaveResult {
|
||||
const dossierAttributeList = this.attributes.map(attr => ({
|
||||
dossierAttributeConfigId: attr.id,
|
||||
value: this.currentAttrValue(attr),
|
||||
value: this.isSpecificType(attr, DossierAttributeConfigTypes.DATE)
|
||||
? moment(this.currentAttrValue(attr)).format('YYYY-MM-DD')
|
||||
: this.currentAttrValue(attr),
|
||||
}));
|
||||
try {
|
||||
await this._dossierAttributesService.setAttributes(this.dossier, dossierAttributeList).toPromise();
|
||||
|
||||
@ -68,12 +68,9 @@ export class UserPreferenceService extends GenericService<UserAttributes> {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
reload(): Promise<void> {
|
||||
return this.getAll<UserAttributes>()
|
||||
.toPromise()
|
||||
.then(attributes => {
|
||||
this._userAttributes = attributes ?? {};
|
||||
});
|
||||
async reload(): Promise<void> {
|
||||
const attributes = await this.getAll<UserAttributes>().toPromise();
|
||||
this._userAttributes = attributes ?? {};
|
||||
}
|
||||
|
||||
@Validate()
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { catchError, filter, mergeMapTo, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { catchError, filter, mergeMap, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { from, of, throwError } from 'rxjs';
|
||||
@ -21,9 +21,10 @@ export function configurationInitializer(
|
||||
filter(event => event.type === KeycloakEventType.OnReady),
|
||||
switchMap(() => from(keycloakService.isLoggedIn())),
|
||||
switchMap(loggedIn => (!loggedIn ? throwError('Not Logged In') : of({}))),
|
||||
mergeMapTo(generalSettingsService.getGeneralConfigurations()),
|
||||
mergeMap(() => generalSettingsService.getGeneralConfigurations()),
|
||||
tap(configuration => configService.updateDisplayName(configuration.displayName)),
|
||||
tap(() => userPreferenceService.reload().then(() => languageService.chooseAndSetInitialLanguage())),
|
||||
switchMap(() => userPreferenceService.reload()),
|
||||
tap(() => languageService.chooseAndSetInitialLanguage()),
|
||||
catchError(() => {
|
||||
title.setTitle('RedactManager');
|
||||
return of({});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user