Listable by ID instead of reference
This commit is contained in:
parent
02b71ed2e2
commit
275d0f5cb5
@ -1,10 +1,15 @@
|
||||
import { Listable } from '@iqser/common-ui';
|
||||
import { TypeValue } from '@redaction/red-ui-http';
|
||||
|
||||
export class TypeValueWrapper {
|
||||
export class TypeValueWrapper implements Listable {
|
||||
entries: string[] = [];
|
||||
|
||||
constructor(public typeValue: TypeValue, public label?: string, public virtual?: boolean) {}
|
||||
|
||||
get id() {
|
||||
return this.typeValue.type;
|
||||
}
|
||||
|
||||
get addToDictionaryAction() {
|
||||
return this.typeValue.addToDictionaryAction;
|
||||
}
|
||||
|
||||
@ -6,11 +6,11 @@ import { FileAttributeConfig, FileAttributesConfig, FileAttributesControllerServ
|
||||
import { Observable } from 'rxjs';
|
||||
import { map, startWith } from 'rxjs/operators';
|
||||
import { Toaster } from '@services/toaster.service';
|
||||
import { DefaultListingServices, ListingComponent, TableColumnConfig } from '@iqser/common-ui';
|
||||
import { DefaultListingServices, Listable, ListingComponent, TableColumnConfig } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
|
||||
export interface Field {
|
||||
id?: string;
|
||||
export interface Field extends Listable {
|
||||
id: string;
|
||||
csvColumn: string;
|
||||
name: string;
|
||||
type: FileAttributeConfig.TypeEnum;
|
||||
@ -225,6 +225,7 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<Fie
|
||||
const sample = this.getSample(csvColumn);
|
||||
const isNumber = sample && !isNaN(sample);
|
||||
return {
|
||||
id: btoa(csvColumn),
|
||||
csvColumn,
|
||||
name: csvColumn,
|
||||
type: isNumber ? FileAttributeConfig.TypeEnum.NUMBER : FileAttributeConfig.TypeEnum.TEXT,
|
||||
|
||||
@ -4,13 +4,13 @@ import { Colors, DictionaryControllerService } from '@redaction/red-ui-http';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { LoadingService } from '@services/loading.service';
|
||||
import { CircleButtonTypes, DefaultListingServices, ListingComponent, TableColumnConfig } from '@iqser/common-ui';
|
||||
import { CircleButtonTypes, DefaultListingServices, Listable, ListingComponent, TableColumnConfig } from '@iqser/common-ui';
|
||||
import { DefaultColorType } from '@models/default-color-key.model';
|
||||
import { defaultColorsTranslations } from '../../translations/default-colors-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { UserService } from '@services/user.service';
|
||||
|
||||
interface ListItem {
|
||||
interface ListItem extends Listable {
|
||||
readonly key: string;
|
||||
readonly value: string;
|
||||
}
|
||||
@ -72,6 +72,7 @@ export class DefaultColorsScreenComponent extends ListingComponent<ListItem> imp
|
||||
const data = await this._dictionaryControllerService.getColors(this._appStateService.activeDossierTemplateId).toPromise();
|
||||
this._colorsObj = data;
|
||||
const entities = Object.keys(data).map(key => ({
|
||||
id: key,
|
||||
key,
|
||||
value: data[key]
|
||||
}));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"OAUTH_URL": "https://red-staging.iqser.cloud/auth/realms/redaction",
|
||||
"API_URL": "https://red-staging.iqser.cloud/redaction-gateway-v1",
|
||||
"OAUTH_URL": "https://dom1.iqser.cloud/auth/realms/redaction",
|
||||
"API_URL": "https://dom1.iqser.cloud/redaction-gateway-v1",
|
||||
"OAUTH_CLIENT_ID": "redaction",
|
||||
"BACKEND_APP_VERSION": "4.4.40",
|
||||
"FRONTEND_APP_VERSION": "1.1",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user