From e9fb489288626263ac61416b0cca3f8777ac09d0 Mon Sep 17 00:00:00 2001 From: Julien WITTOUCK Date: Fri, 1 Jul 2022 14:43:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9B=20:=20rename=20Team=20to=20Organiz?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/app/pages/dashboard/dashboard.vue | 8 ++-- src/main/client/app/pages/modules/module.vue | 14 +++--- .../client/app/pages/users/organizations.vue | 8 ++-- src/main/client/app/pages/users/user-edit.vue | 16 +++---- src/main/client/app/pages/users/user-new.vue | 16 +++---- src/main/client/app/pages/users/users.vue | 8 ++-- .../app/shared/api/organizations-api.js | 7 +++ src/main/client/app/shared/api/teams-api.js | 7 --- .../AuthenticationRestController.kt | 2 +- .../config/SpringSecurityUserAuditorAware.kt | 4 +- .../config/security/AuthenticationHandler.kt | 4 +- .../config/security/SecurityConfig.kt | 4 +- .../security/oauth2/OAuth2SuccessHandler.kt | 6 +-- .../io/gaia_app/credentials/Credentials.kt | 2 +- .../credentials/CredentialsRepository.kt | 2 +- .../CredentialsRestController.java | 2 +- .../credentials/CredentialsService.kt | 2 +- .../controller/DashboardRestController.kt | 14 +++--- .../io/gaia_app/modules/bo/ModuleMetadata.kt | 2 +- .../gaia_app/modules/bo/TerraformModule.java | 16 +++---- .../controller/ModuleRestController.java | 6 +-- .../repository/TerraformModuleRepository.kt | 8 ++-- .../AdminUserInitialization.java | 2 +- .../{teams => organizations}/UserService.kt | 4 +- .../gaia_app/{teams => organizations}/bo.kt | 8 ++-- .../OrganizationsRestController.java | 39 ++++++++++++++++ .../controller/UserControllerAdvice.java | 12 ++--- .../controller/UsersRestController.java | 6 +-- .../repository/OrganizationsRepository.java | 9 ++++ .../repository/UserRepository.kt | 4 +- .../registries/AbstractRegistryApi.kt | 2 +- .../io/gaia_app/registries/RegistryApi.kt | 2 +- .../registries/RegistryOAuth2Provider.java | 2 +- .../controller/GithubRegistryController.kt | 2 +- .../controller/GitlabRegistryController.kt | 2 +- .../registries/service/RegistryService.kt | 2 +- src/main/java/io/gaia_app/stacks/bo/Job.java | 2 +- .../java/io/gaia_app/stacks/bo/Stack.java | 14 +++--- .../controller/StackRestController.java | 16 +++---- .../stacks/repository/StackRepository.kt | 12 ++--- .../teams/controller/TeamsRestController.java | 39 ---------------- .../teams/repository/TeamRepository.java | 9 ---- .../gaia_app/vault/VaultCredentialsService.kt | 2 +- .../AuthenticationRestControllerIT.kt | 4 +- .../AuthenticationRestControllerTest.kt | 2 +- .../security/AuthenticationHandlerTest.kt | 6 +-- .../config/security/SecurityConfigIT.kt | 5 +-- .../oauth2/OAuth2SuccessHandlerTest.kt | 8 ++-- .../CredentialsRestControllerIT.java | 2 +- .../CredentialsRestControllerVaultIT.java | 2 +- .../PlainCredentialsServiceTest.kt | 2 +- .../controller/DashboardRestControllerTest.kt | 28 ++++++------ .../e2e/CucumberContextConfiguration.java | 2 +- .../modules/bo/TerraformModuleTest.java | 16 +++---- .../controller/ModuleRestControllerIT.java | 12 ++--- .../controller/ModuleRestControllerTest.java | 22 +++++----- .../TerraformModuleRepositoryIT.java | 14 +++--- .../AdminUserInitializationTest.kt | 8 +--- .../OrganizationsRestControllerIT.java} | 44 +++++++++---------- .../OrganizationsRestControllerTest.java | 39 ++++++++++++++++ .../controller/UserControllerAdviceTest.java | 18 ++++---- .../controller/UsersRestControllerIT.java | 28 ++++++------ .../controller/UsersRestControllerTest.java | 6 +-- .../repository/UserRepositoryIT.kt | 8 ++-- .../controller/GithubRegistryControllerIT.kt | 4 +- .../GithubRegistryControllerTest.kt | 2 +- .../controller/GitlabRegistryControllerIT.kt | 4 +- .../GitlabRegistryControllerTest.kt | 2 +- .../github/GitHubRawContentTest.java | 4 +- .../github/GithubRegistryApiTest.kt | 4 +- .../gitlab/GitLabRawContentTest.java | 4 +- .../gitlab/GitlabRegistryApiTest.kt | 4 +- .../service/RegistryServiceImplTest.kt | 2 +- .../runner/RunnerCommandBuilderTest.java | 4 +- .../gaia_app/runner/RunnerControllerIT.java | 2 +- .../java/io/gaia_app/stacks/bo/JobTest.java | 2 +- .../controller/StackRestControllerIT.java | 16 +++---- .../controller/StackRestControllerTest.java | 38 ++++++++-------- .../stacks/repository/StackRepositoryIT.java | 28 ++++++------ .../controller/TeamsRestControllerTest.java | 39 ---------------- src/test/resources/db/00_organization.js | 13 ++++++ src/test/resources/db/00_team.js | 13 ------ src/test/resources/db/10_user.js | 4 +- src/test/resources/db/20_module.js | 8 ++-- src/test/resources/db/30_stack.js | 8 ++-- .../rest/github/selmak-public-repos.json | 8 ++-- .../github/selmak-terraform-docker-mongo.json | 4 +- 87 files changed, 417 insertions(+), 424 deletions(-) create mode 100644 src/main/client/app/shared/api/organizations-api.js delete mode 100644 src/main/client/app/shared/api/teams-api.js rename src/main/java/io/gaia_app/{teams => organizations}/AdminUserInitialization.java (97%) rename src/main/java/io/gaia_app/{teams => organizations}/UserService.kt (94%) rename src/main/java/io/gaia_app/{teams => organizations}/bo.kt (80%) create mode 100644 src/main/java/io/gaia_app/organizations/controller/OrganizationsRestController.java rename src/main/java/io/gaia_app/{teams => organizations}/controller/UserControllerAdvice.java (77%) rename src/main/java/io/gaia_app/{teams => organizations}/controller/UsersRestController.java (89%) create mode 100644 src/main/java/io/gaia_app/organizations/repository/OrganizationsRepository.java rename src/main/java/io/gaia_app/{teams => organizations}/repository/UserRepository.kt (69%) delete mode 100644 src/main/java/io/gaia_app/teams/controller/TeamsRestController.java delete mode 100644 src/main/java/io/gaia_app/teams/repository/TeamRepository.java rename src/test/java/io/gaia_app/{teams => organizations}/AdminUserInitializationTest.kt (86%) rename src/test/java/io/gaia_app/{teams/controller/TeamsRestControllerIT.java => organizations/controller/OrganizationsRestControllerIT.java} (60%) create mode 100644 src/test/java/io/gaia_app/organizations/controller/OrganizationsRestControllerTest.java rename src/test/java/io/gaia_app/{teams => organizations}/controller/UserControllerAdviceTest.java (73%) rename src/test/java/io/gaia_app/{teams => organizations}/controller/UsersRestControllerIT.java (88%) rename src/test/java/io/gaia_app/{teams => organizations}/controller/UsersRestControllerTest.java (90%) rename src/test/java/io/gaia_app/{teams => organizations}/repository/UserRepositoryIT.kt (79%) delete mode 100644 src/test/java/io/gaia_app/teams/controller/TeamsRestControllerTest.java create mode 100644 src/test/resources/db/00_organization.js delete mode 100644 src/test/resources/db/00_team.js diff --git a/src/main/client/app/pages/dashboard/dashboard.vue b/src/main/client/app/pages/dashboard/dashboard.vue index b55d27844..ccab4021f 100644 --- a/src/main/client/app/pages/dashboard/dashboard.vue +++ b/src/main/client/app/pages/dashboard/dashboard.vue @@ -36,7 +36,7 @@
@@ -49,7 +49,7 @@

Hi there !

-

It seems that you're not a member of a team yet. Ask your admin to add you a team !

+

It seems that you're not a member of a organization yet. Ask your admin to add you a organization !

Until then, you'll only be able to use public modules.

@@ -72,8 +72,8 @@ }), computed: { ...mapState('session', ['user']), - isWithoutTeam() { - return !this.user.admin && !this.user.team; + isWithoutOrganization() { + return !this.user.admin && !this.user.organization; }, }, async created() { diff --git a/src/main/client/app/pages/modules/module.vue b/src/main/client/app/pages/modules/module.vue index 5a3e946b7..36cd24c57 100644 --- a/src/main/client/app/pages/modules/module.vue +++ b/src/main/client/app/pages/modules/module.vue @@ -97,19 +97,19 @@
-

Authorized Teams

+

Authorized Organizations

@@ -164,7 +164,7 @@ refreshModule, updateModule, } from '@/shared/api/modules-api'; - import { getTeams } from '@/shared/api/teams-api'; + import { getOrganizations } from '@/shared/api/organizations-api'; import { displayConfirmDialog, displayNotification, @@ -190,7 +190,7 @@ module: null, isTerraformImageValid: null, isTerraformImageOverride: null, - teams: [], + organizations: [], providers: [ { value: 'aws', text: 'AWS' }, { value: 'azurerm', text: 'Azure' }, @@ -210,7 +210,7 @@ async created() { this.module = await getModule(this.moduleId); - this.teams = await getTeams(); + this.organizations = await getOrganizations(); }, methods: { diff --git a/src/main/client/app/pages/users/organizations.vue b/src/main/client/app/pages/users/organizations.vue index 1f3c199e6..dc2ca2fee 100644 --- a/src/main/client/app/pages/users/organizations.vue +++ b/src/main/client/app/pages/users/organizations.vue @@ -28,7 +28,7 @@