mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fix wrong visualization of bitstream access condition form within submission form
This commit is contained in:
@@ -1519,83 +1519,87 @@ export const mockFileFormData = {
|
||||
},
|
||||
accessConditions: [
|
||||
{
|
||||
name: [
|
||||
{
|
||||
value: 'openaccess',
|
||||
language: null,
|
||||
authority: null,
|
||||
display: 'openaccess',
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
}
|
||||
,
|
||||
accessConditionGroup: {
|
||||
name: [
|
||||
{
|
||||
value: 'openaccess',
|
||||
language: null,
|
||||
authority: null,
|
||||
display: 'openaccess',
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{
|
||||
value: 'lease',
|
||||
language: null,
|
||||
authority: null,
|
||||
display: 'lease',
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
endDate: [
|
||||
{
|
||||
value: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
language: null,
|
||||
authority: null,
|
||||
display: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
}
|
||||
,
|
||||
accessConditionGroup:{
|
||||
name: [
|
||||
{
|
||||
value: 'lease',
|
||||
language: null,
|
||||
authority: null,
|
||||
display: 'lease',
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
endDate: [
|
||||
{
|
||||
value: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
language: null,
|
||||
authority: null,
|
||||
display: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{
|
||||
value: 'embargo',
|
||||
language: null,
|
||||
authority: null,
|
||||
display: 'lease',
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
startDate: [
|
||||
{
|
||||
value: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
language: null,
|
||||
authority: null,
|
||||
display: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
accessConditionGroup: {
|
||||
name: [
|
||||
{
|
||||
value: 'embargo',
|
||||
language: null,
|
||||
authority: null,
|
||||
display: 'lease',
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
startDate: [
|
||||
{
|
||||
value: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
language: null,
|
||||
authority: null,
|
||||
display: {
|
||||
year: 2019,
|
||||
month: 1,
|
||||
day: 16
|
||||
},
|
||||
confidence: -1,
|
||||
place: 0,
|
||||
otherInformation: null
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@@ -0,0 +1,6 @@
|
||||
|
||||
::ng-deep .access-condition-group {
|
||||
position: relative;
|
||||
top: -2.3rem;
|
||||
margin-bottom: -2.3rem;
|
||||
}
|
@@ -18,6 +18,8 @@ import {
|
||||
import { WorkspaceitemSectionUploadFileObject } from '../../../../../core/submission/models/workspaceitem-section-upload-file.model';
|
||||
import { FormBuilderService } from '../../../../../shared/form/builder/form-builder.service';
|
||||
import {
|
||||
BITSTREAM_ACCESS_CONDITION_GROUP_CONFIG,
|
||||
BITSTREAM_ACCESS_CONDITION_GROUP_LAYOUT,
|
||||
BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_CONFIG,
|
||||
BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_LAYOUT,
|
||||
BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG,
|
||||
@@ -43,6 +45,7 @@ import { FormComponent } from '../../../../../shared/form/form.component';
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-submission-section-upload-file-edit',
|
||||
styleUrls: ['./section-upload-file-edit.component.scss'],
|
||||
templateUrl: './section-upload-file-edit.component.html',
|
||||
})
|
||||
export class SubmissionSectionUploadFileEditComponent implements OnChanges {
|
||||
@@ -209,8 +212,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges {
|
||||
|
||||
const startDate = new DynamicDatePickerModel(startDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_LAYOUT);
|
||||
const endDate = new DynamicDatePickerModel(endDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_LAYOUT);
|
||||
|
||||
return [type, startDate, endDate];
|
||||
const accessConditionGroupConfig = Object.assign({}, BITSTREAM_ACCESS_CONDITION_GROUP_CONFIG);
|
||||
accessConditionGroupConfig.group = [type, startDate, endDate];
|
||||
return [new DynamicFormGroupModel(accessConditionGroupConfig, BITSTREAM_ACCESS_CONDITION_GROUP_LAYOUT)];
|
||||
};
|
||||
|
||||
// Number of access conditions blocks in form
|
||||
|
@@ -15,12 +15,24 @@ export const BITSTREAM_METADATA_FORM_GROUP_CONFIG: DynamicFormGroupModelConfig =
|
||||
export const BITSTREAM_METADATA_FORM_GROUP_LAYOUT: DynamicFormControlLayout = {
|
||||
element: {
|
||||
container: 'form-group',
|
||||
label: 'col-form-label'
|
||||
label: 'col-form-label'
|
||||
},
|
||||
grid: {
|
||||
label: 'col-sm-3'
|
||||
}
|
||||
};
|
||||
export const BITSTREAM_ACCESS_CONDITION_GROUP_CONFIG: DynamicFormGroupModelConfig = {
|
||||
id: 'accessConditionGroup',
|
||||
group: []
|
||||
};
|
||||
|
||||
export const BITSTREAM_ACCESS_CONDITION_GROUP_LAYOUT: DynamicFormControlLayout = {
|
||||
element: {
|
||||
host: 'form-group flex-fill access-condition-group',
|
||||
container: 'pl-1 pr-1',
|
||||
control: 'form-row '
|
||||
}
|
||||
};
|
||||
|
||||
export const BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_CONFIG: DynamicFormArrayModelConfig = {
|
||||
id: 'accessConditions',
|
||||
@@ -28,7 +40,7 @@ export const BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_CONFIG: DynamicFormArrayMode
|
||||
};
|
||||
export const BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_LAYOUT: DynamicFormControlLayout = {
|
||||
grid: {
|
||||
group: 'form-row'
|
||||
group: 'form-row pt-4',
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,11 +51,8 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_TYPE_CONFIG: DynamicSelectModelConf
|
||||
};
|
||||
export const BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT: DynamicFormControlLayout = {
|
||||
element: {
|
||||
container: 'p-0',
|
||||
label: 'col-form-label'
|
||||
},
|
||||
grid: {
|
||||
host: 'col-md-10'
|
||||
host: 'col-12',
|
||||
label: 'col-form-label name-label'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -70,11 +79,10 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG: DynamicDatePicke
|
||||
};
|
||||
export const BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_LAYOUT: DynamicFormControlLayout = {
|
||||
element: {
|
||||
container: 'p-0',
|
||||
label: 'col-form-label'
|
||||
},
|
||||
grid: {
|
||||
host: 'col-md-4'
|
||||
host: 'col-6'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -101,10 +109,9 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG: DynamicDatePickerM
|
||||
};
|
||||
export const BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_LAYOUT: DynamicFormControlLayout = {
|
||||
element: {
|
||||
container: 'p-0',
|
||||
label: 'col-form-label'
|
||||
},
|
||||
grid: {
|
||||
host: 'col-md-4'
|
||||
host: 'col-6'
|
||||
}
|
||||
};
|
||||
|
@@ -255,6 +255,7 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit {
|
||||
});
|
||||
const accessConditionsToSave = [];
|
||||
formData.accessConditions
|
||||
.map((accessConditions) => accessConditions.accessConditionGroup)
|
||||
.filter((accessCondition) => isNotEmpty(accessCondition))
|
||||
.forEach((accessCondition) => {
|
||||
let accessConditionOpt;
|
||||
|
Reference in New Issue
Block a user