mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
impr: Migliorato campo relationship
This commit is contained in:
@@ -510,10 +510,10 @@ export class RecordsPage extends Page {
|
|||||||
|
|
||||||
const select = section.fields[field.id] as SelectT;
|
const select = section.fields[field.id] as SelectT;
|
||||||
let {options} = select;
|
let {options} = select;
|
||||||
const {model, labelAttribute} = select;
|
const {relationship} = select;
|
||||||
|
|
||||||
if (model && labelAttribute) {
|
if (Array.isArray(relationship) && relationship.length === 2) {
|
||||||
options = this.getModelSelectOptions(model, labelAttribute);
|
options = this.getModelSelectOptions(relationship[0], relationship[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options instanceof Promise) {
|
if (options instanceof Promise) {
|
||||||
|
@@ -87,6 +87,5 @@ export type SelectT = FieldT & {
|
|||||||
items?: ListItemBase[]
|
items?: ListItemBase[]
|
||||||
index?: number
|
index?: number
|
||||||
options?: SelectOptionsT | Promise<SelectOptionsT>,
|
options?: SelectOptionsT | Promise<SelectOptionsT>,
|
||||||
model?: typeof Model,
|
relationship?: [typeof Model, string],
|
||||||
labelAttribute?: string
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user