Skip to content

Commit b677433

Browse files
authored
Merge branch 'master' into GH-58-B
2 parents f65f382 + 55cd59c commit b677433

File tree

79 files changed

+4140
-471
lines changed

Some content is hidden

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

79 files changed

+4140
-471
lines changed

package-lock.json

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"@nebular/theme": "^11.0.0",
3434
"@ngx-translate/core": "^14.0.0",
3535
"@ngx-translate/http-loader": "^7.0.0",
36-
"@types/lodash": "^4.14.194",
36+
"@types/lodash": "^4.17.10",
3737
"ag-grid-angular": "^31.3.1",
38-
"ag-grid-community": "^31.3.1",
38+
"ag-grid-community": "^31.3.4",
3939
"date-fns": "^2.29.3",
4040
"dotenv": "^16.0.3",
4141
"eva-icons": "^1.1.3",
@@ -48,7 +48,7 @@
4848
"rxjs": "~7.8.0",
4949
"ts-node": "^10.9.1",
5050
"tslib": "^2.3.0",
51-
"zone.js": "~0.12.0"
51+
"zone.js": "~0.15.0"
5252
},
5353
"devDependencies": {
5454
"@angular-devkit/build-angular": "^15.2.6",

projects/arc-docs/src/app/app.component.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import {TestBed} from '@angular/core/testing';
22
import {RouterTestingModule} from '@angular/router/testing';
33
import {AppComponent} from './app.component';
4+
import {ActivatedRoute} from '@angular/router';
5+
import {TranslationService} from '@project-lib/core/localization';
6+
import {of} from 'rxjs';
47

58
describe('AppComponent', () => {
69
beforeEach(async () => {
710
await TestBed.configureTestingModule({
811
imports: [RouterTestingModule],
912
declarations: [AppComponent],
13+
providers: [
14+
TranslationService,
15+
{
16+
provide: ActivatedRoute,
17+
useValue: {paramMap: of(new Map())}, // Mock ActivatedRoute
18+
},
19+
],
1020
}).compileComponents();
1121
});
1222

projects/arc-docs/src/app/docs/getting-started/components/introduction/introduction.component.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22

33
import {IntroductionComponent} from './introduction.component';
4+
import {ActivatedRoute} from '@angular/router';
5+
import {of} from 'rxjs';
46

57
describe('IntroductionComponent', () => {
68
let component: IntroductionComponent;
@@ -9,6 +11,12 @@ describe('IntroductionComponent', () => {
911
beforeEach(async () => {
1012
await TestBed.configureTestingModule({
1113
declarations: [IntroductionComponent],
14+
providers: [
15+
{
16+
provide: ActivatedRoute,
17+
useValue: {paramMap: of(new Map())}, // Mock ActivatedRoute
18+
},
19+
],
1220
}).compileComponents();
1321

1422
fixture = TestBed.createComponent(IntroductionComponent);

projects/arc-lib/src/lib/components/gantt/services/gantt.service.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import {GanttModule} from '../gantt.module';
55
import {GanttService} from './gantt.service';
66

77
describe('GanttService', () => {
8+
89
let service: GanttService<AnyObject>;
910

11+
1012
beforeEach(() => {
1113
TestBed.configureTestingModule({
1214
imports: [GanttModule],

projects/arc-lib/src/lib/components/selector/select/select.component.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import {By} from '@angular/platform-browser';
1111
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
1212
import {RouterTestingModule} from '@angular/router/testing';
1313
import {TranslateService} from '@ngx-translate/core';
14-
import {finishVirtualScrollInit} from 'src/testing/virtual-scroll-init';
15-
// import { finishvirt}
16-
import {AngularTranslationServiceStub} from '../../../../testing/translation-service-stub';
14+
1715
import {DIGITS} from '@project-lib/core/constants';
1816
import {ThemeModule} from '@project-lib/theme/theme.module';
1917
import {SelectModule} from '../select.module';
@@ -292,3 +290,8 @@ describe('SelectComponent', () => {
292290
flush();
293291
}
294292
});
293+
function finishVirtualScrollInit(
294+
fixture: ComponentFixture<SelectTestComponent>,
295+
) {
296+
throw new Error('Function not implemented.');
297+
}

projects/arc-lib/src/lib/core/auth/auth.service.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {HttpHeaders} from '@angular/common/http';
2-
import {Inject, Injectable} from '@angular/core';
3-
import {Router} from '@angular/router';
4-
import {APP_CONFIG} from '@project-lib/app-config';
1+
import { HttpHeaders } from '@angular/common/http';
2+
import { Inject, Injectable } from '@angular/core';
3+
import { Router } from '@angular/router';
4+
import { APP_CONFIG } from '@project-lib/app-config';
55

66
import {
77
CoreAuthModule,
@@ -18,20 +18,20 @@ import {
1818
GetTokenCommand,
1919
GetCurrentUserCommand,
2020
} from '@project-lib/core/auth';
21-
import {SignUpAdapter} from '@project-lib/core/auth/adapters/signup-adapter.service';
22-
import {CreateExternalUserCommand} from '@project-lib/core/auth/commands/create-external-user.command';
23-
import {CreateTokenCommand} from '@project-lib/core/auth/commands/create-token.command';
21+
import { SignUpAdapter } from '@project-lib/core/auth/adapters/signup-adapter.service';
22+
import { CreateExternalUserCommand } from '@project-lib/core/auth/commands/create-external-user.command';
23+
import { CreateTokenCommand } from '@project-lib/core/auth/commands/create-token.command';
2424
import {
2525
AuthTokenSkipHeader,
2626
ErrToastSkipHeader,
2727
} from '@project-lib/core/constants';
28-
import {IAnyObject} from '@project-lib/core/i-any-object';
28+
import { IAnyObject } from '@project-lib/core/i-any-object';
2929
import {
3030
AnyAdapter,
3131
ApiService,
3232
UserSessionStoreService,
3333
} from '@project-lib/core/index';
34-
import {NgxPermissionsService} from 'ngx-permissions';
34+
import { NgxPermissionsService } from 'ngx-permissions';
3535
import {
3636
Observable,
3737
switchMap,
@@ -66,7 +66,7 @@ export class AuthService {
6666
private readonly anyAdapter: AnyAdapter,
6767
private readonly permissionsService: NgxPermissionsService,
6868
@Inject(APP_CONFIG) private readonly appConfig: IAnyObject,
69-
) {}
69+
) { }
7070

7171
public isLoggedIn(): Observable<boolean> {
7272
return this.currentUser().pipe(
@@ -343,6 +343,7 @@ export class AuthService {
343343
);
344344
}
345345

346+
346347
loginViaCognito(): void {
347348
const form = document.createElement('form');
348349
form.method = 'POST';
@@ -379,7 +380,7 @@ export class AuthService {
379380
const clientSecret = document.createElement('input');
380381
clientSecret.type = 'hidden';
381382
clientSecret.name = 'logout_uri';
382-
clientSecret.value = this.appConfig.publicKey;
383+
clientSecret.value = this.appConfig.publicKey;;
383384
form.appendChild(clientSecret);
384385
document.body.appendChild(form);
385386
form.submit();

projects/arc-lib/src/lib/core/validators.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,21 @@ export class CustomValidators {
1212
};
1313
}
1414
}
15+
16+
export function keyValidator(): ValidatorFn {
17+
return (control: AbstractControl): {[key: string]: any} | null => {
18+
const key = control.value;
19+
const maxLength = 10;
20+
const isValid = /^[A-Za-z][A-Za-z0-9]{0,9}$/.test(key);
21+
return isValid ? null : {keyInvalid: true};
22+
};
23+
}
24+
25+
26+
27+
export function domainMatchValidator(emailDomain: string): ValidatorFn {
28+
return (control: AbstractControl): {[key: string]: any} | null => {
29+
const domainValue = control.value;
30+
return domainValue === emailDomain ? null : { 'domainMismatch': true };
31+
};
32+
}

projects/arc/src/app/app.component.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {TestBed} from '@angular/core/testing';
22
import {RouterTestingModule} from '@angular/router/testing';
33
import {AppComponent} from './app.component';
4+
import {ActivatedRoute} from '@angular/router';
5+
import {of} from 'rxjs';
6+
import {IconPacksManagerService} from '@project-lib/theme/services';
47

58
describe('AppComponent', () => {
69
beforeEach(async () => {
@@ -10,6 +13,19 @@ describe('AppComponent', () => {
1013
}).compileComponents();
1114
});
1215

16+
beforeEach(async () => {
17+
await TestBed.configureTestingModule({
18+
declarations: [AppComponent],
19+
providers: [
20+
IconPacksManagerService,
21+
{
22+
provide: ActivatedRoute,
23+
useValue: {paramMap: of(new Map())}, // Mock ActivatedRoute
24+
},
25+
],
26+
}).compileComponents();
27+
});
28+
1329
it('should create the app', () => {
1430
const fixture = TestBed.createComponent(AppComponent);
1531
const app = fixture.componentInstance;

projects/arc/src/app/main/main.component.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {ThemeModule} from '@project-lib/theme/theme.module';
55

66
import {MainComponent} from './main.component';
77
import {MainModule} from './main.module';
8+
import {ActivatedRoute} from '@angular/router';
9+
import {of} from 'rxjs';
810

911
describe('MainComponent', () => {
1012
let component: MainComponent;
@@ -19,6 +21,12 @@ describe('MainComponent', () => {
1921
CoreModule,
2022
ThemeModule.forRoot('boiler'),
2123
],
24+
providers: [
25+
{
26+
provide: ActivatedRoute,
27+
useValue: {paramMap: of(new Map())}, // Mock ActivatedRoute
28+
},
29+
],
2230
}).compileComponents();
2331
});
2432

projects/arc/src/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ router-outlet.main-router + * {
5656
}
5757
.input-title {
5858
margin-top: 10px;
59+
font-weight: bold;
5960
span {
6061
font-size: 13px;
6162
}

projects/saas-ui/src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {OnBoardingComponent} from './on-boarding/on-boarding.component';
2323
import {NbLayoutModule, NbRadioModule} from '@nebular/theme';
2424
import {AgGridModule} from 'ag-grid-angular';
2525
import {environment} from '../environment';
26+
import {FeatureListService} from './shared/services/feature-list-service';
2627

2728
@NgModule({
2829
declarations: [AppComponent, OnBoardingComponent],
@@ -46,6 +47,7 @@ import {environment} from '../environment';
4647
TranslateStore,
4748
SystemStoreFacadeService,
4849
EnvAdapterService,
50+
FeatureListService,
4951
ApiService,
5052
{
5153
provide: APP_CONFIG,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {PostAPICommand, ApiService, IAdapter} from '@project-lib/core/api';
2+
import {IAnyObject} from '@project-lib/core/i-any-object';
3+
import {Plan} from '../../shared/models';
4+
import {Feature} from '../../shared/interfaces/features';
5+
export class AddFeaturesForPlanCommand<T> extends PostAPICommand<Feature[]> {
6+
parameters: any;
7+
8+
constructor(
9+
apiService: ApiService,
10+
adapter: IAdapter<Feature[]>,
11+
planId: string,
12+
appConfig: IAnyObject,
13+
) {
14+
super(
15+
apiService,
16+
adapter,
17+
`${appConfig.baseApiUrl}${appConfig.subscriptionServiceUrl}/plans/${planId}/features`,
18+
);
19+
}
20+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {ApiService, IAdapter, PatchAPICommand} from '@project-lib/core/api';
2+
3+
import {Inject} from '@angular/core';
4+
import {APP_CONFIG} from '@project-lib/app-config';
5+
import {IAnyObject} from '@project-lib/core/i-any-object';
6+
export class EditFeaturesByPlanIdCommand<T> extends PatchAPICommand<T> {
7+
constructor(
8+
apiService: ApiService,
9+
adapter: IAdapter<T>,
10+
planId: string,
11+
appConfig: IAnyObject,
12+
) {
13+
super(
14+
apiService,
15+
adapter,
16+
` ${appConfig.baseApiUrl}${appConfig.subscriptionServiceUrl}/plans/${planId}/features`,
17+
);
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import {IApiService, IAdapter, GetAPICommand} from '@project-lib/core/api';
2+
3+
import {Inject} from '@angular/core';
4+
import {APP_CONFIG} from '@project-lib/app-config';
5+
import {IAnyObject} from '@project-lib/core/i-any-object';
6+
import {Plan} from '../../shared/models';
7+
import {FeatureValues} from '../../shared/models/feature-values.model';
8+
import {PlanWithFeatures} from '../../shared/models/plans-features.model';
9+
export class GetFeatureByPlanIdCommand<T> extends GetAPICommand<PlanWithFeatures> {
10+
parameters: {};
11+
constructor(
12+
apiService: IApiService,
13+
adapter: IAdapter<PlanWithFeatures>,
14+
planId: string,
15+
appConfig: IAnyObject,
16+
) {
17+
super(
18+
apiService,
19+
adapter,
20+
`${appConfig.baseApiUrl}${appConfig.subscriptionServiceUrl}/plans/${planId}/features`,
21+
);
22+
}
23+
}

0 commit comments

Comments
 (0)