From e7cd6a49d18fb1b832154da11dc7ab41fe1306ba Mon Sep 17 00:00:00 2001 From: "LAPTOP-3U1QPHJV\\ruchi" Date: Mon, 2 Jul 2018 14:06:00 +0200 Subject: [PATCH 1/2] added status to create achievement form --- .../achievements/achievements.component.html | 2 +- .../create-achievements-dialog.component.html | 20 ++++++++++++++----- .../create-achievements-dialog.component.ts | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/mobile-content/achievements/achievements.component.html b/app/mobile-content/achievements/achievements.component.html index 58f8a58d9..76d245687 100644 --- a/app/mobile-content/achievements/achievements.component.html +++ b/app/mobile-content/achievements/achievements.component.html @@ -49,7 +49,7 @@

{{ achievement.title }} ({{ achievement.status | translate }})

- diff --git a/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.html b/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.html index 8608743c0..a2965c99e 100644 --- a/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.html +++ b/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.html @@ -21,9 +21,13 @@

{{ 'create new achievement' | translate }}


- +
+ + {{ statusOption | translate }} +
@@ -37,16 +41,22 @@

{{ 'create new achievement' | translate }}


- +
- - + + {{ statusOption | translate }} + +
+ + {{ route.title | translate }}
+

diff --git a/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.ts b/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.ts index 027451c80..2ce916b3f 100644 --- a/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.ts +++ b/app/mobile-content/achievements/create-achievements-dialog/create-achievements-dialog.component.ts @@ -16,6 +16,7 @@ import { RouteService } from '../../routes/shared/routes.service'; import { ExhibitService } from '../../exhibits/shared/exhibit.service'; import { Exhibit } from '../../exhibits/shared/exhibit.model'; import { Route } from '../../routes/shared/route.model'; +import { Status } from '../../shared/status.model'; @Component({ @@ -27,6 +28,7 @@ import { Route } from '../../routes/shared/route.model'; export class CreateAchievementsDialogComponent implements OnInit { achievements: Achievement[] = []; selectedType: any = null; + statusOptions = Status.getValues(); selectedExhibit: any = null; achievement: any; title: string; From 615e423e4a1bd71b8d1cb4e003361faa7fa624fe Mon Sep 17 00:00:00 2001 From: "LAPTOP-3U1QPHJV\\ruchi" Date: Mon, 2 Jul 2018 14:16:21 +0200 Subject: [PATCH 2/2] added staus in edit achievement and removed supervisor guard also --- .../edit-achievements.component.css | 2 +- .../edit-achievements.component.html | 3 +++ .../edit-achievements.component.ts | 3 ++- app/mobile-content/mobile-content.routing.ts | 18 +++++++++--------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app/mobile-content/achievements/edit-achievements/edit-achievements.component.css b/app/mobile-content/achievements/edit-achievements/edit-achievements.component.css index 78da1dbf1..0c3dc4905 100644 --- a/app/mobile-content/achievements/edit-achievements/edit-achievements.component.css +++ b/app/mobile-content/achievements/edit-achievements/edit-achievements.component.css @@ -4,7 +4,7 @@ margin-top: 1em; } -#details-form md-select { +#edit-achievement-form md-select { position: relative; top: -1px; } diff --git a/app/mobile-content/achievements/edit-achievements/edit-achievements.component.html b/app/mobile-content/achievements/edit-achievements/edit-achievements.component.html index 7573825fe..d0115d455 100644 --- a/app/mobile-content/achievements/edit-achievements/edit-achievements.component.html +++ b/app/mobile-content/achievements/edit-achievements/edit-achievements.component.html @@ -17,6 +17,9 @@

{{ 'Edit achievement' | translate }}: {{ achievement.title }}

+ + {{ statusOption | translate }} +
diff --git a/app/mobile-content/achievements/edit-achievements/edit-achievements.component.ts b/app/mobile-content/achievements/edit-achievements/edit-achievements.component.ts index bf812b380..2542dbfa1 100644 --- a/app/mobile-content/achievements/edit-achievements/edit-achievements.component.ts +++ b/app/mobile-content/achievements/edit-achievements/edit-achievements.component.ts @@ -16,7 +16,7 @@ import { Medium } from '../../media/shared/medium.model'; import { AchievementService } from '../shared/achievement.service'; import { RouteService } from '../../routes/shared/routes.service'; import { Route } from '../../routes/shared/route.model'; - +import { Status } from '../../shared/status.model'; @Component({ @@ -29,6 +29,7 @@ export class EditAchievementsComponent implements OnInit { id: number; achievement: any; title: string; + statusOptions = Status.getValues(); description: string; previewURL: SafeUrl; file: File; diff --git a/app/mobile-content/mobile-content.routing.ts b/app/mobile-content/mobile-content.routing.ts index a5fa58e9c..00868087c 100644 --- a/app/mobile-content/mobile-content.routing.ts +++ b/app/mobile-content/mobile-content.routing.ts @@ -30,12 +30,12 @@ const mobileContentRoutes: Routes = [ { path: 'exhibits/deleted', component: ExhibitsComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'exhibits/edit/:id', component: EditExhibitComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'exhibits/my-exhibits', @@ -55,12 +55,12 @@ const mobileContentRoutes: Routes = [ { path: 'achievements/view/:id', component: ViewAchievementComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'exhibits/view/:id', component: ViewExhibitComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'media', @@ -70,7 +70,7 @@ const mobileContentRoutes: Routes = [ { path: 'media/deleted', component: MediaComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'pages', @@ -85,7 +85,7 @@ const mobileContentRoutes: Routes = [ { path: 'pages/edit/:id', component: EditPageComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'pages/view/:id', @@ -100,18 +100,18 @@ const mobileContentRoutes: Routes = [ { path: 'routes/edit/:id', component: EditRouteComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'routes/deleted', component: RoutesComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'routes/view/:id', component: ViewRouteComponent, - canActivate: [AuthGuard, SupervisorGuard] + canActivate: [AuthGuard] }, { path: 'routes/my-routes',