diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss index 80adde4ecca..e69de29bb2d 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss @@ -1,12 +0,0 @@ -:host { - ::ng-deep { - .switch { - position: absolute; - top: calc(var(--bs-spacer) * 2.5); - } - } -} -:host ::ng-deep ds-dynamic-form-control-container > div > label { - margin-top: 1.75rem; -} - diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index b77d2151a9b..7aad6df2fb2 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -2,14 +2,35 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnIni import { Bitstream } from '../../core/shared/bitstream.model'; import { ActivatedRoute, Router } from '@angular/router'; import { filter, map, switchMap, tap } from 'rxjs/operators'; -import { combineLatest, combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs'; -import { DynamicFormControlModel, DynamicFormGroupModel, DynamicFormLayout, DynamicFormService, DynamicInputModel, DynamicSelectModel } from '@ng-dynamic-forms/core'; +import { + combineLatest, + combineLatest as observableCombineLatest, + Observable, + of as observableOf, + Subscription +} from 'rxjs'; +import { + DynamicFormControlModel, + DynamicFormGroupModel, + DynamicFormLayout, + DynamicFormService, + DynamicInputModel, + DynamicSelectModel +} from '@ng-dynamic-forms/core'; import { UntypedFormGroup } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; -import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; +import { + DynamicCustomSwitchModel +} from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; import cloneDeep from 'lodash/cloneDeep'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; -import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, getFirstSucceededRemoteData, getFirstSucceededRemoteDataPayload, getRemoteDataPayload } from '../../core/shared/operators'; +import { + getAllSucceededRemoteDataPayload, + getFirstCompletedRemoteData, + getFirstSucceededRemoteData, + getFirstSucceededRemoteDataPayload, + getRemoteDataPayload +} from '../../core/shared/operators'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { BitstreamFormatDataService } from '../../core/data/bitstream-format-data.service'; import { BitstreamFormat } from '../../core/shared/bitstream-format.model'; @@ -245,7 +266,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { /** * All input models in a simple array for easier iterations */ - inputModels = [this.fileNameModel, this.primaryBitstreamModel, this.descriptionModel, this.selectedFormatModel, + inputModels = [this.primaryBitstreamModel, this.fileNameModel, this.descriptionModel, this.selectedFormatModel, this.newFormatModel]; /** @@ -256,8 +277,8 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { new DynamicFormGroupModel({ id: 'fileNamePrimaryContainer', group: [ - this.fileNameModel, - this.primaryBitstreamModel + this.primaryBitstreamModel, + this.fileNameModel ] }, { grid: { @@ -295,7 +316,10 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { }, primaryBitstream: { grid: { - host: 'col col-sm-4 d-inline-block switch border-0' + container: 'col-12' + }, + element: { + container: 'text-right' } }, description: { diff --git a/src/app/core/data/bitstream-data.service.spec.ts b/src/app/core/data/bitstream-data.service.spec.ts index 89178f8dd21..ccdff75fdb9 100644 --- a/src/app/core/data/bitstream-data.service.spec.ts +++ b/src/app/core/data/bitstream-data.service.spec.ts @@ -21,6 +21,11 @@ import { NotificationsService } from '../../shared/notifications/notifications.s import objectContaining = jasmine.objectContaining; import { RemoteData } from './remote-data'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; +import { BundleDataService } from './bundle-data.service'; +import { ItemMock } from 'src/app/shared/mocks/item.mock'; +import { createFailedRemoteDataObject, createSuccessfulRemoteDataObject } from 'src/app/shared/remote-data.utils'; +import { Bundle } from '../shared/bundle.model'; +import { cold } from 'jasmine-marbles'; describe('BitstreamDataService', () => { let service: BitstreamDataService; @@ -29,6 +34,7 @@ describe('BitstreamDataService', () => { let halService: HALEndpointService; let bitstreamFormatService: BitstreamFormatDataService; let rdbService: RemoteDataBuildService; + let bundleDataService: BundleDataService; const bitstreamFormatHref = 'rest-api/bitstreamformats'; const bitstream1 = Object.assign(new Bitstream(), { @@ -62,6 +68,7 @@ describe('BitstreamDataService', () => { bitstreamFormatService = jasmine.createSpyObj('bistreamFormatService', { getBrowseEndpoint: observableOf(bitstreamFormatHref) }); + rdbService = getMockRemoteDataBuildService(); TestBed.configureTestingModule({ @@ -76,6 +83,7 @@ describe('BitstreamDataService', () => { ], }); service = TestBed.inject(BitstreamDataService); + bundleDataService = TestBed.inject(BundleDataService); }); describe('composition', () => { @@ -118,6 +126,32 @@ describe('BitstreamDataService', () => { expect(service.invalidateByHref).toHaveBeenCalledWith('fake-bitstream1-self'); }); + describe('findPrimaryBitstreamByItemAndName', () => { + it('should return primary bitstream', () => { + const exprected$ = cold('(a|)', { a: bitstream1} ); + const bundle = Object.assign(new Bundle(), { + primaryBitstream: observableOf(createSuccessfulRemoteDataObject(bitstream1)), + }); + spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createSuccessfulRemoteDataObject(bundle))); + expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(exprected$); + }); + + it('should return null if primary bitstream has not be succeeded ', () => { + const exprected$ = cold('(a|)', { a: null} ); + const bundle = Object.assign(new Bundle(), { + primaryBitstream: observableOf(createFailedRemoteDataObject()), + }); + spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createSuccessfulRemoteDataObject(bundle))); + expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(exprected$); + }); + + it('should return EMPTY if nothing where found', () => { + const exprected$ = cold('(|)', {} ); + spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createFailedRemoteDataObject())); + expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(exprected$); + }); + }); + it('should be able to delete multiple bitstreams', () => { service.removeMultiple([bitstream1, bitstream2]); diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index bb4ec281665..97949ffa25c 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -1,9 +1,9 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { combineLatest as observableCombineLatest, Observable } from 'rxjs'; +import { combineLatest as observableCombineLatest, Observable, EMPTY } from 'rxjs'; import { find, map, switchMap, take } from 'rxjs/operators'; import { hasValue } from '../../shared/empty.util'; -import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; +import { FollowLinkConfig, followLink } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { Bitstream } from '../shared/bitstream.model'; @@ -34,6 +34,7 @@ import { NoContent } from '../shared/NoContent.model'; import { IdentifiableDataService } from './base/identifiable-data.service'; import { dataService } from './base/data-service.decorator'; import { Operation, RemoveOperation } from 'fast-json-patch'; +import { getFirstCompletedRemoteData } from '../shared/operators'; /** * A service to retrieve {@link Bitstream}s from the REST API @@ -201,6 +202,37 @@ export class BitstreamDataService extends IdentifiableDataService imp return this.searchData.getSearchByHref(searchMethod, options, ...linksToFollow); } + + /** + * + * Make a request to get primary bitstream + * in all current use cases, and having it simplifies this method + * + * @param item the {@link Item} the {@link Bundle} is a part of + * @param bundleName the name of the {@link Bundle} we want to find + * {@link Bitstream}s for + * @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's + * no valid cached version. Defaults to true + * @param reRequestOnStale Whether or not the request should automatically be re- + * requested after the response becomes stale + * @return {Observable} + * Return an observable that constains primary bitstream information or null + */ + public findPrimaryBitstreamByItemAndName(item: Item, bundleName: string, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable { + return this.bundleService.findByItemAndName(item, bundleName, useCachedVersionIfAvailable, reRequestOnStale, followLink('primaryBitstream')).pipe( + getFirstCompletedRemoteData(), + switchMap((rd: RemoteData) => { + if (!rd.hasSucceeded) { + return EMPTY; + } + return rd.payload.primaryBitstream.pipe( + getFirstCompletedRemoteData(), + map((rdb: RemoteData) => rdb.hasSucceeded ? rdb.payload : null) + ); + }) + ); + } + /** * Make a new FindListRequest with given search method * diff --git a/src/app/core/submission/models/workspaceitem-section-upload.model.ts b/src/app/core/submission/models/workspaceitem-section-upload.model.ts index f98e0584ebc..d992567df4c 100644 --- a/src/app/core/submission/models/workspaceitem-section-upload.model.ts +++ b/src/app/core/submission/models/workspaceitem-section-upload.model.ts @@ -4,7 +4,10 @@ import { WorkspaceitemSectionUploadFileObject } from './workspaceitem-section-up * An interface to represent submission's upload section data. */ export interface WorkspaceitemSectionUploadObject { - + /** + * Primary bitstream flag + */ + primary: string | null; /** * A list of [[WorkspaceitemSectionUploadFileObject]] */ diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.html b/src/app/item-page/simple/field-components/file-section/file-section.component.html index cd708510e8c..eee29603a54 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.html +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.html @@ -2,7 +2,10 @@
- {{ dsoNameService.getName(file) }} + + {{ 'item.page.bitstreams.primary' | translate }} + {{ dsoNameService.getName(file) }} + ({{(file?.sizeBytes) | dsFileSize }}) diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts index 8acf405b55f..4a825e50c91 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts @@ -25,7 +25,8 @@ describe('FileSectionComponent', () => { let fixture: ComponentFixture; const bitstreamDataService = jasmine.createSpyObj('bitstreamDataService', { - findAllByItemAndBundleName: createSuccessfulRemoteDataObject$(createPaginatedList([])) + findAllByItemAndBundleName: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findPrimaryBitstreamByItemAndName: observableOf(null) }); const mockBitstream: Bitstream = Object.assign(new Bitstream(), @@ -81,6 +82,20 @@ describe('FileSectionComponent', () => { fixture.detectChanges(); })); + it('should set the id of primary bitstream', () => { + comp.primaryBitsreamId = undefined; + bitstreamDataService.findPrimaryBitstreamByItemAndName.and.returnValue(observableOf(mockBitstream)); + comp.ngOnInit(); + expect(comp.primaryBitsreamId).toBe(mockBitstream.id); + }); + + it('should not set the id of primary bitstream', () => { + comp.primaryBitsreamId = undefined; + bitstreamDataService.findPrimaryBitstreamByItemAndName.and.returnValue(observableOf(null)); + comp.ngOnInit(); + expect(comp.primaryBitsreamId).toBeUndefined(); + }); + describe('when the bitstreams are loading', () => { beforeEach(() => { comp.bitstreams$.next([mockBitstream]); diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.ts index 3c41731c5f4..76f33de9063 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -39,6 +39,8 @@ export class FileSectionComponent implements OnInit { pageSize: number; + primaryBitsreamId: string; + constructor( protected bitstreamDataService: BitstreamDataService, protected notificationsService: NotificationsService, @@ -50,9 +52,19 @@ export class FileSectionComponent implements OnInit { } ngOnInit(): void { + this.getPrimaryBitstreamId(); this.getNextPage(); } + private getPrimaryBitstreamId() { + this.bitstreamDataService.findPrimaryBitstreamByItemAndName(this.item, 'ORIGINAL', true, true).subscribe((primaryBitstream: Bitstream | null) => { + if (!primaryBitstream) { + return; + } + this.primaryBitsreamId = primaryBitstream?.id; + }); + } + /** * This method will retrieve the next page of Bitstreams from the external BitstreamDataService call. * It'll retrieve the currentPage from the class variables and it'll add the next page of bitstreams with the diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.html index ed117a50219..5beb8d52dab 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.scss b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.scss index e69de29bb2d..206ad174929 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.scss +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.scss @@ -0,0 +1,16 @@ +div.custom-switch { + &.custom-control-right { + margin-left: 0; + margin-right: 0; + + &::after { + right: -1.5rem; + left: auto; + } + + &::before { + right: -2.35rem; + left: auto; + } + } +} diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts index ceb498fe567..4d626e7cdd3 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts @@ -1,11 +1,12 @@ import { DynamicFormsCoreModule, DynamicFormService } from '@ng-dynamic-forms/core'; import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms'; import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { DebugElement } from '@angular/core'; +import { DebugElement} from '@angular/core'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { By } from '@angular/platform-browser'; import { DynamicCustomSwitchModel } from './custom-switch.model'; import { CustomSwitchComponent } from './custom-switch.component'; +import { TranslateModule } from '@ngx-translate/core'; describe('CustomSwitchComponent', () => { @@ -20,9 +21,10 @@ describe('CustomSwitchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ + TranslateModule.forRoot(), ReactiveFormsModule, NoopAnimationsModule, - DynamicFormsCoreModule.forRoot() + DynamicFormsCoreModule.forRoot(), ], declarations: [CustomSwitchComponent] diff --git a/src/app/shared/form/builder/form-builder.service.ts b/src/app/shared/form/builder/form-builder.service.ts index cf6f38bf7b8..8bd449a07d1 100644 --- a/src/app/shared/form/builder/form-builder.service.ts +++ b/src/app/shared/form/builder/form-builder.service.ts @@ -196,6 +196,7 @@ export class FormBuilderService extends DynamicFormService { return new FormFieldMetadataValueObject((controlValue as any).value, controlLanguage, authority, (controlValue as any).display, place, (controlValue as any).confidence); } } + return controlValue; }; const iterateControlModels = (findGroupModel: DynamicFormControlModel[], controlModelIndex: number = 0): void => { diff --git a/src/app/shared/mocks/section-upload.service.mock.ts b/src/app/shared/mocks/section-upload.service.mock.ts index ae3515105d9..4e872522c33 100644 --- a/src/app/shared/mocks/section-upload.service.mock.ts +++ b/src/app/shared/mocks/section-upload.service.mock.ts @@ -5,6 +5,9 @@ import { SubmissionFormsConfigDataService } from '../../core/config/submission-f */ export function getMockSectionUploadService(): SubmissionFormsConfigDataService { return jasmine.createSpyObj('SectionUploadService', { + updatePrimaryBitstreamOperation: jasmine.createSpy('updatePrimaryBitstreamOperation'), + updateFilePrimaryBitstream: jasmine.createSpy('updateFilePrimaryBitstream'), + getUploadedFilesData: jasmine.createSpy('getUploadedFilesData'), getUploadedFileList: jasmine.createSpy('getUploadedFileList'), getFileData: jasmine.createSpy('getFileData'), getDefaultPolicies: jasmine.createSpy('getDefaultPolicies'), diff --git a/src/app/shared/mocks/submission.mock.ts b/src/app/shared/mocks/submission.mock.ts index 268ae33ab39..bec08013c35 100644 --- a/src/app/shared/mocks/submission.mock.ts +++ b/src/app/shared/mocks/submission.mock.ts @@ -1612,7 +1612,13 @@ export const mockUploadFiles = [ } ]; +export const mockUploadFilesData = { + primary: null, + files: JSON.parse(JSON.stringify(mockUploadFiles)) +}; + export const mockFileFormData = { + primary: [true], metadata: { 'dc.title': [ { diff --git a/src/app/submission/objects/submission-objects.actions.ts b/src/app/submission/objects/submission-objects.actions.ts index 9182611e479..86d90f05f30 100644 --- a/src/app/submission/objects/submission-objects.actions.ts +++ b/src/app/submission/objects/submission-objects.actions.ts @@ -59,6 +59,7 @@ export const SubmissionObjectActionTypes = { // Upload file types NEW_FILE: type('dspace/submission/NEW_FILE'), EDIT_FILE_DATA: type('dspace/submission/EDIT_FILE_DATA'), + EDIT_FILE_PRIMARY_BITSTREAM_DATA: type('dspace/submission/EDIT_FILE_PRIMARY_BITSTREAM_DATA'), DELETE_FILE: type('dspace/submission/DELETE_FILE'), // Errors @@ -760,6 +761,29 @@ export class NewUploadedFileAction implements Action { } } +export class EditFilePrimaryBitstreamAction implements Action { + type = SubmissionObjectActionTypes.EDIT_FILE_PRIMARY_BITSTREAM_DATA; + payload: { + submissionId: string; + sectionId: string; + fileId: string | null; + }; + + /** + * Edit a file data + * + * @param submissionId + * the submission's ID + * @param sectionId + * the section's ID + * @param fileId + * the file's ID + */ + constructor(submissionId: string, sectionId: string, fileId: string | null) { + this.payload = { submissionId, sectionId, fileId: fileId }; + } +} + export class EditFileDataAction implements Action { type = SubmissionObjectActionTypes.EDIT_FILE_DATA; payload: { @@ -833,6 +857,7 @@ export type SubmissionObjectAction = DisableSectionAction | SectionStatusChangeAction | NewUploadedFileAction | EditFileDataAction + | EditFilePrimaryBitstreamAction | DeleteUploadedFileAction | InertSectionErrorsAction | DeleteSectionErrorsAction diff --git a/src/app/submission/objects/submission-objects.reducer.ts b/src/app/submission/objects/submission-objects.reducer.ts index a05bf05f52c..4970e25d325 100644 --- a/src/app/submission/objects/submission-objects.reducer.ts +++ b/src/app/submission/objects/submission-objects.reducer.ts @@ -1,4 +1,4 @@ -import { hasValue, isEmpty, isNotEmpty, isNotNull, isUndefined } from '../../shared/empty.util'; +import { hasValue, isEmpty, isNotEmpty, isNotNull, isNull, isUndefined } from '../../shared/empty.util'; import differenceWith from 'lodash/differenceWith'; import findKey from 'lodash/findKey'; import isEqual from 'lodash/isEqual'; @@ -14,6 +14,7 @@ import { DepositSubmissionSuccessAction, DisableSectionAction, EditFileDataAction, + EditFilePrimaryBitstreamAction, EnableSectionAction, InertSectionErrorsAction, InitSectionAction, @@ -203,6 +204,10 @@ export function submissionObjectReducer(state = initialState, action: Submission return newFile(state, action as NewUploadedFileAction); } + case SubmissionObjectActionTypes.EDIT_FILE_PRIMARY_BITSTREAM_DATA: { + return editPrimaryBitstream(state, action as EditFilePrimaryBitstreamAction); + } + case SubmissionObjectActionTypes.EDIT_FILE_DATA: { return editFileData(state, action as EditFileDataAction); } @@ -735,6 +740,46 @@ function newFile(state: SubmissionObjectState, action: NewUploadedFileAction): S }); } +/** + * Edit primary bitstream. + * + * @param state + * the current state + * @param action + * an EditFilePrimaryBitstreamAction action + * @return SubmissionObjectState + * the new state, with the edited file. + */ +function editPrimaryBitstream(state: SubmissionObjectState, action: EditFilePrimaryBitstreamAction): SubmissionObjectState { + const filesData = state[ action.payload.submissionId ].sections[ action.payload.sectionId ].data as WorkspaceitemSectionUploadObject; + const { submissionId, sectionId, fileId } = action.payload; + + const fileIndex = findKey(filesData.files, { uuid: fileId }); + if (isNull(fileIndex)) { + return state; + } + + const submission = state[submissionId]; + return { + ...state, + [submissionId]: { + ...submission, + sections: { + ...submission.sections, + [sectionId]: { + ...submission.sections[sectionId], + data: { + ...submission.sections[sectionId].data as WorkspaceitemSectionUploadObject, + primary: fileId + } + } + }, + isLoading: submission.isLoading, + savePending: submission.savePending, + } + }; +} + /** * Edit a file. * diff --git a/src/app/submission/sections/license/section-license.component.ts b/src/app/submission/sections/license/section-license.component.ts index e9a0cf15668..4b2e6761cc6 100644 --- a/src/app/submission/sections/license/section-license.component.ts +++ b/src/app/submission/sections/license/section-license.component.ts @@ -213,6 +213,7 @@ export class SubmissionSectionLicenseComponent extends SectionModelComponent { } else { this.operationsBuilder.remove(this.pathCombiner.getPath(path)); } + this.submissionService.dispatchSaveSection(this.submissionId, this.sectionData.id); } /** diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.html b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.html index 2baa6c1555a..0cb79e51cb0 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.html +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.html @@ -6,7 +6,6 @@