diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 2927cd4e65..db018fff9d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -86,6 +86,7 @@ export function getDSOPath(dso: DSpaceObject): string { path: PROFILE_MODULE_PATH, loadChildren: './profile-page/profile-page.module#ProfilePageModule', canActivate: [AuthenticatedGuard] }, + { path: 'processes', loadChildren: './process-page/process-page.module#ProcessPageModule', canActivate: [AuthenticatedGuard] }, { path: '**', pathMatch: 'full', component: PageNotFoundComponent }, ], { diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 76b0e3e76c..4d04a79d73 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -139,6 +139,8 @@ import { VersionDataService } from './data/version-data.service'; import { VersionHistoryDataService } from './data/version-history-data.service'; import { Version } from './shared/version.model'; import { VersionHistory } from './shared/version-history.model'; +import { Script } from '../process-page/scripts/script.model'; +import { Process } from '../process-page/processes/process.model'; /** * When not in production, endpoint responses can be mocked for testing purposes @@ -307,6 +309,8 @@ export const models = ItemType, ExternalSource, ExternalSourceEntry, + Script, + Process, Version, VersionHistory ]; diff --git a/src/app/process-page/new/new-process.component.html b/src/app/process-page/new/new-process.component.html new file mode 100644 index 0000000000..9e050c37b5 --- /dev/null +++ b/src/app/process-page/new/new-process.component.html @@ -0,0 +1,10 @@ +
+
+
+ +
+
+ +
+
+
diff --git a/src/app/process-page/new/new-process.component.scss b/src/app/process-page/new/new-process.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/process-page/new/new-process.component.ts b/src/app/process-page/new/new-process.component.ts new file mode 100644 index 0000000000..c5fc786442 --- /dev/null +++ b/src/app/process-page/new/new-process.component.ts @@ -0,0 +1,16 @@ +import { Component } from '@angular/core'; +import { Script } from '../scripts/script.model'; + +@Component({ + selector: 'ds-new-process', + templateUrl: './new-process.component.html', + styleUrls: ['./new-process.component.scss'], +}) +export class NewProcessComponent { + public selectedScript: Script; + + selectScript(script: Script) { + this.selectedScript = script; + console.log('selected script: ', script); + } +} diff --git a/src/app/process-page/new/script-help/script-help.component.html b/src/app/process-page/new/script-help/script-help.component.html new file mode 100644 index 0000000000..937f7c007f --- /dev/null +++ b/src/app/process-page/new/script-help/script-help.component.html @@ -0,0 +1,9 @@ +

{{script?.name}}

+{{script?.description}} + + + + + + +
{{param.name}} {{param.nameLong}}{{param.type !== 'boolean' ? '<<' + param.type + '>>' : ''}}{{param.description}}
diff --git a/src/app/process-page/new/script-help/script-help.component.scss b/src/app/process-page/new/script-help/script-help.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/process-page/new/script-help/script-help.component.spec.ts b/src/app/process-page/new/script-help/script-help.component.spec.ts new file mode 100644 index 0000000000..286afa9922 --- /dev/null +++ b/src/app/process-page/new/script-help/script-help.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ScriptHelpComponent } from './script-help.component'; + +describe('ScriptHelpComponent', () => { + let component: ScriptHelpComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ScriptHelpComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ScriptHelpComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/process-page/new/script-help/script-help.component.ts b/src/app/process-page/new/script-help/script-help.component.ts new file mode 100644 index 0000000000..0ff4a90ae4 --- /dev/null +++ b/src/app/process-page/new/script-help/script-help.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; +import { Script } from '../../scripts/script.model'; + +@Component({ + selector: 'ds-script-help', + templateUrl: './script-help.component.html', + styleUrls: ['./script-help.component.scss'] +}) +export class ScriptHelpComponent { + @Input() script: Script; +} diff --git a/src/app/process-page/new/scripts-select/scripts-select.component.html b/src/app/process-page/new/scripts-select/scripts-select.component.html new file mode 100644 index 0000000000..69b1830941 --- /dev/null +++ b/src/app/process-page/new/scripts-select/scripts-select.component.html @@ -0,0 +1,6 @@ + diff --git a/src/app/process-page/new/scripts-select/scripts-select.component.scss b/src/app/process-page/new/scripts-select/scripts-select.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/process-page/new/scripts-select/scripts-select.component.spec.ts b/src/app/process-page/new/scripts-select/scripts-select.component.spec.ts new file mode 100644 index 0000000000..b433d633f1 --- /dev/null +++ b/src/app/process-page/new/scripts-select/scripts-select.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ScriptsSelectComponent } from './scripts-select.component'; + +describe('ScriptsSelectComponent', () => { + let component: ScriptsSelectComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ScriptsSelectComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ScriptsSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/process-page/new/scripts-select/scripts-select.component.ts b/src/app/process-page/new/scripts-select/scripts-select.component.ts new file mode 100644 index 0000000000..70b13c2e62 --- /dev/null +++ b/src/app/process-page/new/scripts-select/scripts-select.component.ts @@ -0,0 +1,41 @@ +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { ScriptDataService } from '../../scripts/script-data.service'; +import { Script } from '../../scripts/script.model'; +import { Observable } from 'rxjs'; +import { getRemoteDataPayload, getSucceededRemoteData } from '../../../core/shared/operators'; +import { PaginatedList } from '../../../core/data/paginated-list'; +import { map } from 'rxjs/operators'; + +@Component({ + selector: 'ds-scripts-select', + templateUrl: './scripts-select.component.html', + styleUrls: ['./scripts-select.component.scss'] +}) +export class ScriptsSelectComponent implements OnInit { + @Output() select: EventEmitter