CST-6685 updated changes

This commit is contained in:
Nikunj Sharma
2022-09-23 16:16:22 +05:30
parent b022a93128
commit 5b1e0d3e0d
5 changed files with 6 additions and 3 deletions

View File

@@ -101,6 +101,7 @@ describe('BatchImportPageComponent', () => {
const parameterValues: ProcessParameter[] = [ const parameterValues: ProcessParameter[] = [
Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }), Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }),
]; ];
parameterValues.push(Object.assign(new ProcessParameter(), { name: '--add', value: 'filename.zip' }));
expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]); expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]);
}); });
it('success notification is shown', () => { it('success notification is shown', () => {
@@ -121,6 +122,7 @@ describe('BatchImportPageComponent', () => {
it('metadata-import script is invoked with --zip fileName and the mockFile and -v validate-only', () => { it('metadata-import script is invoked with --zip fileName and the mockFile and -v validate-only', () => {
const parameterValues: ProcessParameter[] = [ const parameterValues: ProcessParameter[] = [
Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }), Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }),
Object.assign(new ProcessParameter(), { name: '--add', value: 'filename.zip' }),
Object.assign(new ProcessParameter(), { name: '-v', value: true }), Object.assign(new ProcessParameter(), { name: '-v', value: true }),
]; ];
expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]); expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]);

View File

@@ -78,6 +78,7 @@ export class BatchImportPageComponent {
const parameterValues: ProcessParameter[] = [ const parameterValues: ProcessParameter[] = [
Object.assign(new ProcessParameter(), { name: '--zip', value: this.fileObject.name }), Object.assign(new ProcessParameter(), { name: '--zip', value: this.fileObject.name }),
]; ];
parameterValues.push(Object.assign(new ProcessParameter(), { name: '--add', value: this.fileObject.name }));
if (this.dso) { if (this.dso) {
parameterValues.push(Object.assign(new ProcessParameter(), { name: '--collection', value: this.dso.uuid })); parameterValues.push(Object.assign(new ProcessParameter(), { name: '--collection', value: this.dso.uuid }));
} }

View File

@@ -24,7 +24,7 @@ import { dataService } from '../base/data-service.decorator';
export const METADATA_IMPORT_SCRIPT_NAME = 'metadata-import'; export const METADATA_IMPORT_SCRIPT_NAME = 'metadata-import';
export const METADATA_EXPORT_SCRIPT_NAME = 'metadata-export'; export const METADATA_EXPORT_SCRIPT_NAME = 'metadata-export';
export const BATCH_IMPORT_SCRIPT_NAME = 'batch-import'; export const BATCH_IMPORT_SCRIPT_NAME = 'import';
@Injectable() @Injectable()
@dataService(SCRIPT) @dataService(SCRIPT)

View File

@@ -18,7 +18,7 @@ import { Observable, of } from 'rxjs';
}) })
export class ImportBatchSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { export class ImportBatchSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
objectType = DSpaceObjectType.DSPACEOBJECT; objectType = DSpaceObjectType.DSPACEOBJECT;
selectorTypes = [DSpaceObjectType.COLLECTION, DSpaceObjectType.COMMUNITY]; selectorTypes = [DSpaceObjectType.COLLECTION];
action = SelectorActionType.IMPORT_BATCH; action = SelectorActionType.IMPORT_BATCH;
/** /**
* An event fired when the modal is closed * An event fired when the modal is closed

View File

@@ -554,7 +554,7 @@
"admin.metadata-import.page.help": "You can drop or browse CSV files that contain batch metadata operations on files here", "admin.metadata-import.page.help": "You can drop or browse CSV files that contain batch metadata operations on files here",
"admin.batch-import.page.help": "You can drop or browse ZIP files that contain batch operations on files here", "admin.batch-import.page.help": "Select the Collection to import into. Then, drop or browse to a Simple Archive Format (SAF) zip file that includes the Items to import",
"admin.metadata-import.page.dropMsg": "Drop a metadata CSV to import", "admin.metadata-import.page.dropMsg": "Drop a metadata CSV to import",