From 3e9c5dbe0f1f2b8689b43a03d2d2cf1098724003 Mon Sep 17 00:00:00 2001 From: annampak Date: Wed, 1 Nov 2017 11:56:35 +0200 Subject: [PATCH] project table --- dmp-frontend/src/app/app.module.ts | 10 +- .../app/pipes/project-table-filter.pipe.ts | 27 ++++ dmp-frontend/src/app/projects/project.css | 40 ++++++ dmp-frontend/src/app/projects/project.html | 117 +++++++++++------- .../src/app/projects/project.module.ts | 6 +- .../src/app/projects/projects.component.ts | 59 +++++---- dmp-frontend/src/app/services/interceptor.ts | 2 +- 7 files changed, 175 insertions(+), 86 deletions(-) create mode 100644 dmp-frontend/src/app/pipes/project-table-filter.pipe.ts diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index 94a5697c9..5b20cd5a0 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -60,11 +60,11 @@ import { HTTP_INTERCEPTORS } from '@angular/common/http'; ], providers: [ - // { - // provide: HTTP_INTERCEPTORS, - // useClass: GlobalInterceptor, - // multi: true, - // }, + { + provide: HTTP_INTERCEPTORS, + useClass: GlobalInterceptor, + multi: true, + }, ServerService, dataModelBuilder, AuthGuard, PaginationService, TokenService, LocalStorageService, RestBase, EestoreService ], bootstrap: [AppComponent] diff --git a/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts b/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts new file mode 100644 index 000000000..0849eb6e2 --- /dev/null +++ b/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts @@ -0,0 +1,27 @@ +import * as _ from "lodash"; +import {Pipe, PipeTransform} from "@angular/core"; + +@Pipe({ + name: "projectTableFilter" +}) +export class ProjectTableFilterPipe implements PipeTransform { + + transform(array: any[], query: string): any { + + if (query) { + + return _.filter(array, row => { + + return ( + + row.label.indexOf(query) > -1 || + + //row.version == query || + row.id.indexOf(query) > -1 + ) + }); + + } + return array; + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/projects/project.css b/dmp-frontend/src/app/projects/project.css index 526299dad..f643122ce 100644 --- a/dmp-frontend/src/app/projects/project.css +++ b/dmp-frontend/src/app/projects/project.css @@ -9,4 +9,44 @@ a.editGridColumn{ color: #333; +} + +.invisible { + display:none; +} + +.visible { + display:block; +} + +tr.hover:hover > * { + background-color: #eeeeee; +} + +.editor-container{ + padding-top: 10px; + padding-right: 10px; + padding-bottom: 10px; + padding-left: 10px; +} + +.button-150px { + max-width: 150px; +} + +.ng-template{ + text-align: right; +} + +.grayout-empty-table { + opacity: 0.6; /* Real browsers */ + filter: alpha(opacity = 60); /* MSIE */ + text-align: center; + vertical-align: middle; +} + +.btncustom{ + background-color:#337ab7; + color:white; + margin-top:15px; } \ No newline at end of file diff --git a/dmp-frontend/src/app/projects/project.html b/dmp-frontend/src/app/projects/project.html index f3f94b406..8ebb50ec2 100644 --- a/dmp-frontend/src/app/projects/project.html +++ b/dmp-frontend/src/app/projects/project.html @@ -1,53 +1,76 @@ -
-
- Filter: - -
- - - - - - - - - - - - - - - - - - - -
- Selected: - No item selected - -
- - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ ID + + Label + + Αbbreviation + + Start Date + + End Date + + Description + + Status + + Actions +
No elements
{{dmp.id}}{{project?.label}}{{project?.abbreviation}}{{project?.startDate}}{{project?.endDate}}{{project?.description}}{{project?.status}} + + +
+ + +