mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +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 { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
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 { DYNAMIC_MATCHER_PROVIDERS } from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
||||
|
||||
@@ -21,7 +20,7 @@ import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
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 { CoreModule } from './core/core.module';
|
||||
@@ -97,7 +96,8 @@ const PROVIDERS = [
|
||||
provide: RouterStateSerializer,
|
||||
useClass: DSpaceRouterStateSerializer
|
||||
},
|
||||
ClientCookieService
|
||||
ClientCookieService,
|
||||
...DYNAMIC_MATCHER_PROVIDERS,
|
||||
];
|
||||
|
||||
const DECLARATIONS = [
|
||||
|
@@ -10,7 +10,9 @@ import {
|
||||
DynamicFormControlEvent,
|
||||
DynamicFormControlModel,
|
||||
DynamicFormGroupModel,
|
||||
DynamicSelectModel
|
||||
DynamicSelectModel,
|
||||
MATCH_ENABLED,
|
||||
OR_OPERATOR
|
||||
} from '@ng-dynamic-forms/core';
|
||||
|
||||
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 });
|
||||
}
|
||||
});
|
||||
const confStart = { relation: [{ action: 'ENABLE', connective: 'OR', when: hasStart }] };
|
||||
const confEnd = { relation: [{ action: 'ENABLE', connective: 'OR', when: hasEnd }] };
|
||||
const confGroup = { relation: [{ action: 'ENABLE', connective: 'OR', when: hasGroups }] };
|
||||
const confStart = { relations: [{ match: MATCH_ENABLED, operator: OR_OPERATOR, when: hasStart }] };
|
||||
const confEnd = { relations: [{ match: MATCH_ENABLED, operator: OR_OPERATOR, when: hasEnd }] };
|
||||
const confGroup = { relations: [{ match: MATCH_ENABLED, operator: OR_OPERATOR, when: hasGroups }] };
|
||||
|
||||
accessConditionsArrayConfig.groupFactory = () => {
|
||||
const type = new DynamicSelectModel(accessConditionTypeModelConfig, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT);
|
||||
|
@@ -1,8 +1,11 @@
|
||||
import {
|
||||
DynamicDatePickerModelConfig,
|
||||
DynamicFormArrayModelConfig,
|
||||
DynamicFormControlLayout,
|
||||
DynamicFormGroupModelConfig,
|
||||
DynamicSelectModelConfig,
|
||||
DynamicFormGroupModelConfig, DynamicFormControlLayout,
|
||||
MATCH_ENABLED,
|
||||
OR_OPERATOR,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
|
||||
export const BITSTREAM_METADATA_FORM_GROUP_CONFIG: DynamicFormGroupModelConfig = {
|
||||
@@ -52,8 +55,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG: DynamicDatePicke
|
||||
toggleIcon: 'far fa-calendar-alt',
|
||||
relations: [
|
||||
{
|
||||
match: 'ENABLE',
|
||||
operator: 'OR',
|
||||
match: MATCH_ENABLED,
|
||||
operator: OR_OPERATOR,
|
||||
when: []
|
||||
}
|
||||
],
|
||||
@@ -83,8 +86,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG: DynamicDatePickerM
|
||||
toggleIcon: 'far fa-calendar-alt',
|
||||
relations: [
|
||||
{
|
||||
match: 'ENABLE',
|
||||
operator: 'OR',
|
||||
match: MATCH_ENABLED,
|
||||
operator: OR_OPERATOR,
|
||||
when: []
|
||||
}
|
||||
],
|
||||
@@ -112,8 +115,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG: DynamicSelectModelCo
|
||||
options: [],
|
||||
relations: [
|
||||
{
|
||||
match: 'ENABLE',
|
||||
operator: 'OR',
|
||||
match: MATCH_ENABLED,
|
||||
operator: OR_OPERATOR,
|
||||
when: []
|
||||
}
|
||||
],
|
||||
|
Reference in New Issue
Block a user