Skip to content

Commit f3cb312

Browse files
committed
feat: rename project to tenant
1 parent 6131b8b commit f3cb312

File tree

169 files changed

+6527
-6451
lines changed

Some content is hidden

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

169 files changed

+6527
-6451
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ access.log
5353

5454
apps/client-e2e/src/video
5555
.vercel
56+
57+
58+
error.log

app-swagger.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

apps/client/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "client",
3-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4-
"projectType": "application",
3+
"$schema": "../../node_modules/nx/schemas/tenant-schema.json",
4+
"tenantType": "application",
55
"prefix": "app",
66
"sourceRoot": "apps/client/src",
77
"tags": [],
@@ -153,7 +153,7 @@
153153
},
154154
"test": {
155155
"executor": "@nx/jest:jest",
156-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
156+
"outputs": ["{workspaceRoot}/coverage/{tenantRoot}"],
157157
"options": {
158158
"jestConfig": "apps/client/jest.config.ts"
159159
}

apps/client/src/app/app-initializer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { TranslocoService } from '@jsverse/transloco';
3-
import { SsoActiveLangService, SsoActiveProjectService, SsoService, TokensService } from '@nestjs-mod-sso/sso-afat';
3+
import { SsoActiveLangService, SsoActiveTenantService, SsoService, TokensService } from '@nestjs-mod-sso/sso-afat';
44
import { FilesRestSdkAngularService } from '@nestjs-mod/files-afat';
55
import { SsoRestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
66
import { WebhookRestSdkAngularService } from '@nestjs-mod/webhook-afat';
@@ -15,7 +15,7 @@ export class AppInitializer {
1515
private readonly translocoService: TranslocoService,
1616
private readonly tokensService: TokensService,
1717
private readonly ssoActiveLangService: SsoActiveLangService,
18-
private readonly ssoActiveProjectService: SsoActiveProjectService,
18+
private readonly ssoActiveTenantService: SsoActiveTenantService,
1919
private readonly ssoRestSdkAngularService: SsoRestSdkAngularService,
2020
private readonly webhookRestSdkAngularService: WebhookRestSdkAngularService,
2121
private readonly filesRestSdkAngularService: FilesRestSdkAngularService,
@@ -42,7 +42,7 @@ export class AppInitializer {
4242
this.ssoService.updateHeaders$.asObservable(),
4343
this.tokensService.getStream(),
4444
this.translocoService.langChanges$,
45-
this.ssoActiveProjectService.activePublicProject$,
45+
this.ssoActiveTenantService.activePublicTenant$,
4646
)
4747
.pipe(tap(() => this.updateHeaders()))
4848
.subscribe();

apps/client/src/app/app.component.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<li nz-menu-item routerLink="/users" transloco="Users"></li>
1313
}
1414
@if ([SsoRoleInterface.admin] | checkUserRoles | async) {
15-
<li nz-menu-item routerLink="/projects" transloco="Projects"></li>
15+
<li nz-menu-item routerLink="/tenants" transloco="Tenants"></li>
1616
}
1717
@if ([SsoRoleInterface.user, SsoRoleInterface.manager, SsoRoleInterface.admin] | checkUserRoles | async) {
1818
<ng-template #iconRef>
@@ -51,26 +51,26 @@
5151
</li>
5252
</ul>
5353
</li>
54-
@if (publicProjects$ | async; as publicProjects) {
54+
@if (publicTenants$ | async; as publicTenants) {
5555
@if (([SsoRoleInterface.admin] | checkUserRoles | async) || ([] | checkUserRoles | async)) {
5656
<li
5757
nz-submenu
58-
[nzTitle]="(activePublicProject$ | async)?.name || ('Select active project' | transloco)"
58+
[nzTitle]="(activePublicTenant$ | async)?.name || ('Select active tenant' | transloco)"
5959
[style]="{ float: 'right' }"
6060
>
6161
<ul>
6262
<li
63-
*ngFor="let publicProject of publicProjects$ | async"
63+
*ngFor="let publicTenant of publicTenants$ | async"
6464
nz-menu-item
65-
(click)="setActivePublicProject(publicProject)"
65+
(click)="setActivePublicTenant(publicTenant)"
6666
>
67-
{{ publicProject.name }}
67+
{{ publicTenant.name }}
6868
</li>
6969
</ul>
7070
</li>
7171
} @else {
7272
<a nzDisabled="true" nz-menu-item [style]="{ float: 'right' }">{{
73-
(activePublicProject$ | async)?.name || ('Select active project' | transloco)
73+
(activePublicTenant$ | async)?.name || ('Select active tenant' | transloco)
7474
}}</a>
7575
}
7676
}

apps/client/src/app/app.component.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { Title } from '@angular/platform-browser';
1313
import {
1414
CheckUserRolesPipe,
1515
SsoActiveLangService,
16-
SsoActiveProjectService,
17-
SsoProjectModel,
16+
SsoActiveTenantService,
17+
SsoTenantModel,
1818
SsoService,
1919
TokensService,
2020
UserPipe,
@@ -59,8 +59,8 @@ export class AppComponent implements OnInit {
5959
availableLangs$ = new BehaviorSubject<LangDefinition[]>([]);
6060
SsoRoleInterface = SsoRoleInterface;
6161

62-
publicProjects$?: Observable<SsoProjectModel[] | undefined>;
63-
activePublicProject$?: Observable<SsoProjectModel | undefined>;
62+
publicTenants$?: Observable<SsoTenantModel[] | undefined>;
63+
activePublicTenant$?: Observable<SsoTenantModel | undefined>;
6464

6565
constructor(
6666
private readonly ssoRestSdkAngularService: SsoRestSdkAngularService,
@@ -69,7 +69,7 @@ export class AppComponent implements OnInit {
6969
private readonly translocoService: TranslocoService,
7070
private readonly tokensService: TokensService,
7171
private readonly ssoActiveLangService: SsoActiveLangService,
72-
private readonly ssoActiveProjectService: SsoActiveProjectService,
72+
private readonly ssoActiveTenantService: SsoActiveTenantService,
7373
private readonly titleService: Title,
7474
private readonly filesService: FilesService,
7575
) {
@@ -78,7 +78,7 @@ export class AppComponent implements OnInit {
7878
}
7979

8080
ngOnInit() {
81-
this.loadAvailablePublicProjects();
81+
this.loadAvailablePublicTenants();
8282

8383
this.loadAvailableLangs();
8484
this.subscribeToChangeProfile();
@@ -94,15 +94,15 @@ export class AppComponent implements OnInit {
9494
return (!value.toLowerCase().startsWith('http') ? this.filesService.getMinioURL() : '') + value;
9595
}
9696

97-
setActivePublicProject(activePublicProject?: SsoProjectModel) {
98-
this.ssoActiveProjectService.setActivePublicProject(activePublicProject);
97+
setActivePublicTenant(activePublicTenant?: SsoTenantModel) {
98+
this.ssoActiveTenantService.setActivePublicTenant(activePublicTenant);
9999
}
100100

101-
private loadAvailablePublicProjects() {
102-
this.publicProjects$ = this.ssoActiveProjectService.publicProjects$.asObservable();
103-
this.activePublicProject$ = this.ssoActiveProjectService.activePublicProject$.asObservable();
101+
private loadAvailablePublicTenants() {
102+
this.publicTenants$ = this.ssoActiveTenantService.publicTenants$.asObservable();
103+
this.activePublicTenant$ = this.ssoActiveTenantService.activePublicTenant$.asObservable();
104104

105-
this.ssoActiveProjectService.loadAvailablePublicProjects();
105+
this.ssoActiveTenantService.loadAvailablePublicTenants();
106106
}
107107

108108
private subscribeToChangeProfile() {
@@ -143,7 +143,7 @@ export class AppComponent implements OnInit {
143143
.pipe(
144144
tap((lang) => {
145145
this.lang$.next(lang);
146-
this.ssoActiveProjectService.loadAvailablePublicProjects();
146+
this.ssoActiveTenantService.loadAvailablePublicTenants();
147147
}),
148148
untilDestroyed(this),
149149
)

apps/client/src/app/app.routes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { CompleteSignUpComponent } from './pages/complete-sign-up/complete-sign-
1919
import { ForgotPasswordComponent } from './pages/forgot-password/forgot-password.component';
2020
import { HomeComponent } from './pages/home/home.component';
2121
import { ProfileComponent } from './pages/profile/profile.component';
22-
import { ProjectsComponent } from './pages/projects/projects.component';
22+
import { TenantsComponent } from './pages/tenants/tenants.component';
2323
import { SignInComponent } from './pages/sign-in/sign-in.component';
2424
import { SignUpComponent } from './pages/sign-up/sign-up.component';
2525
import { TemplatesComponent } from './pages/templates/templates.component';
@@ -92,9 +92,9 @@ export const appRoutes: Route[] = [
9292
},
9393
},
9494
{
95-
path: 'projects',
96-
component: ProjectsComponent,
97-
title: marker('Projects'),
95+
path: 'tenants',
96+
component: TenantsComponent,
97+
title: marker('Tenants'),
9898
canActivate: [SsoGuardService],
9999
data: {
100100
[SSO_GUARD_DATA_ROUTE_KEY]: new SsoGuardData({
@@ -189,7 +189,7 @@ export const appRoutes: Route[] = [
189189
if (!redirectUri) {
190190
if (options.ssoService && options.router) {
191191
if (searchIn(SsoRoleInterface.admin, options.ssoService.profile$.value?.roles)) {
192-
options.router.navigate(['/projects']);
192+
options.router.navigate(['/tenants']);
193193
} else {
194194
options.router.navigate(['/home']);
195195
}
@@ -228,7 +228,7 @@ export const appRoutes: Route[] = [
228228
if (!redirectUri) {
229229
if (options.ssoService && options.router) {
230230
if (searchIn(SsoRoleInterface.admin, options.ssoService.profile$.value?.roles)) {
231-
options.router.navigate(['/projects']);
231+
options.router.navigate(['/tenants']);
232232
} else {
233233
options.router.navigate(['/home']);
234234
}

apps/client/src/app/integrations/sso.configuration.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
OAuthProvider,
1212
OAuthVerificationInput,
1313
SSO_CONFIGURATION_TOKEN,
14-
SsoActiveProjectService,
14+
SsoActiveTenantService,
1515
SsoCompleteForgotPasswordInput,
1616
SsoCompleteSignUpInput,
1717
SsoConfiguration,
@@ -32,25 +32,25 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
3232
private readonly filesService: FilesService,
3333
private readonly translocoService: TranslocoService,
3434
private readonly tokensService: TokensService,
35-
private readonly ssoActiveProjectService: SsoActiveProjectService,
35+
private readonly ssoActiveTenantService: SsoActiveTenantService,
3636
private readonly fingerprintService: FingerprintService,
3737
private readonly nzMessageService: NzMessageService,
3838
) {}
3939

4040
getAuthorizationHeaders(): Record<string, string> {
4141
const lang = this.translocoService.getActiveLang();
4242
const accessToken = this.tokensService.getAccessToken();
43-
const activeProjectAuthorizationHeaders = this.ssoActiveProjectService.getAuthorizationHeaders();
43+
const activeTenantAuthorizationHeaders = this.ssoActiveTenantService.getAuthorizationHeaders();
4444
if (!accessToken) {
4545
return {
4646
'Accept-language': lang,
47-
...activeProjectAuthorizationHeaders,
47+
...activeTenantAuthorizationHeaders,
4848
};
4949
}
5050
return {
5151
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
5252
'Accept-language': lang,
53-
...activeProjectAuthorizationHeaders,
53+
...activeTenantAuthorizationHeaders,
5454
};
5555
}
5656

@@ -327,7 +327,7 @@ export function provideSsoConfiguration(): Provider {
327327
FilesService,
328328
TranslocoService,
329329
TokensService,
330-
SsoActiveProjectService,
330+
SsoActiveTenantService,
331331
FingerprintService,
332332
NzMessageService,
333333
],

apps/client/src/app/pages/complete-forgot-password/complete-forgot-password.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class CompleteForgotPasswordComponent {
3838
onAfterCompleteForgotPassword() {
3939
if (!this.redirectUri) {
4040
if (searchIn(SsoRoleInterface.admin, this.ssoService.profile$.value?.roles)) {
41-
this.router.navigate(['/projects']);
41+
this.router.navigate(['/tenants']);
4242
} else {
4343
this.router.navigate(['/home']);
4444
}

apps/client/src/app/pages/complete-invite/complete-invite.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class CompleteInviteComponent {
3939
onAfterCompleteForgotPassword() {
4040
if (!this.redirectUri) {
4141
if (searchIn(SsoRoleInterface.admin, this.ssoService.profile$.value?.roles)) {
42-
this.router.navigate(['/projects']);
42+
this.router.navigate(['/tenants']);
4343
} else {
4444
this.router.navigate(['/home']);
4545
}

0 commit comments

Comments
 (0)