Skip to content

Commit 608b0ad

Browse files
(feat) angular migration- groups
1 parent 99a2eb7 commit 608b0ad

File tree

45 files changed

+2909
-1656
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2909
-1656
lines changed

gravitee-apim-console-webui/src/app.module.ajs.ts

-9
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ import PlatformLogsComponentAjs from './management/analytics/logs/platform-logs.
121121
import PlatformLogComponentAjs from './management/analytics/logs/platform-log.component.ajs';
122122

123123
import CategoryService from './services/category.service';
124-
import DialogAddGroupMemberController from './management/settings/groups/group/addMemberDialog.controller';
125124
import SubscriptionService from './services/subscription.service';
126125
import EmptyStateDirective from './components/emptystate/emptystate.directive';
127126
import TagService from './services/tag.service';
@@ -156,9 +155,6 @@ import { ApiAuditComponentAjs } from './management/api/audit/general/audit.compo
156155
import AuditComponent from './components/audit/audit.component';
157156
// Configuration
158157
import PortalSettingsService from './services/portalSettings.service';
159-
// Groups
160-
import GroupsComponentAjs from './management/settings/groups/groups.component.ajs';
161-
import GroupComponentAjs from './management/settings/groups/group/group.component.ajs';
162158
import GroupService from './services/group.service';
163159
// Dictionaries
164160
import DictionaryService from './services/dictionary.service';
@@ -240,7 +236,6 @@ import { ApiAlertsDashboardComponentAjs } from './management/api/analytics/alert
240236

241237
import { markedHighlight } from 'marked-highlight';
242238
import { downgradeInjectable } from '@angular/upgrade/static';
243-
import DialogTransferOwnershipController from './management/settings/groups/group/transferOwnershipDialog.controller';
244239
import ApiKeysComponent from './management/application/components/api-key/api-keys.component';
245240
import ApiKeysController from './management/application/components/api-key/api-keys.controller';
246241
import { IfMatchEtagInterceptor } from './shared/interceptors/if-match-etag.interceptor';
@@ -449,10 +444,6 @@ graviteeManagementModule.component('analyticsDashboardComponentAjs', AnalyticsDa
449444
graviteeManagementModule.component('gvAlertDashboard', AlertsDashboardComponent);
450445
graviteeManagementModule.component('alertsActivityComponentAjs', AlertsActivityComponentAjs);
451446
graviteeManagementModule.component('apiAlertsDashboardComponentAjs', ApiAlertsDashboardComponentAjs);
452-
graviteeManagementModule.component('settingsGroupsAjs', GroupsComponentAjs);
453-
graviteeManagementModule.component('settingsGroupEditAjs', GroupComponentAjs);
454-
graviteeManagementModule.controller('DialogAddGroupMemberController', DialogAddGroupMemberController);
455-
graviteeManagementModule.controller('DialogTransferOwnershipController', DialogTransferOwnershipController);
456447
graviteeManagementModule.controller('FileChooserDialogController', FileChooserDialogController);
457448
graviteeManagementModule.controller('DialogConfirmController', DialogConfirmController);
458449
graviteeManagementModule.controller('DialogConfirmAndValidateController', DialogConfirmAndValidateController);

gravitee-apim-console-webui/src/entities/consoleSettings.ts

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface ConsoleSettings {
3333
trialInstance?: ConsoleSettingsTrialInstance;
3434
federation?: ConsoleSettingsFederation;
3535
cloudHosted?: ConsoleSettingsCloudHosted;
36+
userGroups?: ConsoleSettingsUserGroups;
3637
}
3738

3839
export interface ConsoleSettingsEmail {
@@ -187,3 +188,7 @@ export interface ConsoleSettingsFederation {
187188
export interface ConsoleSettingsCloudHosted {
188189
enabled?: boolean;
189190
}
191+
192+
interface ConsoleSettingsUserGroups {
193+
required?: boolean;
194+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
export interface Invitation {
18+
id?: string;
19+
reference_type?: string;
20+
reference_id: string;
21+
email: string;
22+
api_role?: string;
23+
application_role?: string;
24+
}

gravitee-apim-console-webui/src/index.scss

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
@import 'management/api/api';
4545
@import 'management/analytics';
4646
@import 'management/settings/portal-theme/portal-theme';
47-
@import 'management/settings/groups/group/group';
4847
@import 'management/datatable';
4948
@import 'management/forms';
5049
@import 'management/stepper';

gravitee-apim-console-webui/src/management/settings/groups/_groups.scss

-3
This file was deleted.

gravitee-apim-console-webui/src/management/settings/groups/group/_group.scss

-23
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!--
2+
3+
Copyright (C) 2015 The Gravitee team (http://gravitee.io)
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
-->
18+
<h2 mat-dialog-title>Add members</h2>
19+
<mat-dialog-content>
20+
<form [formGroup]="addMemberForm" class="add-member__form">
21+
<mat-form-field aria-hidden="false" aria-label="Select default API role">
22+
<mat-label>Default API Role</mat-label>
23+
<mat-select [disabled]="!canChangeDefaultAPIRole()" formControlName="defaultAPIRole">
24+
<mat-option *ngFor="let role of defaultAPIRoles" [value]="role.name" [disabled]="isAPIRoleDisabled(role)"
25+
>{{ role.name }}
26+
</mat-option>
27+
</mat-select>
28+
</mat-form-field>
29+
30+
<mat-form-field aria-hidden="false" aria-label="Select default application role">
31+
<mat-label>Default Application Role</mat-label>
32+
<mat-select [disabled]="!canChangeDefaultApplicationRole()" formControlName="defaultApplicationRole">
33+
<mat-option *ngFor="let role of defaultApplicationRoles" [value]="role.name" [disabled]="role.system">{{ role.name }} </mat-option>
34+
</mat-select>
35+
</mat-form-field>
36+
37+
<mat-form-field aria-hidden="false" aria-label="Select default integration role">
38+
<mat-label>Default Integration Role</mat-label>
39+
<mat-select [disabled]="!canChangeDefaultIntegrationRole()" formControlName="defaultIntegrationRole">
40+
<mat-option *ngFor="let role of defaultIntegrationRoles" [value]="role.name" [disabled]="role.system">{{ role.name }} </mat-option>
41+
</mat-select>
42+
</mat-form-field>
43+
44+
<mat-form-field appearance="outline" *ngIf="!isAnotherMemberPrimaryOwner()">
45+
<mat-label>Search Users</mat-label>
46+
<input matInput formControlName="searchTerm" [matAutocomplete]="auto" />
47+
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectUser($event)">
48+
<mat-option *ngFor="let user of filteredUsers$ | async" [value]="user">
49+
{{ user.displayName }}
50+
</mat-option>
51+
</mat-autocomplete>
52+
53+
<mat-hint *ngIf="selectedUsers.length === 0">{{ 'Please search users to add to the group' }}</mat-hint>
54+
</mat-form-field>
55+
56+
<mat-error *ngIf="isAnotherMemberPrimaryOwner()"
57+
>There is already a member with default API role as primary owner. Please select another default API role to continue. Ownership can
58+
be transferred while editing the group members.
59+
</mat-error>
60+
61+
<mat-list role="list">
62+
<mat-list-item *ngFor="let user of selectedUsers">
63+
{{ user.displayName }} <button mat-button (click)="deselectUser(user)"><mat-icon svgIcon="gio:trash"></mat-icon></button>
64+
</mat-list-item>
65+
</mat-list>
66+
</form>
67+
68+
<mat-dialog-actions style="justify-content: flex-end">
69+
<button mat-raised-button color="primary" [disabled]="isFormInvalid()" (click)="addMembers()">Add Users</button>
70+
<button mat-raised-button mat-dialog-close>Cancel</button>
71+
</mat-dialog-actions>
72+
</mat-dialog-content>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@use 'sass:map';
2+
@use '@angular/material' as mat;
3+
@use '@gravitee/ui-particles-angular' as gio;
4+
@use '../../../../../scss/gio-layout' as gio-layout;
5+
6+
$typography: map.get(gio.$mat-theme, typography);
7+
8+
:host {
9+
@include gio-layout.gio-responsive-margin-container;
10+
}
11+
12+
.add-member {
13+
&__form {
14+
display: flex;
15+
flex-direction: column;
16+
}
17+
}
18+
19+
.cdk-overlay-container {
20+
position: fixed;
21+
top: 0;
22+
left: 0;
23+
width: 100%;
24+
height: 100%;
25+
}
26+
27+
.cdk-overlay-backdrop {
28+
backdrop-filter: blur(5px);
29+
background: rgba(0, 0, 0, 0.5);
30+
}
31+
32+
.cdk-overlay-backdrop {
33+
pointer-events: auto;
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import { ComponentFixture, TestBed } from '@angular/core/testing';
17+
18+
import { AddMembersDialogComponent } from './add-members-dialog.component';
19+
20+
describe('AddMembersDialogComponent', () => {
21+
let component: AddMembersDialogComponent;
22+
let fixture: ComponentFixture<AddMembersDialogComponent>;
23+
24+
beforeEach(async () => {
25+
await TestBed.configureTestingModule({
26+
imports: [AddMembersDialogComponent],
27+
}).compileComponents();
28+
29+
fixture = TestBed.createComponent(AddMembersDialogComponent);
30+
component = fixture.componentInstance;
31+
fixture.detectChanges();
32+
});
33+
34+
it('should create', () => {
35+
expect(component).toBeTruthy();
36+
});
37+
});

0 commit comments

Comments
 (0)