From e9df06df38e90c665c7a14248546401d0bf3941b Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Wed, 22 Mar 2023 09:53:07 +0100 Subject: [PATCH] fix(console): initialize provider options (#5520) fix: provider options initializer --- .../modules/memberships-table/memberships-table.component.ts | 1 - .../policies/secret-generator/secret-generator.component.ts | 1 - .../providers/provider-azure-ad/provider-azure-ad.component.ts | 2 +- .../provider-github-es/provider-github-es.component.ts | 2 +- .../providers/provider-github/provider-github.component.ts | 2 +- .../provider-gitlab-self-hosted.component.ts | 2 +- .../providers/provider-gitlab/provider-gitlab.component.ts | 2 +- .../providers/provider-google/provider-google.component.ts | 2 +- .../modules/providers/provider-jwt/provider-jwt.component.ts | 3 +-- .../providers/provider-oauth/provider-oauth.component.ts | 2 +- .../modules/providers/provider-oidc/provider-oidc.component.ts | 2 +- .../project-grant-detail/project-grant-detail.component.ts | 1 - .../auth-user-detail/edit-dialog/edit-dialog.component.ts | 2 -- .../users/user-detail/user-detail/user-detail.component.ts | 1 - e2e/cypress/support/api/orgs.ts | 1 - 15 files changed, 9 insertions(+), 17 deletions(-) diff --git a/console/src/app/modules/memberships-table/memberships-table.component.ts b/console/src/app/modules/memberships-table/memberships-table.component.ts index f71a1a4724..e7a2ed26b7 100644 --- a/console/src/app/modules/memberships-table/memberships-table.component.ts +++ b/console/src/app/modules/memberships-table/memberships-table.component.ts @@ -105,7 +105,6 @@ export class MembershipsTableComponent implements OnInit, OnDestroy { this.adminService .listIAMMemberRoles() .then((resp) => { - console.log(resp); this.membershipRoleOptions = resp.rolesList; this.loadingRoles = false; }) diff --git a/console/src/app/modules/policies/secret-generator/secret-generator.component.ts b/console/src/app/modules/policies/secret-generator/secret-generator.component.ts index 96e8da99ec..1bae7b67e5 100644 --- a/console/src/app/modules/policies/secret-generator/secret-generator.component.ts +++ b/console/src/app/modules/policies/secret-generator/secret-generator.component.ts @@ -38,7 +38,6 @@ export class SecretGeneratorComponent implements OnInit { .then((generators) => { if (generators.resultList) { this.generators = generators.resultList; - console.log(this.generators); } }) .catch((error) => { diff --git a/console/src/app/modules/providers/provider-azure-ad/provider-azure-ad.component.ts b/console/src/app/modules/providers/provider-azure-ad/provider-azure-ad.component.ts index 816171f8b0..e572f4e48f 100644 --- a/console/src/app/modules/providers/provider-azure-ad/provider-azure-ad.component.ts +++ b/console/src/app/modules/providers/provider-azure-ad/provider-azure-ad.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderAzureADComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT; private service!: ManagementService | AdminService; diff --git a/console/src/app/modules/providers/provider-github-es/provider-github-es.component.ts b/console/src/app/modules/providers/provider-github-es/provider-github-es.component.ts index 086bdd9a22..1e26d5e28f 100644 --- a/console/src/app/modules/providers/provider-github-es/provider-github-es.component.ts +++ b/console/src/app/modules/providers/provider-github-es/provider-github-es.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderGithubESComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public updateClientSecret: boolean = false; diff --git a/console/src/app/modules/providers/provider-github/provider-github.component.ts b/console/src/app/modules/providers/provider-github/provider-github.component.ts index 5524079d9f..28f4757f49 100644 --- a/console/src/app/modules/providers/provider-github/provider-github.component.ts +++ b/console/src/app/modules/providers/provider-github/provider-github.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderGithubComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT; private service!: ManagementService | AdminService; diff --git a/console/src/app/modules/providers/provider-gitlab-self-hosted/provider-gitlab-self-hosted.component.ts b/console/src/app/modules/providers/provider-gitlab-self-hosted/provider-gitlab-self-hosted.component.ts index 8ec7503ccc..1b5ea437be 100644 --- a/console/src/app/modules/providers/provider-gitlab-self-hosted/provider-gitlab-self-hosted.component.ts +++ b/console/src/app/modules/providers/provider-gitlab-self-hosted/provider-gitlab-self-hosted.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderGitlabSelfHostedComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT; private service!: ManagementService | AdminService; diff --git a/console/src/app/modules/providers/provider-gitlab/provider-gitlab.component.ts b/console/src/app/modules/providers/provider-gitlab/provider-gitlab.component.ts index 65f5fe3381..295c77acde 100644 --- a/console/src/app/modules/providers/provider-gitlab/provider-gitlab.component.ts +++ b/console/src/app/modules/providers/provider-gitlab/provider-gitlab.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderGitlabComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT; private service!: ManagementService | AdminService; diff --git a/console/src/app/modules/providers/provider-google/provider-google.component.ts b/console/src/app/modules/providers/provider-google/provider-google.component.ts index c7744bb010..3515c0553e 100644 --- a/console/src/app/modules/providers/provider-google/provider-google.component.ts +++ b/console/src/app/modules/providers/provider-google/provider-google.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderGoogleComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT; private service!: ManagementService | AdminService; diff --git a/console/src/app/modules/providers/provider-jwt/provider-jwt.component.ts b/console/src/app/modules/providers/provider-jwt/provider-jwt.component.ts index 5d7deffe74..cf82a3289f 100644 --- a/console/src/app/modules/providers/provider-jwt/provider-jwt.component.ts +++ b/console/src/app/modules/providers/provider-jwt/provider-jwt.component.ts @@ -29,7 +29,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderJWTComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT; @@ -50,7 +50,6 @@ export class ProviderJWTComponent { ) { this.route.data.pipe(take(1)).subscribe((data) => { this.serviceType = data.serviceType; - console.log(data.serviceType); switch (this.serviceType) { case PolicyComponentServiceType.MGMT: diff --git a/console/src/app/modules/providers/provider-oauth/provider-oauth.component.ts b/console/src/app/modules/providers/provider-oauth/provider-oauth.component.ts index ed78221246..598b84573a 100644 --- a/console/src/app/modules/providers/provider-oauth/provider-oauth.component.ts +++ b/console/src/app/modules/providers/provider-oauth/provider-oauth.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderOAuthComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public updateClientSecret: boolean = false; diff --git a/console/src/app/modules/providers/provider-oidc/provider-oidc.component.ts b/console/src/app/modules/providers/provider-oidc/provider-oidc.component.ts index 6d5cbb5e0c..edfeaf3639 100644 --- a/console/src/app/modules/providers/provider-oidc/provider-oidc.component.ts +++ b/console/src/app/modules/providers/provider-oidc/provider-oidc.component.ts @@ -30,7 +30,7 @@ import { PolicyComponentServiceType } from '../../policies/policy-component-type }) export class ProviderOIDCComponent { public showOptional: boolean = false; - public options: Options = new Options(); + public options: Options = new Options().setIsCreationAllowed(true).setIsLinkingAllowed(true); public id: string | null = ''; public updateClientSecret: boolean = false; diff --git a/console/src/app/pages/projects/owned-projects/project-grant-detail/project-grant-detail.component.ts b/console/src/app/pages/projects/owned-projects/project-grant-detail/project-grant-detail.component.ts index 2cc2870906..bb8be7939d 100644 --- a/console/src/app/pages/projects/owned-projects/project-grant-detail/project-grant-detail.component.ts +++ b/console/src/app/pages/projects/owned-projects/project-grant-detail/project-grant-detail.component.ts @@ -70,7 +70,6 @@ export class ProjectGrantDetailComponent { this.mgmtService .getProjectGrantByID(this.grantid, this.projectid) .then((resp) => { - console.log(resp); if (resp.projectGrant) { this.grant = resp.projectGrant; diff --git a/console/src/app/pages/users/user-detail/auth-user-detail/edit-dialog/edit-dialog.component.ts b/console/src/app/pages/users/user-detail/auth-user-detail/edit-dialog/edit-dialog.component.ts index 6b20ad86de..994cdce4dc 100644 --- a/console/src/app/pages/users/user-detail/auth-user-detail/edit-dialog/edit-dialog.component.ts +++ b/console/src/app/pages/users/user-detail/auth-user-detail/edit-dialog/edit-dialog.component.ts @@ -41,12 +41,10 @@ export class EditDialogComponent implements OnInit { } public setCountryCallingCode(): void { - console.log(this); let value = (this.dialogForm.controls[this.controlKey]?.value as string) || ''; this.countryPhoneCodes.forEach((code) => (value = value.replace(`+${code.countryCallingCode}`, ''))); value = value.trim(); this.dialogForm.controls[this.controlKey]?.setValue('+' + this.selected?.countryCallingCode + ' ' + value); - console.log(this); } ngOnInit(): void { diff --git a/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts b/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts index 163c8c6f11..7ff56cbc47 100644 --- a/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts +++ b/console/src/app/pages/users/user-detail/user-detail/user-detail.component.ts @@ -198,7 +198,6 @@ export class UserDetailComponent implements OnInit { .generateMachineSecret(this.user.id) .then((resp) => { this.toast.showInfo('USER.TOAST.SECRETGENERATED', true); - console.log(resp.clientSecret); this.dialog.open(MachineSecretDialogComponent, { data: { clientId: resp.clientId, diff --git a/e2e/cypress/support/api/orgs.ts b/e2e/cypress/support/api/orgs.ts index 6af76560a9..1a54e141b3 100644 --- a/e2e/cypress/support/api/orgs.ts +++ b/e2e/cypress/support/api/orgs.ts @@ -26,7 +26,6 @@ export function ensureOrgExists(ctx: Context, name: string) { } export function isDefaultOrg(ctx: Context, orgId: string): Cypress.Chainable { - console.log('huhu', orgId); return cy .request({ method: 'GET',