rsanchez
2017-03-21 a6e1ace2b6bdba8c08a4acfa42433f3ac073b747
#3527 feature - Added all catalogs and working fine
18 files modified
changed files
securis/src/main/webapp/src/app/app.routes.ts patch | view | blame | history
securis/src/main/webapp/src/app/forms/base.ts patch | view | blame | history
securis/src/main/webapp/src/app/forms/license.form.html patch | view | blame | history
securis/src/main/webapp/src/app/forms/licensetype.form.component.ts patch | view | blame | history
securis/src/main/webapp/src/app/forms/licensetype.form.html patch | view | blame | history
securis/src/main/webapp/src/app/forms/organization.form.component.ts patch | view | blame | history
securis/src/main/webapp/src/app/forms/organization.form.html patch | view | blame | history
securis/src/main/webapp/src/app/forms/user.form.component.ts patch | view | blame | history
securis/src/main/webapp/src/app/listing/license.list.component.html patch | view | blame | history
securis/src/main/webapp/src/app/listing/licensetype.list.component.html patch | view | blame | history
securis/src/main/webapp/src/app/listing/licensetype.list.component.ts patch | view | blame | history
securis/src/main/webapp/src/app/listing/organization.list.component.html patch | view | blame | history
securis/src/main/webapp/src/app/listing/organization.list.component.ts patch | view | blame | history
securis/src/main/webapp/src/app/listing/user.list.component.html patch | view | blame | history
securis/src/main/webapp/src/app/listing/user.list.component.ts patch | view | blame | history
securis/src/main/webapp/src/app/menu.component.html patch | view | blame | history
securis/src/main/webapp/src/app/resources/organizations.ts patch | view | blame | history
securis/src/main/webapp/src/lang/messages_en.json patch | view | blame | history
securis/src/main/webapp/src/app/app.routes.ts
....@@ -41,15 +41,15 @@
4141
4242 {path: 'licensetypes', component: LicenseTypeListComponent},
4343 {path: 'licensetypes/create', component: LicenseTypeFormComponent},
44
- {path: 'licensetypes/edit/:applicationId', component: LicenseTypeFormComponent},
44
+ {path: 'licensetypes/edit/:licensetypeId', component: LicenseTypeFormComponent},
4545
4646 {path: 'organizations', component: OrganizationListComponent},
4747 {path: 'organizations/create', component: OrganizationFormComponent},
48
- {path: 'organizations/edit/:applicationId', component: OrganizationFormComponent},
48
+ {path: 'organizations/edit/:organizationId', component: OrganizationFormComponent},
4949
5050 {path: 'users', component: UserListComponent},
5151 {path: 'users/create', component: UserFormComponent},
52
- {path: 'users/edit/:applicationId', component: UserFormComponent}
52
+ {path: 'users/edit/:username', component: UserFormComponent}
5353
5454 ]
5555 },
securis/src/main/webapp/src/app/forms/base.ts
....@@ -90,7 +90,7 @@
9090 });
9191 }
9292
93
- protected prepareInitialData(idparam: string, default_values: any = {}) : void {
93
+ protected prepareInitialData(idparam: string, default_values: any = {}, callback?: (data: any) => void) : void {
9494 this.form_title = this.$L.get('{} data', this.resourceName.capitalize());
9595 this.isNew = true;
9696 !!this.route && this.route.params.subscribe(params => {
....@@ -101,7 +101,11 @@
101101 this.form_subtitle = this.$L.get('Create a new {}', this.resourceName) ;
102102 } else {
103103 this.isNew = false;
104
- this.resourceServices.get(eleId).subscribe(eleData => this.data = eleData);
104
+ this.resourceServices.get(eleId).subscribe(eleData => {
105
+ this.data = eleData;
106
+ Object.keys(default_values).forEach((k : string) => (this.data[k] === undefined) && (this.data[k] = default_values[k]));
107
+ callback && callback(this.data);
108
+ });
105109 this.form_subtitle = this.$L.get('Modify the {} data', this.resourceName) ;
106110 }
107111 });
securis/src/main/webapp/src/app/forms/license.form.html
....@@ -45,7 +45,7 @@
4545 <div layout="row" layout-fill layout-padding>
4646 <div layout="column" layout-fill flex>
4747 <md-input-container flex>
48
- <input mdInput type="text" [(ngModel)]="data.full_name" name="full_name" required maxlength="200" />
48
+ <input #firstField mdInput type="text" [(ngModel)]="data.full_name" name="full_name" required maxlength="200" />
4949 <md-placeholder>
5050 <span i18n="field.full_name"></span>
5151 </md-placeholder>
securis/src/main/webapp/src/app/forms/licensetype.form.component.ts
....@@ -10,26 +10,25 @@
1010 import { FormBase, IComboOption } from './base';
1111 import { ActivatedRoute, Router } from '@angular/router';
1212
13
-var app_example = {
14
- code: 'CICS',
15
- creation_timestamp: 1418384439000,
16
- description: 'Wellbore integrity analysis software',
13
+var lt_example = {
1714 id: 1,
18
- license_filename: 'config_server.lic',
19
- name: 'CurisIntegrity',
20
- metadata:
21
- [ { key: 'max_docs',
22
- value: '250000',
23
- readonly: true,
24
- mandatory: true } ]
15
+ code: 'CI01',
16
+ name: 'CI ConfigServer ext',
17
+ application_id: 1,
18
+ application_name: 'CurisIntegrity',
19
+ creation_timestamp: 1418384535000,
20
+ description: 'CI ConfigServer with extended mode and 50 lines',
21
+ metadata: [ { key: 'max_docs', value: '250000', mandatory: true } ]
2522 }
23
+
2624
2725 @Component({
2826 selector: 'licensetype-form',
2927 templateUrl: 'src/app/forms/licensetype.form.html'
3028 })
3129 export class LicenseTypeFormComponent extends FormBase {
32
-
30
+
31
+ allApplications: IComboOption[];
3332 constructor(private http: Http,
3433 private licenseTypes: LicenseTypesService,
3534 private applications: ApplicationsService,
....@@ -41,17 +40,47 @@
4140 super($L, router, route, toaster, licenseTypes, $L.get('license type'), dialogs);
4241 }
4342
44
-
43
+ private _prepareMetadata(metadata : any[]) : any[] {
44
+ metadata.forEach((md : any) => {
45
+ if (md.value !== null && md.value !== '') {
46
+ md.readonly = true;
47
+ }
48
+ });
49
+ return metadata;
50
+ }
51
+
52
+ changeApplication(event: any) : void{
53
+ console.log(event);
54
+ this.applications.get(this.data.application_id)
55
+ .map(app_data => this._prepareMetadata(app_data.metadata))
56
+ .subscribe(
57
+ metadata => this.data.metadata = metadata,
58
+ err => console.error('Error loading application metadata')
59
+ );
60
+ }
61
+
62
+
63
+
64
+ loadCombos() : void {
65
+ this.applications.get()
66
+ .map(list => list.map((app : any) => <IComboOption>{id: app.id, label: `(${app.code}) ${app.name}`}))
67
+ .subscribe(
68
+ data => this.allApplications = (<IComboOption[]>data).sort((e1, e2) => e1.label.localeCompare(e2.label)),
69
+ err => console.error('Error loading applications')
70
+ );
71
+ }
72
+
4573 goBack(): void {
4674 this.router.navigate([`licensetypes`]);
4775 }
4876
4977 init() : void {
78
+ this.loadCombos();
5079 super.setFirstFocus();
5180 super.reset();
52
- super.prepareInitialData('licenseTypeId', {
81
+ super.prepareInitialData('licensetypeId', {
5382 metadata: []
54
- });
83
+ }, (data) => this._prepareMetadata(data.metadata));
5584 }
5685
5786 ngAfterViewInit(): void {
securis/src/main/webapp/src/app/forms/licensetype.form.html
....@@ -31,8 +31,8 @@
3131 <form #form="ngForm" class="inset">
3232 <div layout="column" layout-align="start center">
3333 <div layout="row" layout-fill layout-padding>
34
- <field-readonly [value]="data.id" label="field.id" flex="15" *ngIf="!isNew"></field-readonly>
35
- <div layout="column" layout-fill flex>
34
+ <field-readonly [value]="data.id" label="field.id" flex="10" *ngIf="!isNew"></field-readonly>
35
+ <div layout="column" layout-fill flex="30">
3636 <md-input-container>
3737 <input #firstField mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required [readonly]="!isNew" />
3838 <md-placeholder>
....@@ -41,8 +41,6 @@
4141 </md-input-container>
4242 <error-checker [fieldName]="getFieldName('code')" [formField]="form.controls.code"></error-checker>
4343 </div>
44
- </div>
45
- <div layout="row" layout-fill layout-padding>
4644 <div layout="column" layout-fill flex>
4745 <md-input-container flex>
4846 <input mdInput type="text" [(ngModel)]="data.name" name="name" required />
....@@ -51,15 +49,6 @@
5149 </md-placeholder>
5250 </md-input-container>
5351 <error-checker [fieldName]="getFieldName('name')" [formField]="form.controls.name"></error-checker>
54
- </div>
55
- <div layout="column" layout-fill flex>
56
- <md-input-container flex>
57
- <input mdInput type="text" [(ngModel)]="data.license_filename" name="license_filename" required />
58
- <md-placeholder>
59
- <span i18n="field.license_filename"></span>
60
- </md-placeholder>
61
- </md-input-container>
62
- <error-checker [fieldName]="getFieldName('license_filename')" [formField]="form.controls.license_filename"></error-checker>
6352 </div>
6453 </div>
6554 <div layout="row" layout-fill layout-padding>
....@@ -73,10 +62,21 @@
7362 </md-input-container>
7463 </div>
7564 </div>
65
+ <div layout="row" layout-fill layout-padding >
66
+ <div layout="column" layout-fill flex>
67
+ <md-select [placeholder]="getFieldName('application_id')" flex [(ngModel)]="data.application_id" name="application_id"
68
+ (change)="changeApplication($event)">
69
+ <md-option *ngFor="let org of allApplications" [value]="org.id">
70
+ {{org.label}}
71
+ </md-option>
72
+ </md-select>
73
+ <error-checker [fieldName]="getFieldName('application_id')" [formField]="form.controls.application_id"></error-checker>
74
+ </div>
75
+ </div>
7676 <div layout="row" layout-fill layout-padding *ngIf="!isNew">
7777 <field-readonly [value]="data.creation_timestamp | date: 'medium'" label="field.creation_timestamp" flex></field-readonly>
7878 </div>
79
- <metadata-manager addOrDelete="true" editKeys="true" [metadata]="data.metadata" ></metadata-manager>
79
+ <metadata-manager [addOrDelete]="false" [editKeys]="false" [metadata]="data.metadata" ></metadata-manager>
8080 </div>
8181 </form>
8282 </md-card-content>
securis/src/main/webapp/src/app/forms/organization.form.component.ts
....@@ -9,6 +9,7 @@
99 import { TdMediaService } from '@covalent/core';
1010 import { FormBase, IComboOption } from './base';
1111 import { ActivatedRoute, Router } from '@angular/router';
12
+import { UsersService } from "../resources/users";
1213
1314 var app_example = {
1415 code: 'CICS',
....@@ -30,9 +31,13 @@
3031 })
3132 export class OrganizationFormComponent extends FormBase {
3233
34
+ parentOrganizations: any[];
35
+ usernames: string[] = [];
36
+
3337 constructor(private http: Http,
3438 private licenseTypes: LicenseTypesService,
3539 private organizations: OrganizationsService,
40
+ private users: UsersService,
3641 router: Router,
3742 toaster: ToastsManager,
3843 route: ActivatedRoute,
....@@ -41,15 +46,33 @@
4146 super($L, router, route, toaster, organizations, $L.get('organization'), dialogs);
4247 }
4348
44
-
49
+ loadCombos() : void {
50
+ this.organizations.get()
51
+ .map(list => list.map((org : any) => <IComboOption>{id: org.id, label: `(${org.code}) ${org.name}`}))
52
+ .subscribe(
53
+ data => this.parentOrganizations = (<IComboOption[]>data).sort((e1, e2) => e1.label.localeCompare(e2.label)),
54
+ err => console.error('Error loading organizations')
55
+ );
56
+ this.users.get()
57
+ .map(list => list
58
+ .filter((user : any) => user.username !== '_client')
59
+ .map((u : any) => u.username))
60
+ .subscribe(
61
+ data => this.usernames = (<string[]>data).sort((u1, u2) => u1.localeCompare(u2)),
62
+ err => console.error('Error loading users')
63
+ );
64
+ }
65
+
66
+
4567 goBack(): void {
4668 this.router.navigate([`organizations`]);
4769 }
4870
4971 init() : void {
72
+ this.loadCombos();
5073 super.setFirstFocus();
5174 super.reset();
52
- super.prepareInitialData('organizationId');
75
+ super.prepareInitialData('organizationId', {users_ids: []});
5376 }
5477
5578 ngAfterViewInit(): void {
securis/src/main/webapp/src/app/forms/organization.form.html
....@@ -3,24 +3,11 @@
33 <button md-icon-button (click)="goBack()" color="accent">
44 <md-icon>arrow_back</md-icon>
55 </button>
6
- <span class="md-title" [innerText]="form_title"></span>
6
+ <span [innerText]="form_title"></span>
77 <span flex></span>
88 <button md-icon-button (click)="save()"><md-icon>save</md-icon></button>
99 </md-toolbar>
10
- <!--
11
- code: 'CICS',
12
- creation_timestamp: 1418384439000,
13
- description: 'Wellbore integrity analysis software',
14
- id: 1,
15
- license_filename: 'config_server.lic',
16
- name: 'CurisIntegrity',
17
- metadata:
18
- [ { key: 'max_docs',
19
- value: '250000',
20
- readonly: true,
21
- mandatory: true } ]
22
-}
23
- -->
10
+
2411 <div class="margin" layout-align-gt-xs="center start" layout-fill="" layout-gt-xs="row">
2512 <md-card flex="70">
2613 <md-card-title>
....@@ -31,8 +18,8 @@
3118 <form #form="ngForm" class="inset">
3219 <div layout="column" layout-align="start center">
3320 <div layout="row" layout-fill layout-padding>
34
- <field-readonly [value]="data.id" label="field.id" flex="15" *ngIf="!isNew"></field-readonly>
35
- <div layout="column" layout-fill flex>
21
+ <field-readonly [value]="data.id" label="field.id" flex="10" *ngIf="!isNew"></field-readonly>
22
+ <div layout="column" layout-fill flex="30">
3623 <md-input-container>
3724 <input #firstField mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required [readonly]="!isNew" />
3825 <md-placeholder>
....@@ -41,8 +28,6 @@
4128 </md-input-container>
4229 <error-checker [fieldName]="getFieldName('code')" [formField]="form.controls.code"></error-checker>
4330 </div>
44
- </div>
45
- <div layout="row" layout-fill layout-padding>
4631 <div layout="column" layout-fill flex>
4732 <md-input-container flex>
4833 <input mdInput type="text" [(ngModel)]="data.name" name="name" required />
....@@ -51,15 +36,6 @@
5136 </md-placeholder>
5237 </md-input-container>
5338 <error-checker [fieldName]="getFieldName('name')" [formField]="form.controls.name"></error-checker>
54
- </div>
55
- <div layout="column" layout-fill flex>
56
- <md-input-container flex>
57
- <input mdInput type="text" [(ngModel)]="data.license_filename" name="license_filename" required />
58
- <md-placeholder>
59
- <span i18n="field.license_filename"></span>
60
- </md-placeholder>
61
- </md-input-container>
62
- <error-checker [fieldName]="getFieldName('license_filename')" [formField]="form.controls.license_filename"></error-checker>
6339 </div>
6440 </div>
6541 <div layout="row" layout-fill layout-padding>
....@@ -73,10 +49,21 @@
7349 </md-input-container>
7450 </div>
7551 </div>
76
- <div layout="row" layout-fill layout-padding *ngIf="!isNew">
77
- <field-readonly [value]="data.creation_timestamp | date: 'medium'" label="field.creation_timestamp" flex></field-readonly>
52
+ <div layout="row" layout-fill layout-padding >
53
+ <div layout="column" layout-fill flex>
54
+ <md-select [placeholder]="getFieldName('org_parent_id')" flex [(ngModel)]="data.org_parent_id" name="org_parent_id">
55
+ <md-option *ngFor="let org of parentOrganizations" [value]="org.id">
56
+ {{org.label}}
57
+ </md-option>
58
+ </md-select>
59
+ <error-checker [fieldName]="getFieldName('org_parent_id')" [formField]="form.controls.org_parent_id"></error-checker>
60
+ </div>
7861 </div>
79
- <metadata-manager addOrDelete="true" editKeys="true" [metadata]="data.metadata" ></metadata-manager>
62
+ <div layout="row" layout-fill layout-padding >
63
+ <td-chips flex [mdTooltip]="$L.get('Users with access to this organization')" [placeholder]="$L.get('Select users')"
64
+ [items]="usernames" [(ngModel)]="data.users_ids" name="users_ids" requireMatch>
65
+ </td-chips>
66
+ </div>
8067 </div>
8168 </form>
8269 </md-card-content>
securis/src/main/webapp/src/app/forms/user.form.component.ts
....@@ -10,8 +10,16 @@
1010 import { FormBase, IComboOption } from './base';
1111 import { ActivatedRoute, Router } from '@angular/router';
1212
13
-var app_example = {
14
-
13
+var user_example = {
14
+ username: 'rym',
15
+ roles: [ 1 ],
16
+ lastLogin: 1488885433000,
17
+ modificationTimestamp: 1479898458000,
18
+ email: 'rbouchair@curistec.com',
19
+ first_name: 'Rym',
20
+ last_name: 'Bouchair',
21
+ creation_timestamp: 1479898458000,
22
+ organizations_ids: [ 1, 2, 5, 6, 7, 8 ]
1523 }
1624
1725 @Component({
....@@ -39,7 +47,7 @@
3947 init() : void {
4048 super.setFirstFocus();
4149 super.reset();
42
- super.prepareInitialData('userId', {
50
+ super.prepareInitialData('username', {
4351 metadata: []
4452 });
4553 }
securis/src/main/webapp/src/app/listing/license.list.component.html
....@@ -45,9 +45,9 @@
4545 <md-icon [style.color]="licenses.getStatusColor(row.status)">brightness_1</md-icon>&nbsp;<span>{{licenses.getStatusName(row.status)}}</span>
4646 </div>
4747 </template>
48
- <template tdDataTableTemplate="email" let-row="row">
49
- <div layout="row">
50
- <a md-button color="primary" [href]="'mailto:' + row.email + '?subject=SeCuris'">{{row.email}}</a>
48
+ <template tdDataTableTemplate="email" let-row="row" let-value="value">
49
+ <div layout="row" *ngIf="value">
50
+ <a md-button color="primary" [href]="'mailto:' + value + '?subject=SeCuris'">{{value}}</a>
5151 </div>
5252 </template>
5353 <template tdDataTableTemplate="expiration_date" let-row="row">
securis/src/main/webapp/src/app/listing/licensetype.list.component.html
....@@ -1,10 +1,10 @@
11 <td-layout-card-over cardWidth="70">
22 <md-toolbar role="toolbar" class="mat-secondary">
33 <span class="push-left-sm">
4
- <span class="md-title" i18n>Applications</span>
4
+ <span class="md-title" i18n>License types</span>
55 </span>
66 <span class="push-left-sm" *ngIf="filteredItems < data.length">
7
- <span class="md-body-1">{{filteredItems}} of {{data.length}} applications filtered</span>
7
+ <span class="md-body-1">{{filteredItems}} of {{data.length}} license types filtered</span>
88 </span>
99 <td-search-box #searchBox class="push-right-sm" placeholder="Search here" (searchDebounce)="search($event)" flex>
1010 </td-search-box>
securis/src/main/webapp/src/app/listing/licensetype.list.component.ts
....@@ -16,18 +16,15 @@
1616 import { ListingBase } from './base';
1717
1818
19
-var app_example = {
20
- code: 'CICS',
21
- creation_timestamp: 1418384439000,
22
- description: 'Wellbore integrity analysis software',
19
+var lt_example = {
2320 id: 1,
24
- license_filename: 'config_server.lic',
25
- name: 'CurisIntegrity',
26
- metadata:
27
- [ { key: 'max_docs',
28
- value: '250000',
29
- readonly: true,
30
- mandatory: true } ]
21
+ code: 'CI01',
22
+ name: 'CI ConfigServer ext',
23
+ application_id: 1,
24
+ application_name: 'CurisIntegrity',
25
+ creation_timestamp: 1418384535000,
26
+ description: 'CI ConfigServer with extended mode and 50 lines',
27
+ metadata: [ { key: 'max_docs', value: '250000', mandatory: true } ]
3128 }
3229
3330 @Component({
....@@ -38,8 +35,8 @@
3835
3936 columns: ITdDataTableColumn[] = [
4037 { name: 'code', label: 'Code', tooltip: 'License type code' },
41
- { name: 'name', label: 'Application name' },
42
- { name: 'creation_timestamp', label: 'Creation date' },
38
+ { name: 'name', label: 'License type name' },
39
+ { name: 'application_name', label: 'Application' },
4340 { name: 'menu', label: '' }
4441 ];
4542
securis/src/main/webapp/src/app/listing/organization.list.component.html
....@@ -1,7 +1,7 @@
11 <td-layout-card-over cardWidth="70">
22 <md-toolbar role="toolbar" class="mat-secondary">
33 <span class="push-left-sm">
4
- <span class="md-title" i18n>Applications</span>
4
+ <span class="md-title" i18n>Organizations</span>
55 </span>
66 <span class="push-left-sm" *ngIf="filteredItems < data.length">
77 <span class="md-body-1">{{filteredItems}} of {{data.length}} applications filtered</span>
securis/src/main/webapp/src/app/listing/organization.list.component.ts
....@@ -16,18 +16,14 @@
1616 import { ListingBase } from './base';
1717
1818
19
-var app_example = {
20
- code: 'CICS',
21
- creation_timestamp: 1418384439000,
22
- description: 'Wellbore integrity analysis software',
19
+var org_example = {
2320 id: 1,
24
- license_filename: 'config_server.lic',
25
- name: 'CurisIntegrity',
26
- metadata:
27
- [ { key: 'max_docs',
28
- value: '250000',
29
- readonly: true,
30
- mandatory: true } ]
21
+ code: 'BP01',
22
+ creation_timestamp: 1418384454000,
23
+ name: 'British Petroleum',
24
+ org_parent_id:2,
25
+ org_parent_name:"CurisTec",
26
+ users_ids: [ 'rym' ]
3127 }
3228
3329 @Component({
....@@ -38,7 +34,7 @@
3834
3935 columns: ITdDataTableColumn[] = [
4036 { name: 'code', label: 'Code', tooltip: 'Organization code' },
41
- { name: 'name', label: 'Application name' },
37
+ { name: 'name', label: 'Organization name' },
4238 { name: 'creation_timestamp', label: 'Creation date' },
4339 { name: 'menu', label: '' }
4440 ];
securis/src/main/webapp/src/app/listing/user.list.component.html
....@@ -1,7 +1,7 @@
11 <td-layout-card-over cardWidth="70">
22 <md-toolbar role="toolbar" class="mat-secondary">
33 <span class="push-left-sm">
4
- <span class="md-title" i18n>Applications</span>
4
+ <span class="md-title" i18n>Users</span>
55 </span>
66 <span class="push-left-sm" *ngIf="filteredItems < data.length">
77 <span class="md-body-1">{{filteredItems}} of {{data.length}} applications filtered</span>
....@@ -20,12 +20,20 @@
2020 [sortBy]="sortBy"
2121 (sortChange)="sort($event)"
2222 style="width: 100%">
23
- <template tdDataTableTemplate="creation_timestamp" let-row="row" let-value="value">
24
- <span>{{value | date: 'medium'}}</span>
23
+ <template tdDataTableTemplate="fullname" let-row="row" let-value="value">
24
+ <span>{{row.first_name}} {{row.last_name || ''}}</span>
25
+ </template>
26
+ <template tdDataTableTemplate="email" let-row="row" let-value="value">
27
+ <div layout="row" *ngIf="value">
28
+ <a md-button color="primary" [href]="'mailto:' + value + '?subject=SeCuris'">{{value}}</a>
29
+ </div>
30
+ </template>
31
+ <template tdDataTableTemplate="lastLogin" let-row="row" let-value="value">
32
+ <span *ngIf="value">{{value | timeAgo }}</span>
2533 </template>
2634 <template tdDataTableTemplate="menu" let-row="row" let-index="index">
2735 <div layout="row" layout-align="end center">
28
- <button md-icon-button (click)="edit(row.id)" color="primary"><md-icon>edit</md-icon></button>
36
+ <button md-icon-button (click)="edit(row.username)" color="primary"><md-icon>edit</md-icon></button>
2937 </div>
3038 </template>
3139 </td-data-table>
securis/src/main/webapp/src/app/listing/user.list.component.ts
....@@ -16,19 +16,15 @@
1616 import { ListingBase } from './base';
1717
1818
19
-var app_example = {
20
- code: 'CICS',
21
- creation_timestamp: 1418384439000,
22
- description: 'Wellbore integrity analysis software',
23
- id: 1,
24
- license_filename: 'config_server.lic',
25
- name: 'CurisIntegrity',
26
- metadata:
27
- [ { key: 'max_docs',
28
- value: '250000',
29
- readonly: true,
30
- mandatory: true } ]
31
-}
19
+var user_example = { username: 'rym',
20
+ roles: [ 1 ],
21
+ lastLogin: 1488885433000,
22
+ modificationTimestamp: 1479898458000,
23
+ email: 'rbouchair@curistec.com',
24
+ first_name: 'Rym',
25
+ last_name: 'Bouchair',
26
+ creation_timestamp: 1479898458000,
27
+ organizations_ids: [ 1, 2, 5, 6, 7, 8 ] }
3228
3329 @Component({
3430 selector: 'user-list',
....@@ -37,9 +33,10 @@
3733 export class UserListComponent extends ListingBase implements AfterViewInit {
3834
3935 columns: ITdDataTableColumn[] = [
40
- { name: 'code', label: 'Code', tooltip: 'Application code' },
41
- { name: 'name', label: 'Application name' },
42
- { name: 'creation_timestamp', label: 'Creation date' },
36
+ { name: 'username', label: 'Username', tooltip: 'Username to access app' },
37
+ { name: 'fullname', label: 'Fullname' },
38
+ { name: 'email', label: 'User email' },
39
+ { name: 'lastLogin', label: 'Last login date' },
4340 { name: 'menu', label: '' }
4441 ];
4542
....@@ -81,8 +78,8 @@
8178 this.router.navigate(['users/create']);
8279 }
8380
84
- edit(eleId: number | string) : void {
85
- this.router.navigate([`users/edit/${eleId}`]);
81
+ edit(username: number | string) : void {
82
+ this.router.navigate([`users/edit/${username}`]);
8683 }
8784
8885 }
securis/src/main/webapp/src/app/menu.component.html
....@@ -13,17 +13,17 @@
1313 <h3 md-line i18n="menu.applications"> </h3>
1414 <p md-line i18n="menu.applications.description"> </p>
1515 </a>
16
- <a routerLink="licesetypes" md-list-item (click)="closeMenu()">
16
+ <a routerLink="/licensetypes" md-list-item (click)="closeMenu()">
1717 <md-icon md-list-avatar>class</md-icon>
1818 <h3 md-line i18n="menu.license_types"> </h3>
1919 <p md-line i18n="menu.license_types.description"> </p>
2020 </a>
21
- <a routerLink="organizations" md-list-item (click)="closeMenu()">
21
+ <a routerLink="/organizations" md-list-item (click)="closeMenu()">
2222 <md-icon md-list-avatar>business</md-icon>
2323 <h3 md-line i18n="menu.organizations"> </h3>
2424 <p md-line i18n="menu.organizations.description"> </p>
2525 </a>
26
- <a routerLink="users" md-list-item (click)="closeMenu()">
26
+ <a routerLink="/users" md-list-item (click)="closeMenu()">
2727 <md-icon md-list-avatar>account_circle</md-icon>
2828 <h3 md-line i18n="menu.users"> </h3>
2929 <p md-line i18n="menu.users.description"> </p>
securis/src/main/webapp/src/app/resources/organizations.ts
....@@ -12,6 +12,7 @@
1212
1313 @Injectable()
1414 export class OrganizationsService extends SeCurisResourceServices {
15
+
1516 constructor(http: Http, $L: LocaleService) {
1617 super($L, http, 'organization');
1718 }
securis/src/main/webapp/src/lang/messages_en.json
....@@ -9,6 +9,7 @@
99 "field.license_preactivation": "License preactivation",
1010 "field.license_type_id": "License type",
1111 "field.organization_id": "Organization",
12
+ "field.application_id": "Application",
1213 "field.licensetype_code": "License type",
1314 "field.organization_name": "Organization",
1415 "field.preactivation_valid_period": "Preactivation valid period",
....@@ -27,6 +28,7 @@
2728 "field.creation_timestamp": "Creation timestamp",
2829 "field.comments": "Comments",
2930 "field.mandatory": "Required",
31
+ "field.org_parent_id": "Parent organization",
3032 "field.name": "Name",
3133 "field.license_filename": "License filename",
3234 "field.description": "Description",