diff --git a/dmp-frontend/.angular-cli.json b/dmp-frontend/.angular-cli.json index fa49c8f03..9a6dc38ba 100644 --- a/dmp-frontend/.angular-cli.json +++ b/dmp-frontend/.angular-cli.json @@ -19,14 +19,14 @@ "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ - "./../node_modules/bootstrap/dist/css/bootstrap.min.css", + "./../node_modules/bootstrap/dist/css/bootstrap.min.css", "styles.css" ], "scripts": [ "./../node_modules/jquery/dist/jquery.min.js", "./../node_modules/bootstrap/dist/js/bootstrap.min.js", "./assets/xml2json.min.js", - "./assets/jquery.scrollTo.min.js" + "./assets/jquery.scrollTo.min.js" ], "environmentSource": "environments/environment.ts", "environments": { diff --git a/dmp-frontend/package-lock.json b/dmp-frontend/package-lock.json index bb0dd8802..cefbed627 100644 --- a/dmp-frontend/package-lock.json +++ b/dmp-frontend/package-lock.json @@ -526,6 +526,12 @@ "graceful-fs": "4.1.11" } }, + "moment": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz", + "integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=", + "dev": true + }, "ms": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", @@ -2220,6 +2226,11 @@ } } }, + "date-fns": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz", + "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==" + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -5404,10 +5415,9 @@ "dev": true }, "moment": { - "version": "2.18.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz", - "integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=", - "dev": true + "version": "2.19.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.19.1.tgz", + "integrity": "sha1-VtoaLRy/AdOLfhr8McELz6GSkWc=" }, "ms": { "version": "2.0.0", @@ -5490,6 +5500,20 @@ "resolved": "https://registry.npmjs.org/ng-sidebar/-/ng-sidebar-6.0.4.tgz", "integrity": "sha1-QtxRdV6FPBiBs7iFg1T0yEWpbzM=" }, + "ng2-datepicker": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ng2-datepicker/-/ng2-datepicker-2.1.3.tgz", + "integrity": "sha512-09Hwrf9IHsWzp/2FPSGo00P/XtiHSsHLBCeFCK1LG1nuuhNZbQ7LXLR+e+znhjPJyTkhelmODkhmy5DByYWpcA==", + "requires": { + "date-fns": "1.29.0", + "ngx-slimscroll": "3.4.1" + } + }, + "ngx-slimscroll": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ngx-slimscroll/-/ngx-slimscroll-3.4.1.tgz", + "integrity": "sha512-PMbOai2OeXCFCHnPigYXquN6fAUeAc+CC3AhHugt9wIp8xUB6lIt8OqOWS3IPRRaeKQWyxFCuDfiPKY8n2QuOQ==" + }, "ngx-webstorage": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/ngx-webstorage/-/ngx-webstorage-1.8.0.tgz", diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 1f0489d05..f5be48943 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -31,7 +31,9 @@ "core-js": "^2.4.1", "flat": "^4.0.0", "jquery": "^3.2.1", + "moment": "^2.19.1", "ng-sidebar": "^6.0.4", + "ng2-datepicker": "^2.1.3", "ngx-webstorage": "^1.8.0", "rxjs": "^5.4.2", "zone.js": "^0.8.17" diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index abbcf9ee3..ab3af942c 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -1,27 +1,32 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { PageNotFoundComponent } from './not-found.component'; +import { EmptyComponent } from './empty.component'; import { DynamicFormComponent } from './form/dynamic-form.component'; import { AuthGuard } from './guards/auth.guard'; import { ProjectsComponent } from './projects/projects.component'; import { DatasetsComponent } from './datasets/dataset.component'; import { DmpComponent } from './dmps/dmp.component'; import { AppComponent } from './app.component'; +import { UserWorkspaceComponent } from './user-workspace/user-workspace.component'; import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component'; const appRoutes: Routes = [ { path: 'dynamic-form', component: DynamicFormComponent, canActivate: [AuthGuard] }, { path: 'login', component: MainSignInComponent}, - { path: 'projects', component: ProjectsComponent}, - { path: 'dmps', component: DmpComponent}, - { path: '', redirectTo: '/login', pathMatch: 'full' }, + //{ path: 'projects', component: ProjectsComponent}, + //{ path: 'dmps', component: DmpComponent}, + { path: 'workspace', component: UserWorkspaceComponent}, + //{ path: '', component: EmptyComponent}, + //{ path: '', redirectTo: '/login', pathMatch: 'full' }, { path: '**', component: PageNotFoundComponent }, + /* { path: '', redirectTo: 'app-root', pathMatch: 'full' } - + */ ]; @NgModule({ diff --git a/dmp-frontend/src/app/app.component.html b/dmp-frontend/src/app/app.component.html index 4d428c521..10d34c8ea 100644 --- a/dmp-frontend/src/app/app.component.html +++ b/dmp-frontend/src/app/app.component.html @@ -44,10 +44,10 @@
- About - Services - Clients - Contact + My Workspace + Orphan Datasets + Clients + Contact
diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index ec617c3eb..e9768810f 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -21,6 +21,7 @@ import { DynamicFormGroupComponent } from './form/dynamic-form-group/dynamic-for import { AppRoutingModule } from './app-routing.module'; import { AuthGuard } from './guards/auth.guard'; import { PageNotFoundComponent } from './not-found.component'; +import { EmptyComponent } from './empty.component'; import { TocComponent } from './form/tableOfContents/toc.component'; import { PaginationService } from './services/pagination.service'; @@ -57,9 +58,11 @@ import { ProjectsComponent } from './projects/projects.component'; import { ProjectRoutingModule } from './projects/project-routing.module'; import { ProjectDetailComponent } from './projects/project.detail'; import { ModalComponent } from './modal/modal.component'; +import { NgDatepickerModule } from 'ng2-datepicker'; import { StatusToString } from './pipes/various/status-to-string'; import { SidebarModule } from 'ng-sidebar'; +import { UserWorkspaceComponent } from './user-workspace/user-workspace.component'; @@ -75,11 +78,13 @@ import { SidebarModule } from 'ng-sidebar'; GooggleSignInComponent, MainSignInComponent, PageNotFoundComponent, + EmptyComponent, ModalComponent, ProjectDetailComponent, ProjectsComponent, DmpComponent, DatasetsComponent, + UserWorkspaceComponent, ProjectTableFilterPipe, DmpVersionFilterPipe, @@ -102,6 +107,7 @@ import { SidebarModule } from 'ng-sidebar'; AppRoutingModule, AngularDraggableModule, DataTableModule, + NgDatepickerModule, SidebarModule.forRoot() ], diff --git a/dmp-frontend/src/app/datasets/dataset.component.ts b/dmp-frontend/src/app/datasets/dataset.component.ts index b8d4deae9..1cd55a7d0 100644 --- a/dmp-frontend/src/app/datasets/dataset.component.ts +++ b/dmp-frontend/src/app/datasets/dataset.component.ts @@ -87,8 +87,7 @@ export class DatasetsComponent implements OnInit { this.datasetProfileDropDown.options = []; this.saveAndDescribe = false; this.statusDropDown = new DropdownField(); - this.statusDropDown.options =[]; - this.statusDropDown.options= [{key:'0', value:"active"},{key:'1', value:"inactive"}] + this.statusDropDown.options= [{key:'', value:null},{key:'0', value:"Active"},{key:'1', value:"Inactive"}] } @@ -115,6 +114,7 @@ export class DatasetsComponent implements OnInit { ) } + SaveDataset(){ if(this.dataset.id ==null){ this.dataset.dmp = { "id": this.dmpIdforDatasets } @@ -130,7 +130,6 @@ export class DatasetsComponent implements OnInit { $("#newDatasetModal").modal("hide"); } - else{ this.dataset.dmp = { "id": this.dmpIdforDatasets } this.dataset.profile = { "id": this.dataset.profile } @@ -166,10 +165,11 @@ export class DatasetsComponent implements OnInit { editRow(item, event) { if (event.toElement.id == "editDataset"){ + this.dataset = item; this.dataset.label = item.label; this.dataset.uri = item.uri; //this.dataset.dmp = item.dmp; - this.dataset.profile = item.profile.id; + this.dataset.profile = item.profile==null ? null : item.profile.id; this.dataset.id = item.id; $("#newDatasetModal").modal("show"); } @@ -192,8 +192,22 @@ export class DatasetsComponent implements OnInit { this.SaveDataset(); } - describeDataset(item) {debugger; + describeDataset(item) { this.ngZone.run(() => this.router.navigate(['dynamic-form', {id: item.profile.id, datasetId:item.id}])); } + deleteRow(dataset, $event){ + this.serverService.deleteDataset(dataset).subscribe( + response => { + console.log("Deleted Successfully the dataset") + }, + err => { + console.log("Could not delete the dataset") + } + ); + this.getDatasets(); + } + + + } diff --git a/dmp-frontend/src/app/datasets/dataset.html b/dmp-frontend/src/app/datasets/dataset.html index 3a417d6a7..6320a38e1 100644 --- a/dmp-frontend/src/app/datasets/dataset.html +++ b/dmp-frontend/src/app/datasets/dataset.html @@ -10,10 +10,9 @@ - - +