diff --git a/console/src/app/pages/orgs/orgs.module.ts b/console/src/app/pages/orgs/orgs.module.ts index bedf02ab8..01e629540 100644 --- a/console/src/app/pages/orgs/orgs.module.ts +++ b/console/src/app/pages/orgs/orgs.module.ts @@ -9,6 +9,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatMenuModule } from '@angular/material/menu'; +import { MatTabsModule } from '@angular/material/tabs'; import { MatTooltipModule } from '@angular/material/tooltip'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { HttpLoaderFactory } from 'src/app/app.module'; @@ -40,6 +41,7 @@ import { PolicyGridComponent } from './policy-grid/policy-grid.component'; ReactiveFormsModule, MatButtonToggleModule, MetaLayoutModule, + MatTabsModule, MatTooltipModule, MatMenuModule, ChangesModule, diff --git a/console/src/app/pages/project-role-create/project-role-create.component.html b/console/src/app/pages/project-role-create/project-role-create.component.html index db04b6bf3..732a38aa8 100644 --- a/console/src/app/pages/project-role-create/project-role-create.component.html +++ b/console/src/app/pages/project-role-create/project-role-create.component.html @@ -18,8 +18,8 @@ {{ 'PROJECT.ROLE.KEY' | translate }} - {{'ERRORS.REQUIRED' | translate}} - + {{ 'PROJECT.ROLE.DISPLAY_NAME' | translate }} diff --git a/console/src/app/pages/project-role-create/project-role-create.component.ts b/console/src/app/pages/project-role-create/project-role-create.component.ts index 27ac9e13d..7e7be8e33 100644 --- a/console/src/app/pages/project-role-create/project-role-create.component.ts +++ b/console/src/app/pages/project-role-create/project-role-create.component.ts @@ -1,7 +1,7 @@ import { animate, animateChild, query, stagger, style, transition, trigger } from '@angular/animations'; import { Location } from '@angular/common'; import { Component, OnDestroy, OnInit } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormArray, FormControl, FormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { Subscription } from 'rxjs'; import { ProjectRoleAdd } from 'src/app/proto/generated/management_pb'; @@ -47,11 +47,9 @@ export class ProjectRoleCreateComponent implements OnInit, OnDestroy { private toast: ToastService, private projectService: ProjectService, private _location: Location, - private fb: FormBuilder, ) { this.formGroup = new FormGroup({ key: new FormControl('', [Validators.required]), - // name: new FormControl(''), displayName: new FormControl(''), group: new FormControl('', [Validators.required]), }); @@ -61,7 +59,7 @@ export class ProjectRoleCreateComponent implements OnInit, OnDestroy { public addEntry(): void { const newGroup = new FormGroup({ - name: new FormControl(''), + key: new FormControl(''), displayName: new FormControl(''), group: new FormControl('', [Validators.required]), }); @@ -86,11 +84,13 @@ export class ProjectRoleCreateComponent implements OnInit, OnDestroy { } public addRole(): void { - Promise.all(this.formArray.value.map((role: ProjectRoleAdd.AsObject) => { + const promises = this.formArray.value.map((role: ProjectRoleAdd.AsObject) => { role.id = this.projectId; console.log(role); return this.projectService.AddProjectRole(role); - })).then(() => { + }); + + Promise.all(promises).then(() => { this.router.navigate(['projects', this.projectId]); }).catch(data => { console.log(data); diff --git a/console/src/app/pages/projects/granted-project-detail/granted-project-detail.component.html b/console/src/app/pages/projects/granted-project-detail/granted-project-detail.component.html index 12a6ca303..7711623c8 100644 --- a/console/src/app/pages/projects/granted-project-detail/granted-project-detail.component.html +++ b/console/src/app/pages/projects/granted-project-detail/granted-project-detail.component.html @@ -31,6 +31,16 @@ - + + + + + + + + + \ No newline at end of file diff --git a/console/src/app/pages/projects/owned-project-detail/owned-project-detail.component.html b/console/src/app/pages/projects/owned-project-detail/owned-project-detail.component.html index 7d2ead03b..0835319de 100644 --- a/console/src/app/pages/projects/owned-project-detail/owned-project-detail.component.html +++ b/console/src/app/pages/projects/owned-project-detail/owned-project-detail.component.html @@ -88,10 +88,10 @@ - - + diff --git a/console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.html b/console/src/app/pages/projects/project-contributors/project-contributors.component.html similarity index 100% rename from console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.html rename to console/src/app/pages/projects/project-contributors/project-contributors.component.html diff --git a/console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.scss b/console/src/app/pages/projects/project-contributors/project-contributors.component.scss similarity index 100% rename from console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.scss rename to console/src/app/pages/projects/project-contributors/project-contributors.component.scss diff --git a/console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.spec.ts b/console/src/app/pages/projects/project-contributors/project-contributors.component.spec.ts similarity index 55% rename from console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.spec.ts rename to console/src/app/pages/projects/project-contributors/project-contributors.component.spec.ts index 943cc7a23..27702fb8f 100644 --- a/console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.spec.ts +++ b/console/src/app/pages/projects/project-contributors/project-contributors.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { OwnedProjectContributorsComponent } from './owned-project-contributors.component'; +import { ProjectContributorsComponent } from './project-contributors.component'; describe('ProjectContributorsComponent', () => { - let component: OwnedProjectContributorsComponent; - let fixture: ComponentFixture; + let component: ProjectContributorsComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [OwnedProjectContributorsComponent], + declarations: [ProjectContributorsComponent], }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(OwnedProjectContributorsComponent); + fixture = TestBed.createComponent(ProjectContributorsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.ts b/console/src/app/pages/projects/project-contributors/project-contributors.component.ts similarity index 91% rename from console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.ts rename to console/src/app/pages/projects/project-contributors/project-contributors.component.ts index e6378fca2..5d1832129 100644 --- a/console/src/app/pages/projects/owned-project-contributors/owned-project-contributors.component.ts +++ b/console/src/app/pages/projects/project-contributors/project-contributors.component.ts @@ -5,6 +5,7 @@ import { BehaviorSubject, from, of } from 'rxjs'; import { catchError, finalize, map } from 'rxjs/operators'; import { User } from 'src/app/proto/generated/auth_pb'; import { + ProjectGrantView, ProjectMemberSearchResponse, ProjectMemberView, ProjectState, @@ -20,12 +21,12 @@ import { } from '../../../modules/add-member-dialog/member-create-dialog.component'; @Component({ - selector: 'app-owned-project-contributors', - templateUrl: './owned-project-contributors.component.html', - styleUrls: ['./owned-project-contributors.component.scss'], + selector: 'app-project-contributors', + templateUrl: './project-contributors.component.html', + styleUrls: ['./project-contributors.component.scss'], }) -export class OwnedProjectContributorsComponent implements OnInit { - @Input() public project!: ProjectView.AsObject; +export class ProjectContributorsComponent implements OnInit { + @Input() public project!: ProjectView.AsObject | ProjectGrantView.AsObject; @Input() public projectType!: ProjectType; @Input() public disabled: boolean = false; diff --git a/console/src/app/pages/projects/projects.module.ts b/console/src/app/pages/projects/projects.module.ts index 59b6998cd..a10d1b4ae 100644 --- a/console/src/app/pages/projects/projects.module.ts +++ b/console/src/app/pages/projects/projects.module.ts @@ -33,12 +33,12 @@ import { UserListModule } from '../user-list/user-list.module'; import { GrantedProjectDetailComponent } from './granted-project-detail/granted-project-detail.component'; import { GrantedProjectGridComponent } from './granted-project-grid/granted-project-grid.component'; import { GrantedProjectListComponent } from './granted-project-list/granted-project-list.component'; -import { OwnedProjectContributorsComponent } from './owned-project-contributors/owned-project-contributors.component'; import { OwnedProjectDetailComponent } from './owned-project-detail/owned-project-detail.component'; import { OwnedProjectGridComponent } from './owned-project-grid/owned-project-grid.component'; import { OwnedProjectListComponent } from './owned-project-list/owned-project-list.component'; import { ProjectApplicationGridComponent } from './project-application-grid/project-application-grid.component'; import { ProjectApplicationsComponent } from './project-applications/project-applications.component'; +import { ProjectContributorsComponent } from './project-contributors/project-contributors.component'; import { ProjectGrantMembersCreateDialogComponent, } from './project-grant-members-create-dialog/project-grant-members-create-dialog.component'; @@ -62,7 +62,7 @@ import { ProjectsComponent } from './projects.component'; ProjectGrantsComponent, ProjectGrantMembersComponent, ProjectGrantMembersCreateDialogComponent, - OwnedProjectContributorsComponent, + ProjectContributorsComponent, ProjectsComponent, ], imports: [ diff --git a/console/src/app/pages/user-create/user-create.component.ts b/console/src/app/pages/user-create/user-create.component.ts index bdde64e30..79689e226 100644 --- a/console/src/app/pages/user-create/user-create.component.ts +++ b/console/src/app/pages/user-create/user-create.component.ts @@ -38,11 +38,6 @@ export class UserCreateComponent implements OnDestroy { region: [''], country: [''], }); - if (this.email) { - this.sub = this.email?.valueChanges.subscribe(value => { - this.userName?.setValue(value); - }); - } } public createUser(): void { diff --git a/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.html b/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.html index 4365ba999..7428383d5 100644 --- a/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.html +++ b/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.html @@ -68,16 +68,16 @@
-
+
{{ 'USER.EMAIL' | translate }}
- {{email.email}} - {{email?.email}} + check_circle_outline - + highlight_off
-
+
{{ 'USER.PHONE' | translate }} @@ -150,7 +150,7 @@ - +
diff --git a/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.ts b/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.ts index 94cbd8b90..c5d3df94a 100644 --- a/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.ts +++ b/console/src/app/pages/user-detail/auth-user-detail/auth-user-detail.component.ts @@ -33,9 +33,9 @@ function passwordConfirmValidator(c: AbstractControl): any { }) export class AuthUserDetailComponent implements OnDestroy { public profile!: UserProfile.AsObject; - public email!: UserEmail.AsObject; - public phone!: UserPhone.AsObject; - public address!: UserAddress.AsObject; + public email: UserEmail.AsObject = { email: '' } as any; + public phone: UserPhone.AsObject = { phone: '' } as any; + public address: UserAddress.AsObject = { id: '' } as any; public genders: Gender[] = [Gender.GENDER_MALE, Gender.GENDER_FEMALE, Gender.GENDER_DIVERSE]; public languages: string[] = ['de', 'en']; @@ -150,6 +150,8 @@ export class AuthUserDetailComponent implements OnDestroy { } public saveEmail(): void { + this.emailEditState = false; + this.userService .SaveMyUserEmail(this.email).then((data: UserEmail) => { this.toast.showInfo('Saved Email'); @@ -211,6 +213,10 @@ export class AuthUserDetailComponent implements OnDestroy { } public savePhone(): void { + this.phoneEditState = false; + if (!this.phone.id) { + this.phone.id = this.profile.id; + } this.userService .SaveMyUserPhone(this.phone).then((data: UserPhone) => { this.toast.showInfo('Saved Phone'); diff --git a/console/src/app/pages/user-detail/user-detail/user-detail.component.html b/console/src/app/pages/user-detail/user-detail/user-detail.component.html index 3a5b24a93..e3c57b6f5 100644 --- a/console/src/app/pages/user-detail/user-detail/user-detail.component.html +++ b/console/src/app/pages/user-detail/user-detail/user-detail.component.html @@ -67,16 +67,16 @@
-
+
{{ 'USER.EMAIL' | translate }} -
+
{{ 'USER.PHONE' | translate }}
- {{phone.phone}} - {{phone?.phone}} + check_circle_outline - + highlight_off @@ -125,7 +125,7 @@ -
@@ -148,7 +148,7 @@ - +
diff --git a/console/src/app/pages/user-detail/user-detail/user-detail.component.ts b/console/src/app/pages/user-detail/user-detail/user-detail.component.ts index 54ee764a5..b161e713a 100644 --- a/console/src/app/pages/user-detail/user-detail/user-detail.component.ts +++ b/console/src/app/pages/user-detail/user-detail/user-detail.component.ts @@ -44,9 +44,9 @@ function passwordConfirmValidator(c: AbstractControl): any { }) export class UserDetailComponent implements OnInit, OnDestroy { public profile!: UserProfile.AsObject; - public email!: UserEmail.AsObject; - public phone!: UserPhone.AsObject; - public address!: UserAddress.AsObject; + public email: UserEmail.AsObject = { email: '' } as any; + public phone: UserPhone.AsObject = { phone: '' } as any; + public address: UserAddress.AsObject = { id: '' } as any; public genders: Gender[] = [Gender.GENDER_MALE, Gender.GENDER_FEMALE, Gender.GENDER_DIVERSE]; public languages: string[] = ['de', 'en']; @@ -222,6 +222,9 @@ export class UserDetailComponent implements OnInit, OnDestroy { public savePhone(): void { this.phoneEditState = false; + if (!this.phone.id) { + this.phone.id = this.profile.id; + } this.mgmtUserService .SaveUserPhone(this.phone).then((data: UserPhone) => { this.toast.showInfo('Saved Phone'); @@ -232,6 +235,10 @@ export class UserDetailComponent implements OnInit, OnDestroy { } public saveAddress(): void { + if (!this.address.id) { + this.address.id = this.profile.id; + } + this.address.streetAddress = this.streetAddress?.value; this.address.postalCode = this.postalCode?.value; this.address.locality = this.locality?.value; diff --git a/console/src/assets/i18n/de.json b/console/src/assets/i18n/de.json index 4d4bd6249..dd6c376a2 100644 --- a/console/src/assets/i18n/de.json +++ b/console/src/assets/i18n/de.json @@ -296,8 +296,8 @@ }, "NAME": "Name", "MEMBER": { - "TITLE": "Mitwirkende", - "TITLEDESC":"Mitwirkende können Änderungen an dieser Entität vornehmen", + "TITLE": "Manager", + "TITLEDESC":"Manager können Änderungen an dieser Entität vornehmen", "DESCRIPTION":"Hier finden Sie alle Mitwirkenden dieses Projekts. Sie können ein neues Mitglied hinzufügen und bestehende verwalten.", "USERNAME": "Benutzername", "FIRSTNAME": "Vorname", diff --git a/console/src/assets/i18n/en.json b/console/src/assets/i18n/en.json index ed492b642..6859205a4 100644 --- a/console/src/assets/i18n/en.json +++ b/console/src/assets/i18n/en.json @@ -296,9 +296,9 @@ }, "NAME": "Name", "MEMBER": { - "TITLE": "Contributors", - "TITLEDESC":"Contributors can make changes on this very entity", - "DESCRIPTION":"Here you can find all contributors of this project. You can add a new member and manage persisting ones.", + "TITLE": "Managers", + "TITLEDESC":"Managers can make changes on this very entity, based on their given role in zitadel.", + "DESCRIPTION":"Here you can find all managers of this project. You can add a new member and manage persisting ones.", "USERNAME": "Username", "FIRSTNAME": "Firstname", "LASTNAME": "Lastname",