@juice-js/tenants 1.0.2 → 1.0.6-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/juice-js-tenants.mjs +5 -0
- package/esm2020/lib/confirm-dialog/confirm-dialog.component.mjs +53 -0
- package/esm2020/lib/shared/custom-error-state-matcher.mjs +8 -0
- package/esm2020/lib/shared/material.module.mjs +124 -0
- package/esm2020/lib/shared/models/table.query-result.mjs +2 -0
- package/esm2020/lib/shared/models/tenant.create.model.mjs +17 -0
- package/esm2020/lib/shared/models/tenant.model.mjs +2 -0
- package/esm2020/lib/shared/models/tenant.setting.model.mjs +13 -0
- package/esm2020/lib/shared/models/tenant.status.mjs +42 -0
- package/esm2020/lib/shared/models/tenant.update.model.mjs +8 -0
- package/esm2020/lib/shared/services/tenant-admin.service.mjs +88 -0
- package/esm2020/lib/shared/tenant-configuration.mjs +11 -0
- package/esm2020/lib/tenant-create/tenant-create.component.mjs +69 -0
- package/esm2020/lib/tenant-detail/tenant-detail.component.mjs +36 -0
- package/esm2020/lib/tenant-summary/tenant-summary.component.mjs +30 -0
- package/esm2020/lib/tenant-update/tenant-update.component.mjs +77 -0
- package/esm2020/lib/tenants.component.mjs +502 -0
- package/esm2020/lib/tenants.module.mjs +86 -0
- package/esm2020/public-api.mjs +12 -0
- package/fesm2015/juice-js-tenants.mjs +1109 -0
- package/fesm2015/juice-js-tenants.mjs.map +1 -0
- package/fesm2020/juice-js-tenants.mjs +1101 -0
- package/fesm2020/juice-js-tenants.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/confirm-dialog/confirm-dialog.component.d.ts +29 -0
- package/lib/shared/custom-error-state-matcher.d.ts +6 -0
- package/lib/shared/material.module.d.ts +33 -0
- package/{src/lib/shared/models/table.query-result.ts → lib/shared/models/table.query-result.d.ts} +6 -7
- package/lib/shared/models/tenant.create.model.d.ts +12 -0
- package/{src/lib/shared/models/tenant.model.ts → lib/shared/models/tenant.model.d.ts} +13 -15
- package/lib/shared/models/tenant.setting.model.d.ts +7 -0
- package/lib/shared/models/tenant.status.d.ts +16 -0
- package/lib/shared/models/tenant.update.model.d.ts +5 -0
- package/lib/shared/services/tenant-admin.service.d.ts +34 -0
- package/lib/shared/tenant-configuration.d.ts +12 -0
- package/lib/tenant-create/tenant-create.component.d.ts +28 -0
- package/lib/tenant-detail/tenant-detail.component.d.ts +17 -0
- package/lib/tenant-summary/tenant-summary.component.d.ts +14 -0
- package/lib/tenant-update/tenant-update.component.d.ts +30 -0
- package/lib/tenants.component.d.ts +76 -0
- package/lib/tenants.module.d.ts +21 -0
- package/package.json +31 -6
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/{src → theming}/_tenants.component-theme.scss +64 -64
- package/ng-package.json +0 -10
- package/src/lib/confirm-dialog/confirm-dialog.component.html +0 -10
- package/src/lib/confirm-dialog/confirm-dialog.component.scss +0 -9
- package/src/lib/confirm-dialog/confirm-dialog.component.spec.ts +0 -33
- package/src/lib/confirm-dialog/confirm-dialog.component.ts +0 -49
- package/src/lib/shared/custom-error-state-matcher.ts +0 -15
- package/src/lib/shared/material.module.ts +0 -62
- package/src/lib/shared/models/tenant.create.model.ts +0 -13
- package/src/lib/shared/models/tenant.setting.model.ts +0 -14
- package/src/lib/shared/models/tenant.status.ts +0 -32
- package/src/lib/shared/models/tenant.update.model.ts +0 -5
- package/src/lib/shared/services/tenant-admin.service.ts +0 -101
- package/src/lib/shared/services/tenant.service.spec.ts +0 -28
- package/src/lib/shared/tenant-configuration.ts +0 -18
- package/src/lib/shared/tenant-testing.ts +0 -44
- package/src/lib/tenant-create/tenant-create.component.css +0 -10
- package/src/lib/tenant-create/tenant-create.component.html +0 -45
- package/src/lib/tenant-create/tenant-create.component.spec.ts +0 -32
- package/src/lib/tenant-create/tenant-create.component.ts +0 -68
- package/src/lib/tenant-detail/tenant-detail.component.html +0 -50
- package/src/lib/tenant-detail/tenant-detail.component.scss +0 -3
- package/src/lib/tenant-detail/tenant-detail.component.spec.ts +0 -29
- package/src/lib/tenant-detail/tenant-detail.component.ts +0 -31
- package/src/lib/tenant-summary/tenant-summary.component.css +0 -4
- package/src/lib/tenant-summary/tenant-summary.component.html +0 -28
- package/src/lib/tenant-summary/tenant-summary.component.spec.ts +0 -29
- package/src/lib/tenant-summary/tenant-summary.component.ts +0 -28
- package/src/lib/tenant-update/tenant-update.component.html +0 -32
- package/src/lib/tenant-update/tenant-update.component.scss +0 -9
- package/src/lib/tenant-update/tenant-update.component.spec.ts +0 -29
- package/src/lib/tenant-update/tenant-update.component.ts +0 -77
- package/src/lib/tenants.component.html +0 -114
- package/src/lib/tenants.component.scss +0 -56
- package/src/lib/tenants.component.spec.ts +0 -30
- package/src/lib/tenants.component.ts +0 -525
- package/src/lib/tenants.module.ts +0 -60
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
|
+
import { TenantAdminService } from './shared/services/tenant-admin.service';
|
|
3
|
+
import { MatMultiSort, TableData } from 'ngx-mat-multi-sort';
|
|
4
|
+
import { MatPaginator } from '@angular/material/paginator';
|
|
5
|
+
import { TenantBasic } from './shared/models/tenant.model';
|
|
6
|
+
import { ActivatedRoute, Router, UrlSerializer } from '@angular/router';
|
|
7
|
+
import { Location } from '@angular/common';
|
|
8
|
+
import { TenantStatus, TenantStatusHelper } from './shared/models/tenant.status';
|
|
9
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
10
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
11
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
12
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
13
|
+
import { TenantConfiguration } from './shared/tenant-configuration';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
export declare class TenantsComponent implements AfterViewInit {
|
|
16
|
+
private tenantService;
|
|
17
|
+
private router;
|
|
18
|
+
private route;
|
|
19
|
+
private location;
|
|
20
|
+
private serializer;
|
|
21
|
+
private fb;
|
|
22
|
+
dialog: MatDialog;
|
|
23
|
+
private snackBar;
|
|
24
|
+
private localizer;
|
|
25
|
+
private options;
|
|
26
|
+
displayedColumns: string[];
|
|
27
|
+
table: TableData<TenantBasic>;
|
|
28
|
+
tenantStatus: typeof TenantStatus;
|
|
29
|
+
statusHelper: typeof TenantStatusHelper;
|
|
30
|
+
statusOptions: TenantStatus[];
|
|
31
|
+
get statuses(): import("@angular/forms").AbstractControl<any, any> | null;
|
|
32
|
+
get filterText(): import("@angular/forms").AbstractControl<any, any> | null;
|
|
33
|
+
paginator: MatPaginator;
|
|
34
|
+
sort: MatMultiSort;
|
|
35
|
+
form: FormGroup;
|
|
36
|
+
constructor(tenantService: TenantAdminService, router: Router, route: ActivatedRoute, location: Location, serializer: UrlSerializer, fb: FormBuilder, dialog: MatDialog, snackBar: MatSnackBar, localizer: TranslateService, options: TenantConfiguration);
|
|
37
|
+
ngOnInit(): void;
|
|
38
|
+
initFormAndTableEvents(): void;
|
|
39
|
+
ngAfterViewInit(): void;
|
|
40
|
+
clearStatuses(): void;
|
|
41
|
+
clearFilterText(): void;
|
|
42
|
+
getData(fromRoute?: boolean): void;
|
|
43
|
+
add(): void;
|
|
44
|
+
edit(id: string): void;
|
|
45
|
+
detail(id: string): void;
|
|
46
|
+
delete(id: string): void;
|
|
47
|
+
doDelete(id: string): void;
|
|
48
|
+
activate(id: string): void;
|
|
49
|
+
doActivate(id: string): void;
|
|
50
|
+
reactivate(id: string): void;
|
|
51
|
+
doReactivate(id: string): void;
|
|
52
|
+
deactivate(id: string): void;
|
|
53
|
+
doDeactivate(id: string): void;
|
|
54
|
+
suspend(id: string): void;
|
|
55
|
+
doSuspend(id: string): void;
|
|
56
|
+
abandon(id: string): void;
|
|
57
|
+
doAbandon(id: string): void;
|
|
58
|
+
approve(id: string): void;
|
|
59
|
+
doApprove(id: string): void;
|
|
60
|
+
reject(id: string): void;
|
|
61
|
+
doReject(id: string): void;
|
|
62
|
+
settings(id: string): void;
|
|
63
|
+
rootSettings(): void;
|
|
64
|
+
canActivate(status: TenantStatus): boolean;
|
|
65
|
+
canReactivate(status: TenantStatus): boolean;
|
|
66
|
+
canDeactivate(status: TenantStatus): boolean;
|
|
67
|
+
canSuspend(status: TenantStatus): boolean;
|
|
68
|
+
canDelete(status: TenantStatus): boolean;
|
|
69
|
+
canAbandon(status: TenantStatus): boolean;
|
|
70
|
+
canApproval(status: TenantStatus): boolean;
|
|
71
|
+
statusCompareFn(o1: TenantStatus, o2: TenantStatus): boolean;
|
|
72
|
+
confirm(callback: Function, options: any): void;
|
|
73
|
+
openSnackBar(message: string): void;
|
|
74
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TenantsComponent, never>;
|
|
75
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TenantsComponent, "juice-tenants", never, {}, {}, never, never, false, never>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { TenantConfigurationParams } from './shared/tenant-configuration';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./tenants.component";
|
|
5
|
+
import * as i2 from "./tenant-detail/tenant-detail.component";
|
|
6
|
+
import * as i3 from "./tenant-summary/tenant-summary.component";
|
|
7
|
+
import * as i4 from "./tenant-create/tenant-create.component";
|
|
8
|
+
import * as i5 from "./tenant-update/tenant-update.component";
|
|
9
|
+
import * as i6 from "./confirm-dialog/confirm-dialog.component";
|
|
10
|
+
import * as i7 from "@ngx-translate/core";
|
|
11
|
+
import * as i8 from "@angular/forms";
|
|
12
|
+
import * as i9 from "@angular/common";
|
|
13
|
+
import * as i10 from "./shared/material.module";
|
|
14
|
+
import * as i11 from "@angular/cdk/clipboard";
|
|
15
|
+
import * as i12 from "ngx-mat-multi-sort";
|
|
16
|
+
export declare class TenantsModule {
|
|
17
|
+
static forRoot(environment: TenantConfigurationParams): ModuleWithProviders<TenantsModule>;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TenantsModule, never>;
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TenantsModule, [typeof i1.TenantsComponent, typeof i2.TenantDetailComponent, typeof i3.TenantSummaryComponent, typeof i4.TenantCreateComponent, typeof i5.TenantUpdateComponent, typeof i6.ConfirmDialogComponent], [typeof i7.TranslateModule, typeof i8.FormsModule, typeof i8.ReactiveFormsModule, typeof i9.CommonModule, typeof i10.MaterialModule, typeof i11.ClipboardModule, typeof i12.MatMultiSortModule], [typeof i1.TenantsComponent, typeof i2.TenantDetailComponent, typeof i3.TenantSummaryComponent, typeof i4.TenantCreateComponent, typeof i5.TenantUpdateComponent, typeof i7.TranslateModule]>;
|
|
20
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TenantsModule>;
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juice-js/tenants",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6-alpha.13",
|
|
4
4
|
"description": "Juice tenants admin module",
|
|
5
5
|
"author": "jack@creatorflow.io",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,16 +8,41 @@
|
|
|
8
8
|
"url": "https://github.com/creatorflow-io/juice-tenants/issues"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://github.com/creatorflow-io/juice-tenants#readme",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
11
14
|
"peerDependencies": {
|
|
12
|
-
"@angular/common": "^
|
|
13
|
-
"@angular/core": "^
|
|
14
|
-
"@angular/material": "^
|
|
15
|
+
"@angular/common": "^15.2.9",
|
|
16
|
+
"@angular/core": "^15.2.9",
|
|
17
|
+
"@angular/material": "^15.2.9",
|
|
15
18
|
"@ngx-translate/core": "^14.0.0",
|
|
16
19
|
"ngx-mat-multi-sort": "^0.10.2",
|
|
17
|
-
"@juice-js/dict-builder": "^1.0.
|
|
20
|
+
"@juice-js/dict-builder": "^1.0.3"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
"./theming": {
|
|
24
|
+
"sass": "./theming/_tenants.component-theme.scss"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": {
|
|
27
|
+
"default": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./index.d.ts",
|
|
31
|
+
"esm2020": "./esm2020/juice-js-tenants.mjs",
|
|
32
|
+
"es2020": "./fesm2020/juice-js-tenants.mjs",
|
|
33
|
+
"es2015": "./fesm2015/juice-js-tenants.mjs",
|
|
34
|
+
"node": "./fesm2015/juice-js-tenants.mjs",
|
|
35
|
+
"default": "./fesm2020/juice-js-tenants.mjs"
|
|
36
|
+
}
|
|
18
37
|
},
|
|
19
38
|
"dependencies": {
|
|
20
39
|
"tslib": "^2.3.0"
|
|
21
40
|
},
|
|
22
|
-
"sideEffects": false
|
|
41
|
+
"sideEffects": false,
|
|
42
|
+
"module": "fesm2015/juice-js-tenants.mjs",
|
|
43
|
+
"es2020": "fesm2020/juice-js-tenants.mjs",
|
|
44
|
+
"esm2020": "esm2020/juice-js-tenants.mjs",
|
|
45
|
+
"fesm2020": "fesm2020/juice-js-tenants.mjs",
|
|
46
|
+
"fesm2015": "fesm2015/juice-js-tenants.mjs",
|
|
47
|
+
"typings": "index.d.ts"
|
|
23
48
|
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use '@angular/material' as mat;
|
|
3
|
-
|
|
4
|
-
@mixin color($theme){
|
|
5
|
-
// Get the color config from the theme.
|
|
6
|
-
$color-config: mat.get-color-config($theme);
|
|
7
|
-
// Get the primary color palette from the color-config.
|
|
8
|
-
$primary-palette: map.get($color-config, 'primary');
|
|
9
|
-
$accent-palette: map.get($color-config, 'accent');
|
|
10
|
-
$warn-palette: map.get($color-config, 'warn');
|
|
11
|
-
$green-palette: mat.define-palette(mat.$green-palette, 500, 300, 700);
|
|
12
|
-
.color-primary {
|
|
13
|
-
color: mat.get-color-from-palette($primary-palette, 'darker') !important;
|
|
14
|
-
.mdc-list-item__primary-text{
|
|
15
|
-
color: mat.get-color-from-palette($primary-palette, 'darker') !important;
|
|
16
|
-
}
|
|
17
|
-
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
18
|
-
color: mat.get-color-from-palette($primary-palette, 'darker') !important;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.color-accent {
|
|
23
|
-
color: mat.get-color-from-palette($accent-palette, 'darker') !important;
|
|
24
|
-
.mdc-list-item__primary-text{
|
|
25
|
-
color: mat.get-color-from-palette($accent-palette, 'darker') !important;
|
|
26
|
-
}
|
|
27
|
-
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
28
|
-
color: mat.get-color-from-palette($accent-palette, 'darker') !important;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.color-warn {
|
|
33
|
-
color: mat.get-color-from-palette($warn-palette, 'darker') !important;
|
|
34
|
-
.mdc-list-item__primary-text{
|
|
35
|
-
color: mat.get-color-from-palette($warn-palette, 'darker') !important;
|
|
36
|
-
}
|
|
37
|
-
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
38
|
-
color: mat.get-color-from-palette($warn-palette, 'darker') !important;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.color-success,
|
|
43
|
-
.mat-success.mat-mdc-button:not(:disabled){
|
|
44
|
-
color: mat.get-color-from-palette($green-palette, 'darker') !important;
|
|
45
|
-
.mdc-list-item__primary-text{
|
|
46
|
-
color: mat.get-color-from-palette($green-palette, 'darker') !important;
|
|
47
|
-
}
|
|
48
|
-
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
49
|
-
color: mat.get-color-from-palette($green-palette, 'darker') !important;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.bg-accent {
|
|
54
|
-
background-color: mat.get-color-from-palette($accent-palette, 'lighter') !important;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.bg-warn {
|
|
58
|
-
background-color: mat.get-color-from-palette($warn-palette, 'lighter') !important;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.bg-success{
|
|
62
|
-
background-color: mat.get-color-from-palette($green-palette, 'lighter') !important;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin color($theme){
|
|
5
|
+
// Get the color config from the theme.
|
|
6
|
+
$color-config: mat.get-color-config($theme);
|
|
7
|
+
// Get the primary color palette from the color-config.
|
|
8
|
+
$primary-palette: map.get($color-config, 'primary');
|
|
9
|
+
$accent-palette: map.get($color-config, 'accent');
|
|
10
|
+
$warn-palette: map.get($color-config, 'warn');
|
|
11
|
+
$green-palette: mat.define-palette(mat.$green-palette, 500, 300, 700);
|
|
12
|
+
.color-primary {
|
|
13
|
+
color: mat.get-color-from-palette($primary-palette, 'darker') !important;
|
|
14
|
+
.mdc-list-item__primary-text{
|
|
15
|
+
color: mat.get-color-from-palette($primary-palette, 'darker') !important;
|
|
16
|
+
}
|
|
17
|
+
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
18
|
+
color: mat.get-color-from-palette($primary-palette, 'darker') !important;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.color-accent {
|
|
23
|
+
color: mat.get-color-from-palette($accent-palette, 'darker') !important;
|
|
24
|
+
.mdc-list-item__primary-text{
|
|
25
|
+
color: mat.get-color-from-palette($accent-palette, 'darker') !important;
|
|
26
|
+
}
|
|
27
|
+
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
28
|
+
color: mat.get-color-from-palette($accent-palette, 'darker') !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.color-warn {
|
|
33
|
+
color: mat.get-color-from-palette($warn-palette, 'darker') !important;
|
|
34
|
+
.mdc-list-item__primary-text{
|
|
35
|
+
color: mat.get-color-from-palette($warn-palette, 'darker') !important;
|
|
36
|
+
}
|
|
37
|
+
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
38
|
+
color: mat.get-color-from-palette($warn-palette, 'darker') !important;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.color-success,
|
|
43
|
+
.mat-success.mat-mdc-button:not(:disabled){
|
|
44
|
+
color: mat.get-color-from-palette($green-palette, 'darker') !important;
|
|
45
|
+
.mdc-list-item__primary-text{
|
|
46
|
+
color: mat.get-color-from-palette($green-palette, 'darker') !important;
|
|
47
|
+
}
|
|
48
|
+
&.mat-mdc-menu-item .mat-icon-no-color{
|
|
49
|
+
color: mat.get-color-from-palette($green-palette, 'darker') !important;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bg-accent {
|
|
54
|
+
background-color: mat.get-color-from-palette($accent-palette, 'lighter') !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.bg-warn {
|
|
58
|
+
background-color: mat.get-color-from-palette($warn-palette, 'lighter') !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.bg-success{
|
|
62
|
+
background-color: mat.get-color-from-palette($green-palette, 'lighter') !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
package/ng-package.json
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<mat-card>
|
|
2
|
-
<mat-card-header>
|
|
3
|
-
<mat-card-title>{{ confirmTitle | translate }}</mat-card-title>
|
|
4
|
-
<mat-card-subtitle [class]="confirmMessageClasses">{{ confirmMessage | translate }}</mat-card-subtitle>
|
|
5
|
-
</mat-card-header>
|
|
6
|
-
<mat-card-actions align="end">
|
|
7
|
-
<button mat-button (click)="confirm()" [color]="confirmButtonColor">{{ confirmButtonText | translate }}</button>
|
|
8
|
-
<button mat-button (click)="cancel()">{{ 'Cancel' | translate }}</button>
|
|
9
|
-
</mat-card-actions>
|
|
10
|
-
</mat-card>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ConfirmDialogComponent } from './confirm-dialog.component';
|
|
4
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
-
import { TenantsTestingModule } from '../shared/tenant-testing';
|
|
6
|
-
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
7
|
-
|
|
8
|
-
describe('ConfirmDialogComponent', () => {
|
|
9
|
-
let component: ConfirmDialogComponent;
|
|
10
|
-
let fixture: ComponentFixture<ConfirmDialogComponent>;
|
|
11
|
-
|
|
12
|
-
beforeEach(async () => {
|
|
13
|
-
await TestBed.configureTestingModule({
|
|
14
|
-
imports:[
|
|
15
|
-
TranslateModule.forRoot(),
|
|
16
|
-
TenantsTestingModule.forTest({}),
|
|
17
|
-
],
|
|
18
|
-
declarations: [ ConfirmDialogComponent ],
|
|
19
|
-
providers: [
|
|
20
|
-
{ provide: MAT_DIALOG_DATA, useValue: {} }
|
|
21
|
-
]
|
|
22
|
-
})
|
|
23
|
-
.compileComponents();
|
|
24
|
-
|
|
25
|
-
fixture = TestBed.createComponent(ConfirmDialogComponent);
|
|
26
|
-
component = fixture.componentInstance;
|
|
27
|
-
fixture.detectChanges();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('should create', () => {
|
|
31
|
-
expect(component).toBeTruthy();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Component, Output, EventEmitter, Inject } from '@angular/core';
|
|
2
|
-
import {MAT_DIALOG_DATA} from '@angular/material/dialog';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'juice-confirm-dialog',
|
|
6
|
-
templateUrl: './confirm-dialog.component.html',
|
|
7
|
-
styleUrls: ['./confirm-dialog.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class ConfirmDialogComponent {
|
|
10
|
-
|
|
11
|
-
@Output() confirmed = new EventEmitter();
|
|
12
|
-
@Output() cancelled = new EventEmitter();
|
|
13
|
-
|
|
14
|
-
confirmMessage: string = "Are you sure?";
|
|
15
|
-
confirmMessageClasses: string = "";
|
|
16
|
-
confirmTitle: string = "Action required";
|
|
17
|
-
confirmButtonText: string = "Confirm";
|
|
18
|
-
confirmButtonColor: string = "primary";
|
|
19
|
-
|
|
20
|
-
constructor(@Inject(MAT_DIALOG_DATA) public data: {
|
|
21
|
-
title: string, message: string, buttonText: string, buttonColor: string,
|
|
22
|
-
messageClasses: string
|
|
23
|
-
}) {
|
|
24
|
-
|
|
25
|
-
if(data.title){
|
|
26
|
-
this.confirmTitle = data.title;
|
|
27
|
-
}
|
|
28
|
-
if(data.message){
|
|
29
|
-
this.confirmMessage = data.message;
|
|
30
|
-
}
|
|
31
|
-
if(data.buttonText){
|
|
32
|
-
this.confirmButtonText = data.buttonText;
|
|
33
|
-
}
|
|
34
|
-
if(data.buttonColor){
|
|
35
|
-
this.confirmButtonColor = data.buttonColor;
|
|
36
|
-
}
|
|
37
|
-
if(data.messageClasses){
|
|
38
|
-
this.confirmMessageClasses = data.messageClasses;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
confirm(){
|
|
43
|
-
this.confirmed.emit();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
cancel(){
|
|
47
|
-
this.cancelled.emit();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormControl,
|
|
3
|
-
FormGroupDirective,
|
|
4
|
-
NgForm,
|
|
5
|
-
} from '@angular/forms';
|
|
6
|
-
|
|
7
|
-
import {ErrorStateMatcher} from '@angular/material/core';
|
|
8
|
-
|
|
9
|
-
/** Error when invalid control is dirty, touched, or submitted. */
|
|
10
|
-
export class CustomErrorStateMatcher implements ErrorStateMatcher {
|
|
11
|
-
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
12
|
-
const isSubmitted = form && form.submitted;
|
|
13
|
-
return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {NgModule} from '@angular/core';
|
|
2
|
-
import {MatButtonModule} from '@angular/material/button';
|
|
3
|
-
import {MatCardModule} from '@angular/material/card';
|
|
4
|
-
import {MatCheckboxModule} from '@angular/material/checkbox';
|
|
5
|
-
import {MatDatepickerModule} from '@angular/material/datepicker';
|
|
6
|
-
import {MatDialogModule} from '@angular/material/dialog';
|
|
7
|
-
import {MatDividerModule} from '@angular/material/divider';
|
|
8
|
-
import {MatExpansionModule} from '@angular/material/expansion';
|
|
9
|
-
import {MatGridListModule} from '@angular/material/grid-list';
|
|
10
|
-
import {MatIconModule} from '@angular/material/icon';
|
|
11
|
-
import {MatInputModule} from '@angular/material/input';
|
|
12
|
-
import {MatListModule} from '@angular/material/list';
|
|
13
|
-
import {MatMenuModule} from '@angular/material/menu';
|
|
14
|
-
import {MatNativeDateModule, MatRippleModule} from '@angular/material/core';
|
|
15
|
-
import {MatPaginatorModule} from '@angular/material/paginator';
|
|
16
|
-
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
|
17
|
-
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
|
18
|
-
import {MatRadioModule} from '@angular/material/radio';
|
|
19
|
-
import {MatSelectModule} from '@angular/material/select';
|
|
20
|
-
import {MatSliderModule} from '@angular/material/slider';
|
|
21
|
-
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
|
22
|
-
import {MatSnackBarModule} from '@angular/material/snack-bar';
|
|
23
|
-
import {MatSortModule} from '@angular/material/sort';
|
|
24
|
-
import {MatTableModule} from '@angular/material/table';
|
|
25
|
-
import {MatTabsModule} from '@angular/material/tabs';
|
|
26
|
-
import {MatToolbarModule} from '@angular/material/toolbar';
|
|
27
|
-
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
28
|
-
import {MatTreeModule} from '@angular/material/tree';
|
|
29
|
-
|
|
30
|
-
@NgModule({
|
|
31
|
-
exports: [
|
|
32
|
-
MatButtonModule,
|
|
33
|
-
MatCardModule,
|
|
34
|
-
MatCheckboxModule,
|
|
35
|
-
MatDatepickerModule,
|
|
36
|
-
MatDialogModule,
|
|
37
|
-
MatDividerModule,
|
|
38
|
-
MatExpansionModule,
|
|
39
|
-
MatGridListModule,
|
|
40
|
-
MatIconModule,
|
|
41
|
-
MatInputModule,
|
|
42
|
-
MatListModule,
|
|
43
|
-
MatMenuModule,
|
|
44
|
-
MatNativeDateModule,
|
|
45
|
-
MatPaginatorModule,
|
|
46
|
-
MatProgressBarModule,
|
|
47
|
-
MatProgressSpinnerModule,
|
|
48
|
-
MatRadioModule,
|
|
49
|
-
MatRippleModule,
|
|
50
|
-
MatSelectModule,
|
|
51
|
-
MatSliderModule,
|
|
52
|
-
MatSlideToggleModule,
|
|
53
|
-
MatSnackBarModule,
|
|
54
|
-
MatSortModule,
|
|
55
|
-
MatTableModule,
|
|
56
|
-
MatTabsModule,
|
|
57
|
-
MatToolbarModule,
|
|
58
|
-
MatTooltipModule,
|
|
59
|
-
MatTreeModule
|
|
60
|
-
]
|
|
61
|
-
})
|
|
62
|
-
export class MaterialModule {}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class TenantCreate {
|
|
2
|
-
public name: string = "";
|
|
3
|
-
public identifier: string = "";
|
|
4
|
-
public connectionString: string = "";
|
|
5
|
-
public adminUser: string = "";
|
|
6
|
-
public adminEmail: string = "";
|
|
7
|
-
public properties: any = {};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class TenantCreated{
|
|
11
|
-
public id: string = "";
|
|
12
|
-
public identifier: string = "";
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export class TenantSetting{
|
|
3
|
-
public key: string = "";
|
|
4
|
-
public value: string = "";
|
|
5
|
-
public inherited: boolean = false;
|
|
6
|
-
public overridden: boolean = false;
|
|
7
|
-
|
|
8
|
-
constructor(key: string, value: string, inherited: boolean = false, overridden: boolean = false){
|
|
9
|
-
this.key = key;
|
|
10
|
-
this.value = value;
|
|
11
|
-
this.inherited = inherited;
|
|
12
|
-
this.overridden = overridden;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export enum TenantStatus {
|
|
3
|
-
New, PendingApproval, Approved, Rejected, Initializing, Initialized, PendingToActive, Inactive, Active, Suspended, Abandoned
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export class TenantStatusHelper{
|
|
7
|
-
static getColor(status: TenantStatus){
|
|
8
|
-
var s = (typeof status == "string" ? TenantStatus[status] : status) as TenantStatus;
|
|
9
|
-
switch(s){
|
|
10
|
-
case TenantStatus.New:
|
|
11
|
-
return "accent-color";
|
|
12
|
-
case TenantStatus.Initialized:
|
|
13
|
-
return "success-color";
|
|
14
|
-
case TenantStatus.Approved:
|
|
15
|
-
return "success-color";
|
|
16
|
-
case TenantStatus.PendingApproval:
|
|
17
|
-
return "accent-color";
|
|
18
|
-
case TenantStatus.PendingToActive:
|
|
19
|
-
return "accent-color";
|
|
20
|
-
case TenantStatus.Active:
|
|
21
|
-
return "success-color";
|
|
22
|
-
case TenantStatus.Inactive:
|
|
23
|
-
return "warn-color";
|
|
24
|
-
case TenantStatus.Suspended:
|
|
25
|
-
return "warn-color";
|
|
26
|
-
case TenantStatus.Abandoned:
|
|
27
|
-
return "warn-color";
|
|
28
|
-
default:
|
|
29
|
-
return "";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Injectable, Inject } from '@angular/core';
|
|
2
|
-
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
3
|
-
import { TenantConfiguration } from '../tenant-configuration';
|
|
4
|
-
import { Tenant, TenantBasic } from '../models/tenant.model';
|
|
5
|
-
import { TenantCreate, TenantCreated } from '../models/tenant.create.model';
|
|
6
|
-
import { TenantUpdate } from '../models/tenant.update.model';
|
|
7
|
-
import { TenantStatus } from '../models/tenant.status';
|
|
8
|
-
import { TableQueryResult } from '../models/table.query-result';
|
|
9
|
-
import { Observable } from 'rxjs';
|
|
10
|
-
import { TenantSetting } from '../models/tenant.setting.model';
|
|
11
|
-
|
|
12
|
-
@Injectable({
|
|
13
|
-
providedIn: 'root'
|
|
14
|
-
})
|
|
15
|
-
export class TenantAdminService {
|
|
16
|
-
|
|
17
|
-
constructor(private http: HttpClient, private options: TenantConfiguration) {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public getTenants(filterText: string = "", statuses: TenantStatus[] = [],
|
|
22
|
-
sortColumns: string[] = [], sortDirections: string[]=[],
|
|
23
|
-
pageIndex: number =0, pageSize: number = 20): Observable<TableQueryResult<TenantBasic>> {
|
|
24
|
-
|
|
25
|
-
var params = new HttpParams()
|
|
26
|
-
.set('q', filterText)
|
|
27
|
-
.set('page', pageIndex+1)
|
|
28
|
-
.set('pageSize', pageSize);
|
|
29
|
-
|
|
30
|
-
if (statuses.length > 0) {
|
|
31
|
-
for (var i = 0; i < statuses.length; i++) {
|
|
32
|
-
params = params.append('statuses', statuses[i]);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if(sortColumns.length > 0) {
|
|
36
|
-
if(sortDirections.length != sortColumns.length) throw new Error("sortColumns and sortDirections must be the same length");
|
|
37
|
-
for (var i = 0; i < sortColumns.length; i++) {
|
|
38
|
-
params = params.set("sorts["+i+"].property", sortColumns[i])
|
|
39
|
-
.set("sorts["+i+"].sortDir", sortDirections[i]);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return this.http.get<TableQueryResult<TenantBasic>>(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/tenants`,
|
|
43
|
-
{params: params});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
public getTenant(identifier: string) {
|
|
48
|
-
return this.http.get<Tenant>(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${identifier}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public getSummary(identifier: string) {
|
|
52
|
-
return this.http.get<TenantBasic>(`${this.options.apiEndpoint}/${identifier}/api/v${this.options.apiVersion}/operation`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public createTenant(tenant: TenantCreate) {
|
|
56
|
-
return this.http.post<TenantCreated>(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin`, tenant);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public updateTenant(id: string, tenant: TenantUpdate) {
|
|
60
|
-
return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}`, tenant);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public deleteTenant(id: string) {
|
|
64
|
-
return this.http.delete(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}`);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public activateTenant(id: string) {
|
|
68
|
-
return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/activate`, null);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public deactivateTenant(id: string) {
|
|
72
|
-
return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/deactivate`, null);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public reactivateTenant(id: string) {
|
|
76
|
-
return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/reactivate`, null);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public suspendTenant(id: string) {
|
|
80
|
-
return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/suspend`, null);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
public approveTenant(id: string) {
|
|
84
|
-
return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/approve`, null);
|
|
85
|
-
}
|
|
86
|
-
public rejectTenant(id: string) {
|
|
87
|
-
return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/reject`, null);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public abandonTenant(id: string) {
|
|
91
|
-
return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/abandon`, null);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public getTenantSettings(id: string) {
|
|
95
|
-
return this.http.get<TenantSetting[]>(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/settings`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public updateTenantSettings(id: string, settings: TenantSetting[]) {
|
|
99
|
-
return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/settings`, settings);
|
|
100
|
-
}
|
|
101
|
-
}
|