mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fixed Related Dynamic Form Controls functionality after Angular 8 upgrade
This commit is contained in:
@@ -3,12 +3,11 @@ import { HttpClientModule } from '@angular/common/http';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router-store';
|
import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router-store';
|
||||||
import { META_REDUCERS, MetaReducer, StoreModule, USER_PROVIDED_META_REDUCERS } from '@ngrx/store';
|
import { MetaReducer, StoreModule, USER_PROVIDED_META_REDUCERS } from '@ngrx/store';
|
||||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
||||||
|
import { DYNAMIC_MATCHER_PROVIDERS } from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
||||||
|
|
||||||
@@ -21,7 +20,7 @@ import { AppRoutingModule } from './app-routing.module';
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
import { appEffects } from './app.effects';
|
import { appEffects } from './app.effects';
|
||||||
import { appMetaReducers, debugMetaReducers, universalMetaReducer } from './app.metareducers';
|
import { appMetaReducers, debugMetaReducers } from './app.metareducers';
|
||||||
import { appReducers, AppState } from './app.reducer';
|
import { appReducers, AppState } from './app.reducer';
|
||||||
|
|
||||||
import { CoreModule } from './core/core.module';
|
import { CoreModule } from './core/core.module';
|
||||||
@@ -97,7 +96,8 @@ const PROVIDERS = [
|
|||||||
provide: RouterStateSerializer,
|
provide: RouterStateSerializer,
|
||||||
useClass: DSpaceRouterStateSerializer
|
useClass: DSpaceRouterStateSerializer
|
||||||
},
|
},
|
||||||
ClientCookieService
|
ClientCookieService,
|
||||||
|
...DYNAMIC_MATCHER_PROVIDERS,
|
||||||
];
|
];
|
||||||
|
|
||||||
const DECLARATIONS = [
|
const DECLARATIONS = [
|
||||||
|
@@ -10,7 +10,9 @@ import {
|
|||||||
DynamicFormControlEvent,
|
DynamicFormControlEvent,
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
DynamicFormGroupModel,
|
DynamicFormGroupModel,
|
||||||
DynamicSelectModel
|
DynamicSelectModel,
|
||||||
|
MATCH_ENABLED,
|
||||||
|
OR_OPERATOR
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
|
|
||||||
import { WorkspaceitemSectionUploadFileObject } from '../../../../../core/submission/models/workspaceitem-section-upload-file.model';
|
import { WorkspaceitemSectionUploadFileObject } from '../../../../../core/submission/models/workspaceitem-section-upload-file.model';
|
||||||
@@ -206,9 +208,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges {
|
|||||||
hasGroups.push({ id: 'name', value: condition.name });
|
hasGroups.push({ id: 'name', value: condition.name });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const confStart = { relation: [{ action: 'ENABLE', connective: 'OR', when: hasStart }] };
|
const confStart = { relations: [{ match: MATCH_ENABLED, operator: OR_OPERATOR, when: hasStart }] };
|
||||||
const confEnd = { relation: [{ action: 'ENABLE', connective: 'OR', when: hasEnd }] };
|
const confEnd = { relations: [{ match: MATCH_ENABLED, operator: OR_OPERATOR, when: hasEnd }] };
|
||||||
const confGroup = { relation: [{ action: 'ENABLE', connective: 'OR', when: hasGroups }] };
|
const confGroup = { relations: [{ match: MATCH_ENABLED, operator: OR_OPERATOR, when: hasGroups }] };
|
||||||
|
|
||||||
accessConditionsArrayConfig.groupFactory = () => {
|
accessConditionsArrayConfig.groupFactory = () => {
|
||||||
const type = new DynamicSelectModel(accessConditionTypeModelConfig, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT);
|
const type = new DynamicSelectModel(accessConditionTypeModelConfig, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT);
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
DynamicDatePickerModelConfig,
|
DynamicDatePickerModelConfig,
|
||||||
DynamicFormArrayModelConfig,
|
DynamicFormArrayModelConfig,
|
||||||
|
DynamicFormControlLayout,
|
||||||
|
DynamicFormGroupModelConfig,
|
||||||
DynamicSelectModelConfig,
|
DynamicSelectModelConfig,
|
||||||
DynamicFormGroupModelConfig, DynamicFormControlLayout,
|
MATCH_ENABLED,
|
||||||
|
OR_OPERATOR,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
|
|
||||||
export const BITSTREAM_METADATA_FORM_GROUP_CONFIG: DynamicFormGroupModelConfig = {
|
export const BITSTREAM_METADATA_FORM_GROUP_CONFIG: DynamicFormGroupModelConfig = {
|
||||||
@@ -15,7 +18,7 @@ export const BITSTREAM_METADATA_FORM_GROUP_LAYOUT: DynamicFormControlLayout = {
|
|||||||
label: 'col-form-label'
|
label: 'col-form-label'
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
label: 'col-sm-3'
|
label: 'col-sm-3'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,8 +55,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG: DynamicDatePicke
|
|||||||
toggleIcon: 'far fa-calendar-alt',
|
toggleIcon: 'far fa-calendar-alt',
|
||||||
relations: [
|
relations: [
|
||||||
{
|
{
|
||||||
match: 'ENABLE',
|
match: MATCH_ENABLED,
|
||||||
operator: 'OR',
|
operator: OR_OPERATOR,
|
||||||
when: []
|
when: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -83,8 +86,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG: DynamicDatePickerM
|
|||||||
toggleIcon: 'far fa-calendar-alt',
|
toggleIcon: 'far fa-calendar-alt',
|
||||||
relations: [
|
relations: [
|
||||||
{
|
{
|
||||||
match: 'ENABLE',
|
match: MATCH_ENABLED,
|
||||||
operator: 'OR',
|
operator: OR_OPERATOR,
|
||||||
when: []
|
when: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -112,8 +115,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG: DynamicSelectModelCo
|
|||||||
options: [],
|
options: [],
|
||||||
relations: [
|
relations: [
|
||||||
{
|
{
|
||||||
match: 'ENABLE',
|
match: MATCH_ENABLED,
|
||||||
operator: 'OR',
|
operator: OR_OPERATOR,
|
||||||
when: []
|
when: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user