@tech4good/angular-schematics 20.3.0 → 21.0.0
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/.agents/skills/publish-npm/SKILL.md +1 -1
- package/.agents/skills/publish-npm/eval.yaml +15 -0
- package/.agents/skills/publish-npm/fixtures/package-v21.json.template +8 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.t4g/agent-memory.db +0 -0
- package/CHANGELOG.md +100 -26
- package/commitlint.config.js +15 -0
- package/contributing-docs/commit-message.md +3 -6
- package/package.json +10 -6
- package/src/collection.json +8 -0
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +1 -3
- package/src/component/index_spec.js +57 -4
- package/src/component/index_spec.js.map +1 -1
- package/src/entity/index.js +7 -1
- package/src/entity/index.js.map +1 -1
- package/src/entity/index_spec.js +108 -4
- package/src/entity/index_spec.js.map +1 -1
- package/src/guard/files/__name@dasherize__.guard.spec.ts.template +45 -0
- package/src/guard/files/__name@dasherize__.guard.ts.template +32 -0
- package/src/guard/index.d.ts +2 -0
- package/src/guard/index.js +38 -0
- package/src/guard/index.js.map +1 -0
- package/src/guard/index_spec.d.ts +1 -0
- package/src/guard/index_spec.js +64 -0
- package/src/guard/index_spec.js.map +1 -0
- package/src/guard/schema.json +46 -0
- package/src/ng-add/files/.firebaserc.template +3 -2
- package/src/ng-add/files/.github/workflows/angular-github-ci.yml.template +105 -39
- package/src/ng-add/files/.gitignore.template +1 -2
- package/src/ng-add/files/angular.json.template +1 -5
- package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +390 -0
- package/src/ng-add/files/docs-infra/load-system-architecture.md.template +166 -0
- package/src/ng-add/files/docs-infra/querying-strategy.md.template +157 -0
- package/src/ng-add/files/docs-infra/stream-system-architecture.md.template +283 -0
- package/src/ng-add/files/eslint.config.js.template +4 -1
- package/src/ng-add/files/firebase.json.template +37 -0
- package/src/ng-add/files/firestore.rules.spec.ts.template +221 -0
- package/src/ng-add/files/firestore.rules.template +67 -0
- package/src/ng-add/files/jest.config.ts.template +6 -1
- package/src/ng-add/files/package.json.template +41 -31
- package/src/ng-add/files/setup-jest.ts.template +13 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +76 -12
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.ts.template +1 -3
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.spec.ts.template +90 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.ts.template +1 -1
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-count-pill/admin-count-pill.component.spec.ts.template +12 -17
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-count-pill/admin-count-pill.component.ts.template +2 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-user-counts.component.spec.ts.template +40 -19
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-user-counts.component.ts.template +3 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.html.template +2 -2
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.spec.ts.template +108 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.ts.template +11 -11
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.html.template +6 -2
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.spec.ts.template +136 -19
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.ts.template +8 -5
- package/src/ng-add/files/src/app/app.component.html.template +1 -1
- package/src/ng-add/files/src/app/app.component.scss.template +10 -0
- package/src/ng-add/files/src/app/app.component.ts.template +1 -1
- package/src/ng-add/files/src/app/app.config.ts.template +11 -11
- package/src/ng-add/files/src/app/auth-routing.spec.ts.template +101 -0
- package/src/ng-add/files/src/app/core/analytics/log.service.ts.template +5 -8
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +140 -0
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +25 -7
- package/src/ng-add/files/src/app/core/auth/guards/redirect-if-authenticated.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-auth-and-consent.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-auth.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +229 -14
- package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +1 -1
- package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +34 -9
- package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +4 -4
- package/src/ng-add/files/src/app/core/firebase/query-logger.ts.template +11 -0
- package/src/ng-add/files/src/app/core/firebase/simulate-load.spec.ts.template +104 -0
- package/src/ng-add/files/src/app/core/firebase/simulate-stream.spec.ts.template +127 -0
- package/src/ng-add/files/src/app/core/firebase/simulation.mock.ts.template +38 -0
- package/src/ng-add/files/src/app/core/firebase/stream-multiplexer.ts.template +443 -0
- package/src/ng-add/files/src/app/core/store/app.store.spec.ts.template +920 -0
- package/src/ng-add/files/src/app/core/store/app.store.ts.template +303 -137
- package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +65 -23
- package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +68 -67
- package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +46 -0
- package/src/ng-add/files/src/app/core/store/user-context/user-context.mock.ts.template +17 -0
- package/src/ng-add/files/src/app/core/testing/test-utils.ts.template +26 -0
- package/src/ng-add/files/src/app/first-time/consent/consent.component.html.template +3 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +89 -13
- package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +46 -17
- package/src/ng-add/files/src/app/first-time/consent/consent.guard.ts.template +1 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.html.template +5 -63
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.scss.template +1 -94
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +150 -14
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +15 -42
- package/src/ng-add/files/src/app/first-time/early-access/early-access.guard.ts.template +2 -2
- package/src/ng-add/files/src/app/first-time/early-access/early-access.model.ts.template +5 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.html.template +42 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.scss.template +96 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.spec.ts.template +37 -0
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.ts.template +63 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.html.template +16 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.scss.template +7 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.spec.ts.template +41 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.ts.template +26 -0
- package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +123 -0
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.html.template +11 -4
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.scss.template +17 -4
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.ts.template +5 -5
- package/src/ng-add/files/src/app/first-time/landing/landing.component.html.template +1 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.scss.template +0 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +25 -17
- package/src/ng-add/files/src/app/first-time/landing/landing.component.ts.template +4 -12
- package/src/ng-add/files/src/app/first-time/landing/rotating-quotes/rotating-quotes.component.ts.template +1 -1
- package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +36 -16
- package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +1 -1
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +11 -15
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.ts.template +1 -3
- package/src/ng-add/files/src/app/main/home/home.component.ts.template +1 -3
- package/src/ng-add/files/src/app/shared/dev-status-bar/dev-status-bar.component.spec.ts.template +98 -0
- package/src/ng-add/files/src/app/shared/dev-status-bar/dev-status-bar.component.ts.template +9 -3
- package/src/ng-add/files/src/app/shared/hint-visibility/hint-visibility.directive.spec.ts.template +164 -0
- package/src/ng-add/files/src/app/shared/hint-visibility/hint-visibility.directive.ts.template +20 -18
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +38 -17
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.ts.template +1 -1
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +1 -1
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +49 -10
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +5 -5
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.spec.ts.template +86 -0
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +11 -9
- package/src/ng-add/files/src/environments/environment.prod.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.test.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.ts.template +2 -8
- package/src/ng-add/files/src/styles.scss.template +29 -1
- package/src/ng-add/files/tsconfig.app.json.template +6 -6
- package/src/ng-add/files/tsconfig.json.template +13 -8
- package/src/ng-add/files/tsconfig.spec.json.template +6 -5
- package/src/ng-add/index.js +19 -1
- package/src/ng-add/index.js.map +1 -1
- package/src/component/files/__name@dasherize__/__name@dasherize__.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-count-pill/admin-count-pill.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-counts/admin-user-counts.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/first-time/consent/consent.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/first-time/early-access/early-access.animations.ts.template +0 -10
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.animations.ts.template +0 -15
- package/src/ng-add/files/src/app/first-time/landing/landing.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.animations.ts.template +0 -4
- package/src/ng-add/files/src/app/main/home/home.animations.ts.template +0 -4
|
@@ -12,7 +12,7 @@ import { MatIcon } from '@angular/material/icon';
|
|
|
12
12
|
@Component({
|
|
13
13
|
selector: 'app-admin-settings',
|
|
14
14
|
templateUrl: './admin-settings.component.html',
|
|
15
|
-
|
|
15
|
+
styleUrl: './admin-settings.component.scss',
|
|
16
16
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
17
|
imports: [MatIcon],
|
|
18
18
|
})
|
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
import { render } from '@testing-library/angular';
|
|
1
|
+
import { render, screen } from '@testing-library/angular';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
|
|
4
4
|
import { AdminCountPillComponent } from './admin-count-pill.component';
|
|
5
|
-
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
6
|
-
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
7
|
-
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
8
|
-
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
9
5
|
|
|
10
|
-
/** Sets up the testing environment for AdminCountPillComponent using render
|
|
6
|
+
/** Sets up the testing environment for AdminCountPillComponent using render. */
|
|
11
7
|
async function setup() {
|
|
12
8
|
const user = userEvent.setup();
|
|
13
|
-
const checkedSpy = jest.fn();
|
|
14
9
|
|
|
15
10
|
const view = await render(AdminCountPillComponent, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
componentInputs: {},
|
|
11
|
+
providers: [],
|
|
12
|
+
componentInputs: {
|
|
13
|
+
label: 'Sample Label',
|
|
14
|
+
value: 99,
|
|
15
|
+
},
|
|
22
16
|
on: {},
|
|
23
17
|
});
|
|
24
18
|
|
|
25
19
|
return {
|
|
26
20
|
user,
|
|
27
21
|
fixture: view.fixture,
|
|
28
|
-
rerender: () => view.rerender(), // add component inputs if needed
|
|
29
22
|
};
|
|
30
23
|
}
|
|
31
24
|
|
|
32
25
|
describe('AdminCountPillComponent', () => {
|
|
33
|
-
it('should
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
it('should render label and value correctly', async () => {
|
|
27
|
+
await setup();
|
|
28
|
+
|
|
29
|
+
expect(screen.getByText('Sample Label:')).toBeVisible();
|
|
30
|
+
expect(screen.getByText('99')).toBeVisible();
|
|
36
31
|
});
|
|
37
32
|
});
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
|
|
2
|
-
import { AdminCountPillAnimations } from './admin-count-pill.animations';
|
|
3
2
|
|
|
4
3
|
@Component({
|
|
5
4
|
selector: 'app-admin-count-pill',
|
|
6
5
|
templateUrl: './admin-count-pill.component.html',
|
|
7
|
-
|
|
6
|
+
styleUrl: './admin-count-pill.component.scss',
|
|
8
7
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
animations: AdminCountPillAnimations,
|
|
10
8
|
imports: [
|
|
11
9
|
],
|
|
12
10
|
})
|
|
@@ -30,7 +28,7 @@ export class AdminCountPillComponent implements OnInit {
|
|
|
30
28
|
constructor() { }
|
|
31
29
|
|
|
32
30
|
// --------------- LOAD AND CLEANUP --------------------
|
|
33
|
-
|
|
31
|
+
|
|
34
32
|
ngOnInit(): void {
|
|
35
33
|
}
|
|
36
34
|
}
|
|
@@ -1,37 +1,58 @@
|
|
|
1
|
-
import { render } from '@testing-library/angular';
|
|
1
|
+
import { render, screen } from '@testing-library/angular';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
|
|
4
4
|
import { AdminUserCountsComponent } from './admin-user-counts.component';
|
|
5
|
-
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
6
|
-
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
7
|
-
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
8
|
-
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
9
5
|
|
|
10
|
-
/** Sets up the testing environment for AdminUserCountsComponent using render
|
|
11
|
-
async function setup() {
|
|
6
|
+
/** Sets up the testing environment for AdminUserCountsComponent using render. */
|
|
7
|
+
async function setup(eventSpies: any = {}) {
|
|
12
8
|
const user = userEvent.setup();
|
|
13
|
-
const checkedSpy = jest.fn();
|
|
14
9
|
|
|
15
10
|
const view = await render(AdminUserCountsComponent, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
providers: [],
|
|
12
|
+
componentInputs: {
|
|
13
|
+
counts: {
|
|
14
|
+
submitInterest: 5,
|
|
15
|
+
waiting: 12,
|
|
16
|
+
consent: 7,
|
|
17
|
+
done: 22,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
on: {
|
|
21
|
+
refresh: jest.fn(),
|
|
22
|
+
...eventSpies,
|
|
23
|
+
},
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
return {
|
|
26
27
|
user,
|
|
27
28
|
fixture: view.fixture,
|
|
28
|
-
rerender: () => view.rerender(), // add component inputs if needed
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
describe('AdminUserCountsComponent', () => {
|
|
33
|
-
it('should
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
it('should render all count pills with correct values', async () => {
|
|
34
|
+
await setup();
|
|
35
|
+
|
|
36
|
+
expect(screen.getByText('Interested:')).toBeVisible();
|
|
37
|
+
expect(screen.getByText('5')).toBeVisible();
|
|
38
|
+
|
|
39
|
+
expect(screen.getByText('Waitlist:')).toBeVisible();
|
|
40
|
+
expect(screen.getByText('12')).toBeVisible();
|
|
41
|
+
|
|
42
|
+
expect(screen.getByText('Consent:')).toBeVisible();
|
|
43
|
+
expect(screen.getByText('7')).toBeVisible();
|
|
44
|
+
|
|
45
|
+
expect(screen.getByText('Done:')).toBeVisible();
|
|
46
|
+
expect(screen.getByText('22')).toBeVisible();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should emit refresh output when refresh button is clicked', async () => {
|
|
50
|
+
const refreshSpy = jest.fn();
|
|
51
|
+
const { user } = await setup({ refresh: refreshSpy });
|
|
52
|
+
|
|
53
|
+
const refreshBtn = screen.getByRole('button', { name: /refresh/i });
|
|
54
|
+
await user.click(refreshBtn);
|
|
55
|
+
|
|
56
|
+
expect(refreshSpy).toHaveBeenCalled();
|
|
36
57
|
});
|
|
37
58
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
|
|
2
|
-
import { AdminUserCountsAnimations } from './admin-user-counts.animations';
|
|
3
2
|
import { MatButton } from '@angular/material/button';
|
|
4
3
|
import { MatIcon } from '@angular/material/icon';
|
|
5
4
|
import { AdminCountPillComponent } from './admin-count-pill/admin-count-pill.component';
|
|
@@ -14,11 +13,10 @@ export interface AdminCounts {
|
|
|
14
13
|
@Component({
|
|
15
14
|
selector: 'app-admin-user-counts',
|
|
16
15
|
templateUrl: './admin-user-counts.component.html',
|
|
17
|
-
|
|
16
|
+
styleUrl: './admin-user-counts.component.scss',
|
|
18
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
-
animations: AdminUserCountsAnimations,
|
|
20
18
|
imports: [
|
|
21
|
-
MatButton, MatIcon, AdminCountPillComponent
|
|
19
|
+
MatButton, MatIcon, AdminCountPillComponent,
|
|
22
20
|
],
|
|
23
21
|
})
|
|
24
22
|
export class AdminUserCountsComponent implements OnInit {
|
|
@@ -41,7 +39,7 @@ export class AdminUserCountsComponent implements OnInit {
|
|
|
41
39
|
constructor() { }
|
|
42
40
|
|
|
43
41
|
// --------------- LOAD AND CLEANUP --------------------
|
|
44
|
-
|
|
42
|
+
|
|
45
43
|
ngOnInit(): void {
|
|
46
44
|
}
|
|
47
45
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
(updateState)="updateState($event.user, $event.key, $event.value)">
|
|
16
16
|
</app-admin-user-table>
|
|
17
17
|
|
|
18
|
-
@if (waitingUsers().length
|
|
18
|
+
@if (waitingUsers().length >= limitState()) {
|
|
19
19
|
<div class="load-more-container">
|
|
20
20
|
<button mat-button class="load-more-btn" (click)="loadMore()">Load More (Showing {{limitState()}})</button>
|
|
21
21
|
</div>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
(filterChange)="filterState.set($event)">
|
|
45
45
|
</app-admin-user-table>
|
|
46
46
|
|
|
47
|
-
@if (otherUsersFetchedCount()
|
|
47
|
+
@if (otherUsersFetchedCount() >= otherLimitState()) {
|
|
48
48
|
<div class="load-more-container">
|
|
49
49
|
<button mat-button class="load-more-btn" (click)="loadMoreOther()">Load More (Showing {{otherLimitState()}})</button>
|
|
50
50
|
</div>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/angular';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
+
import { Provider } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
import { AdminUserListComponent } from './admin-user-list.component';
|
|
7
|
+
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
8
|
+
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
9
|
+
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
10
|
+
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
11
|
+
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
12
|
+
import { AuthLoggedInMockDB } from 'src/app/core/store/auth/auth.mock';
|
|
13
|
+
import { UserStore } from 'src/app/core/store/user/user.store';
|
|
14
|
+
import { UserContextStore } from 'src/app/core/store/user-context/user-context.store';
|
|
15
|
+
import { AccessState } from 'src/app/core/store/user/user.model';
|
|
16
|
+
import { provideFirebaseMock } from 'src/app/core/firebase/firebase.mock.service';
|
|
17
|
+
import { MOCK_USER_LIST } from 'src/app/core/store/user/user.mock';
|
|
18
|
+
import { MOCK_USERCONTEXT_LIST } from 'src/app/core/store/user-context/user-context.mock';
|
|
19
|
+
|
|
20
|
+
/** Sets up the testing environment for AdminUserListComponent using render. */
|
|
21
|
+
async function setup(providers: Provider[] = [], seededUsers: any[] = [], seededUserContexts: any[] = []) {
|
|
22
|
+
const user = userEvent.setup();
|
|
23
|
+
const snackBarMock = {
|
|
24
|
+
open: jest.fn(),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const view = await render(AdminUserListComponent, {
|
|
28
|
+
providers: [
|
|
29
|
+
...provideFirebaseMock({
|
|
30
|
+
users: seededUsers,
|
|
31
|
+
userContexts: seededUserContexts,
|
|
32
|
+
}),
|
|
33
|
+
{ provide: MatSnackBar, useValue: snackBarMock },
|
|
34
|
+
{ provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
|
|
35
|
+
{ provide: AuthStore, useClass: AuthLoggedInMockDB },
|
|
36
|
+
UserStore,
|
|
37
|
+
UserContextStore,
|
|
38
|
+
...providers,
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
user,
|
|
44
|
+
fixture: view.fixture,
|
|
45
|
+
snackBarMock,
|
|
46
|
+
dbService: view.fixture.debugElement.injector.get(FirebaseMockService),
|
|
47
|
+
userStore: view.fixture.debugElement.injector.get(UserStore),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
describe('AdminUserListComponent', () => {
|
|
52
|
+
it('should fetch database counts on init and render count pills', async () => {
|
|
53
|
+
await setup([], MOCK_USER_LIST, MOCK_USERCONTEXT_LIST);
|
|
54
|
+
|
|
55
|
+
// Wait for the asynchronous count queries in refreshCounts() to complete
|
|
56
|
+
await waitFor(() => {
|
|
57
|
+
expect(screen.getByText('Interested:')).toBeVisible();
|
|
58
|
+
expect(screen.getByText('Waitlist:')).toBeVisible();
|
|
59
|
+
expect(screen.getByText('Consent:')).toBeVisible();
|
|
60
|
+
expect(screen.getByText('Done:')).toBeVisible();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should stream waiting users and other users into their respective tables', async () => {
|
|
65
|
+
await setup([], MOCK_USER_LIST, MOCK_USERCONTEXT_LIST);
|
|
66
|
+
|
|
67
|
+
// Wait for streams to populate and display user rows
|
|
68
|
+
expect(await screen.findByText('Alice Waiting')).toBeVisible();
|
|
69
|
+
expect(screen.getByText('Bob Done')).toBeVisible();
|
|
70
|
+
|
|
71
|
+
// Verify user context data is rendered (questionOne / questionTwo) with findByText to allow async resolution
|
|
72
|
+
expect(await screen.findByText('Answer to question one')).toBeVisible();
|
|
73
|
+
expect(screen.getByText('technical coaching')).toBeVisible();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should handle pagination limit state updates when clicking Load More', async () => {
|
|
77
|
+
const { fixture, userStore } = await setup([], MOCK_USER_LIST, MOCK_USERCONTEXT_LIST);
|
|
78
|
+
|
|
79
|
+
const streamSpy = jest.spyOn(userStore, 'stream');
|
|
80
|
+
const compInstance = fixture.componentInstance;
|
|
81
|
+
|
|
82
|
+
compInstance.loadMore();
|
|
83
|
+
expect(compInstance.limitState()).toBe(40);
|
|
84
|
+
expect(streamSpy).toHaveBeenCalled();
|
|
85
|
+
|
|
86
|
+
compInstance.loadMoreOther();
|
|
87
|
+
expect(compInstance.otherLimitState()).toBe(40);
|
|
88
|
+
|
|
89
|
+
streamSpy.mockRestore();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should call userStore update and display confirmation snackbar when access state is changed', async () => {
|
|
93
|
+
const { fixture, userStore, snackBarMock } = await setup([], MOCK_USER_LIST, MOCK_USERCONTEXT_LIST);
|
|
94
|
+
|
|
95
|
+
const updateSpy = jest.spyOn(userStore, 'update').mockResolvedValue(undefined as any);
|
|
96
|
+
|
|
97
|
+
// Wait for Bob Done row to render
|
|
98
|
+
expect(await screen.findByText('Bob Done')).toBeVisible();
|
|
99
|
+
|
|
100
|
+
const compInstance = fixture.componentInstance;
|
|
101
|
+
await compInstance.updateState(MOCK_USER_LIST[0], 'accessState', AccessState.DONE);
|
|
102
|
+
|
|
103
|
+
expect(updateSpy).toHaveBeenCalledWith('u1', { accessState: AccessState.DONE });
|
|
104
|
+
expect(snackBarMock.open).toHaveBeenCalledWith("Set Alice Waiting's accessState to done", '', { duration: 3000 });
|
|
105
|
+
|
|
106
|
+
updateSpy.mockRestore();
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -29,8 +29,9 @@ type UpdateValueTypes = AccessState;
|
|
|
29
29
|
@Component({
|
|
30
30
|
selector: 'app-admin-user-list',
|
|
31
31
|
templateUrl: './admin-user-list.component.html',
|
|
32
|
-
|
|
32
|
+
styleUrl: './admin-user-list.component.scss',
|
|
33
33
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
standalone: true,
|
|
34
35
|
imports: [
|
|
35
36
|
MatIcon,
|
|
36
37
|
MatTooltip,
|
|
@@ -77,10 +78,10 @@ export class AdminUserListComponent implements OnInit {
|
|
|
77
78
|
waitingUsers: Signal<AdminRow[]> = computed(() => {
|
|
78
79
|
// Fetch all users locally to perform client-side sort and filter
|
|
79
80
|
const users = this.userStore.selectEntities([
|
|
80
|
-
['accessState', '==', AccessState.WAITING]
|
|
81
|
+
['accessState', '==', AccessState.WAITING],
|
|
81
82
|
], {});
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
const rows = users.map((user) => {
|
|
84
85
|
const context = this.userContextStore.selectFirst([['__userId', '==', user.__id]], {});
|
|
85
86
|
return { user, context };
|
|
86
87
|
});
|
|
@@ -91,13 +92,13 @@ export class AdminUserListComponent implements OnInit {
|
|
|
91
92
|
/** Get array of all other users and their context. */
|
|
92
93
|
otherUsersFetchedCount = computed(() => {
|
|
93
94
|
return this.userStore.selectEntities([
|
|
94
|
-
['accessState', 'in', [AccessState.SUBMIT_INTEREST, AccessState.CONSENT, AccessState.DONE]]
|
|
95
|
+
['accessState', 'in', [AccessState.SUBMIT_INTEREST, AccessState.CONSENT, AccessState.DONE]],
|
|
95
96
|
], {}).length;
|
|
96
97
|
});
|
|
97
98
|
|
|
98
99
|
otherUsers: Signal<AdminRow[]> = computed(() => {
|
|
99
100
|
const users = this.userStore.selectEntities([
|
|
100
|
-
['accessState', 'in', [AccessState.SUBMIT_INTEREST, AccessState.CONSENT, AccessState.DONE]]
|
|
101
|
+
['accessState', 'in', [AccessState.SUBMIT_INTEREST, AccessState.CONSENT, AccessState.DONE]],
|
|
101
102
|
], {});
|
|
102
103
|
|
|
103
104
|
let rows = users.map((user) => {
|
|
@@ -186,7 +187,7 @@ export class AdminUserListComponent implements OnInit {
|
|
|
186
187
|
this.db.count('users', [['accessState', '==', AccessState.SUBMIT_INTEREST]]),
|
|
187
188
|
this.db.count('users', [['accessState', '==', AccessState.WAITING]]),
|
|
188
189
|
this.db.count('users', [['accessState', '==', AccessState.CONSENT]]),
|
|
189
|
-
this.db.count('users', [['accessState', '==', AccessState.DONE]])
|
|
190
|
+
this.db.count('users', [['accessState', '==', AccessState.DONE]]),
|
|
190
191
|
]);
|
|
191
192
|
this.counts.set({ submitInterest, waiting, consent, done });
|
|
192
193
|
}
|
|
@@ -196,25 +197,24 @@ export class AdminUserListComponent implements OnInit {
|
|
|
196
197
|
[['accessState', '==', AccessState.WAITING]],
|
|
197
198
|
{ limit: this.limitState(), orderBy: [['_createdAt', 'asc']] },
|
|
198
199
|
this.injector,
|
|
199
|
-
(user) => [StreamUserContext.create(this.userContextStore, [['__userId', '==', user.__id]], {})]
|
|
200
|
+
(user) => [StreamUserContext.create(this.userContextStore, [['__userId', '==', user.__id]], {})],
|
|
200
201
|
);
|
|
201
202
|
this.userStore.stream(
|
|
202
203
|
[['accessState', 'in', [AccessState.SUBMIT_INTEREST, AccessState.CONSENT, AccessState.DONE]]],
|
|
203
204
|
{ limit: this.otherLimitState(), orderBy: [['_updatedAt', 'desc']] },
|
|
204
205
|
this.injector,
|
|
205
|
-
(user) => [StreamUserContext.create(this.userContextStore, [['__userId', '==', user.__id]], {})]
|
|
206
|
+
(user) => [StreamUserContext.create(this.userContextStore, [['__userId', '==', user.__id]], {})],
|
|
206
207
|
);
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
|
|
210
|
-
|
|
211
211
|
loadMore() {
|
|
212
|
-
this.limitState.update(l => l + 20);
|
|
212
|
+
this.limitState.update((l) => l + 20);
|
|
213
213
|
this.triggerStream();
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
loadMoreOther() {
|
|
217
|
-
this.otherLimitState.update(l => l + 20);
|
|
217
|
+
this.otherLimitState.update((l) => l + 20);
|
|
218
218
|
this.triggerStream();
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
@for (option of accessOptions(); track option) {
|
|
47
47
|
<button mat-menu-item (click)="filterChange.emit(option)"
|
|
48
48
|
[class.selected]="filterState() === option">
|
|
49
|
-
{{ option }}
|
|
49
|
+
<mat-icon [style.color]="getAccessStateColor(option)">{{ getAccessStateIcon(option) }}</mat-icon>
|
|
50
|
+
{{ formatAccessState(option) }}
|
|
50
51
|
</button>
|
|
51
52
|
}
|
|
52
53
|
</mat-menu>
|
|
@@ -62,7 +63,10 @@
|
|
|
62
63
|
</div>
|
|
63
64
|
<mat-menu #accessStateMenu="matMenu">
|
|
64
65
|
@for (option of accessOptions(); track option) {
|
|
65
|
-
<button mat-menu-item (click)="updateState.emit({user: row.user, key: 'accessState', value: option})">
|
|
66
|
+
<button mat-menu-item (click)="updateState.emit({user: row.user, key: 'accessState', value: option})">
|
|
67
|
+
<mat-icon [style.color]="getAccessStateColor(option)">{{ getAccessStateIcon(option) }}</mat-icon>
|
|
68
|
+
{{ formatAccessState(option) }}
|
|
69
|
+
</button>
|
|
66
70
|
}
|
|
67
71
|
</mat-menu>
|
|
68
72
|
</td>
|
|
@@ -1,37 +1,154 @@
|
|
|
1
|
-
import { render } from '@testing-library/angular';
|
|
1
|
+
import { render, screen } from '@testing-library/angular';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { Timestamp } from '@angular/fire/firestore';
|
|
4
|
+
import { fireEvent } from '@testing-library/dom';
|
|
3
5
|
|
|
4
6
|
import { AdminUserTableComponent } from './admin-user-table.component';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
8
|
-
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
7
|
+
import { AccessState } from 'src/app/core/store/user/user.model';
|
|
8
|
+
import { AdminRow } from '../admin-user-list.component';
|
|
9
9
|
|
|
10
|
-
/** Sets up the testing environment for AdminUserTableComponent using render
|
|
11
|
-
async function setup() {
|
|
10
|
+
/** Sets up the testing environment for AdminUserTableComponent using render. */
|
|
11
|
+
async function setup(componentInputs: any = {}, eventSpies: any = {}) {
|
|
12
12
|
const user = userEvent.setup();
|
|
13
|
-
const checkedSpy = jest.fn();
|
|
14
13
|
|
|
15
14
|
const view = await render(AdminUserTableComponent, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
providers: [],
|
|
16
|
+
componentInputs: {
|
|
17
|
+
dataSource: [],
|
|
18
|
+
displayedColumns: ['userName', 'questionOne', 'questionTwo', 'accessState'],
|
|
19
|
+
accessOptions: Object.values(AccessState),
|
|
20
|
+
...componentInputs,
|
|
21
|
+
},
|
|
22
|
+
on: {
|
|
23
|
+
sortChange: jest.fn(),
|
|
24
|
+
updateState: jest.fn(),
|
|
25
|
+
filterChange: jest.fn(),
|
|
26
|
+
...eventSpies,
|
|
27
|
+
},
|
|
23
28
|
});
|
|
24
29
|
|
|
25
30
|
return {
|
|
26
31
|
user,
|
|
27
32
|
fixture: view.fixture,
|
|
28
|
-
|
|
33
|
+
view,
|
|
29
34
|
};
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
describe('AdminUserTableComponent', () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
const mockRows: AdminRow[] = [
|
|
39
|
+
{
|
|
40
|
+
user: {
|
|
41
|
+
__id: 'u1',
|
|
42
|
+
name: 'John Doe',
|
|
43
|
+
email: 'john@example.com',
|
|
44
|
+
accessState: AccessState.WAITING,
|
|
45
|
+
isAdmin: false,
|
|
46
|
+
consented: false,
|
|
47
|
+
joinedWaitlistAt: Timestamp.fromDate(new Date('2026-05-20T12:00:00Z')),
|
|
48
|
+
_createdAt: Timestamp.now(),
|
|
49
|
+
_updatedAt: Timestamp.now(),
|
|
50
|
+
},
|
|
51
|
+
context: {
|
|
52
|
+
__id: 'uc1',
|
|
53
|
+
__userId: 'u1',
|
|
54
|
+
questionOne: 'Answer to question one',
|
|
55
|
+
questionTwo: 'Answer to question two',
|
|
56
|
+
_createdAt: Timestamp.now(),
|
|
57
|
+
_updatedAt: Timestamp.now(),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
it('should render empty state when no users are provided', async () => {
|
|
63
|
+
await setup({ dataSource: [] });
|
|
64
|
+
|
|
65
|
+
expect(screen.getByText('No users to display.')).toBeVisible();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should render table headers and user row details correctly', async () => {
|
|
69
|
+
await setup({ dataSource: mockRows });
|
|
70
|
+
|
|
71
|
+
expect(screen.queryByText('No users to display.')).not.toBeInTheDocument();
|
|
72
|
+
|
|
73
|
+
// Check column values
|
|
74
|
+
expect(screen.getByText('John Doe')).toBeVisible();
|
|
75
|
+
expect(screen.getByText('Answer to question one')).toBeVisible();
|
|
76
|
+
expect(screen.getByText('Answer to question two')).toBeVisible();
|
|
77
|
+
|
|
78
|
+
// Check formatted date
|
|
79
|
+
expect(screen.getByText('05.20')).toBeVisible();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should emit sortChange output when header is clicked and sortable is true', async () => {
|
|
83
|
+
const sortChangeSpy = jest.fn();
|
|
84
|
+
const { user } = await setup({
|
|
85
|
+
dataSource: mockRows,
|
|
86
|
+
sortable: true,
|
|
87
|
+
}, {
|
|
88
|
+
sortChange: sortChangeSpy,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const nameHeader = screen.getByRole('columnheader', { name: /name/i });
|
|
92
|
+
// Click header to sort
|
|
93
|
+
await user.click(nameHeader);
|
|
94
|
+
|
|
95
|
+
expect(sortChangeSpy).toHaveBeenCalledWith({
|
|
96
|
+
active: 'userName',
|
|
97
|
+
direction: 'asc',
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('should open state menu and emit updateState on selection', async () => {
|
|
102
|
+
const updateStateSpy = jest.fn();
|
|
103
|
+
const { user } = await setup({
|
|
104
|
+
dataSource: mockRows,
|
|
105
|
+
}, {
|
|
106
|
+
updateState: updateStateSpy,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Find the state icon container (which triggers the menu)
|
|
110
|
+
const stateContainer = screen.getByLabelText('accessState');
|
|
111
|
+
await user.click(stateContainer);
|
|
112
|
+
|
|
113
|
+
// Click 'done' option from MatMenu
|
|
114
|
+
const doneOption = await screen.findByText('done');
|
|
115
|
+
await user.click(doneOption);
|
|
116
|
+
|
|
117
|
+
expect(updateStateSpy).toHaveBeenCalledWith({
|
|
118
|
+
user: mockRows[0].user,
|
|
119
|
+
key: 'accessState',
|
|
120
|
+
value: 'done',
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should show state filter trigger and emit filterChange when filter option is selected', async () => {
|
|
125
|
+
const filterChangeSpy = jest.fn();
|
|
126
|
+
const { user } = await setup({
|
|
127
|
+
dataSource: mockRows,
|
|
128
|
+
showFilter: true,
|
|
129
|
+
}, {
|
|
130
|
+
filterChange: filterChangeSpy,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// Click on the State filter button in header
|
|
134
|
+
const filterBtn = screen.getByRole('button', { name: /state/i });
|
|
135
|
+
await user.click(filterBtn);
|
|
136
|
+
|
|
137
|
+
// Click 'All States' from MatMenu
|
|
138
|
+
const allStatesOption = await screen.findByText('All States');
|
|
139
|
+
await user.click(allStatesOption);
|
|
140
|
+
|
|
141
|
+
expect(filterChangeSpy).toHaveBeenCalledWith('ALL');
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('should return correct visual icons and colors for helper methods', async () => {
|
|
145
|
+
const { view } = await setup({ dataSource: mockRows });
|
|
146
|
+
const component = view.fixture.componentInstance;
|
|
147
|
+
|
|
148
|
+
expect(component.getAccessStateIcon(AccessState.WAITING)).toBe('pending_actions');
|
|
149
|
+
expect(component.getAccessStateIcon(AccessState.DONE)).toBe('check_circle');
|
|
150
|
+
|
|
151
|
+
expect(component.getAccessStateColor(AccessState.WAITING)).toBe('#f57c00');
|
|
152
|
+
expect(component.getAccessStateColor(AccessState.DONE)).toBe('#388e3c');
|
|
36
153
|
});
|
|
37
154
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
|
|
2
|
-
import { AdminUserTableAnimations } from './admin-user-table.animations';
|
|
3
2
|
import { DatePipe } from '@angular/common';
|
|
4
3
|
import { MatTable, MatColumnDef, MatHeaderCellDef, MatHeaderCell, MatCellDef, MatCell, MatHeaderRowDef, MatHeaderRow, MatRowDef, MatRow } from '@angular/material/table';
|
|
5
4
|
import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu';
|
|
@@ -13,9 +12,8 @@ import { AdminRow } from '../admin-user-list.component';
|
|
|
13
12
|
@Component({
|
|
14
13
|
selector: 'app-admin-user-table',
|
|
15
14
|
templateUrl: './admin-user-table.component.html',
|
|
16
|
-
|
|
15
|
+
styleUrl: './admin-user-table.component.scss',
|
|
17
16
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
-
animations: AdminUserTableAnimations,
|
|
19
17
|
imports: [
|
|
20
18
|
DatePipe,
|
|
21
19
|
MatTable,
|
|
@@ -34,7 +32,7 @@ import { AdminRow } from '../admin-user-list.component';
|
|
|
34
32
|
MatIcon,
|
|
35
33
|
MatButton,
|
|
36
34
|
MatTooltipModule,
|
|
37
|
-
MatSortModule
|
|
35
|
+
MatSortModule,
|
|
38
36
|
],
|
|
39
37
|
})
|
|
40
38
|
export class AdminUserTableComponent implements OnInit {
|
|
@@ -109,10 +107,15 @@ export class AdminUserTableComponent implements OnInit {
|
|
|
109
107
|
return timestamp ? timestamp.toDate() : null;
|
|
110
108
|
}
|
|
111
109
|
|
|
110
|
+
formatAccessState(state: AccessState | 'ALL'): string {
|
|
111
|
+
if (state === 'ALL') return 'All States';
|
|
112
|
+
return state.replace(/^\d{2}\s*-\s*/, '');
|
|
113
|
+
}
|
|
114
|
+
|
|
112
115
|
constructor() { }
|
|
113
116
|
|
|
114
117
|
// --------------- LOAD AND CLEANUP --------------------
|
|
115
|
-
|
|
118
|
+
|
|
116
119
|
ngOnInit(): void {
|
|
117
120
|
}
|
|
118
121
|
}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
height: 100%;
|
|
3
3
|
width: 100%;
|
|
4
4
|
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
// The routed component fills remaining space after the dev-status-bar.
|
|
9
|
+
// Angular inserts the routed component as a sibling immediately after <router-outlet>.
|
|
10
|
+
::ng-deep router-outlet + * {
|
|
11
|
+
flex: 1;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
}
|
|
5
15
|
|
|
6
16
|
app-redeployment-warning {
|
|
7
17
|
position: fixed;
|