order fields and sections by ordinal on dmp-editor blueprint step
This commit is contained in:
parent
2b1bc2a5ce
commit
8e899db021
|
@ -195,6 +195,12 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
||||||
|
|
||||||
prepareForm(data: Dmp) {
|
prepareForm(data: Dmp) {
|
||||||
try {
|
try {
|
||||||
|
if (data?.blueprint?.definition?.sections != null) {
|
||||||
|
data.blueprint.definition.sections = data.blueprint.definition.sections.sort((s1,s2) => s1.ordinal-s2.ordinal);
|
||||||
|
for (let i=0; i<data.blueprint.definition.sections.length; i++){
|
||||||
|
data.blueprint.definition.sections[i].fields = data.blueprint.definition.sections[i]?.fields?.sort((f1,f2) => f1.ordinal-f2.ordinal);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.editorModel = data ? new DmpEditorModel().fromModel(data) : new DmpEditorModel();
|
this.editorModel = data ? new DmpEditorModel().fromModel(data) : new DmpEditorModel();
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.descriptions) {
|
if (data.descriptions) {
|
||||||
|
|
Loading…
Reference in New Issue