Skip to content

Commit 79226a9

Browse files
authored
Merge pull request #66 from sourcefuse/GH-64
feat(arc-saas): update add-plan component with features
2 parents dc619c1 + 9b3ba1a commit 79226a9

File tree

56 files changed

+2230
-604
lines changed

Some content is hidden

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

56 files changed

+2230
-604
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {GanttModule} from '../gantt.module';
55
import {GanttService} from './gantt.service';
66

77
describe('GanttService', () => {
8-
let service: GanttService<AnyObject, AnyObject>;
8+
let service: GanttService<any>;
99

1010
beforeEach(() => {
1111
TestBed.configureTestingModule({

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export class AuthService {
379379
const clientSecret = document.createElement('input');
380380
clientSecret.type = 'hidden';
381381
clientSecret.name = 'logout_uri';
382-
clientSecret.value = this.appConfig.publicKey;
382+
clientSecret.value = this.appConfig.publicKey;;
383383
form.appendChild(clientSecret);
384384
document.body.appendChild(form);
385385
form.submit();

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,11 @@ export function keyValidator(): ValidatorFn {
2222
};
2323
}
2424

25-
export function domainMatchValidator(
26-
emailControl: AbstractControl,
27-
domainControl: AbstractControl,
28-
): ValidatorFn {
29-
return (control: AbstractControl): ValidationErrors | null => {
30-
const emailValue = emailControl.value;
31-
const domainValue = domainControl.value;
3225

33-
if (!emailValue || !domainValue) {
34-
return null;
35-
}
3626

37-
const emailDomain = emailValue.split('@')[1];
38-
if (emailDomain !== domainValue) {
39-
return {domainMismatch: true};
40-
}
41-
42-
return null;
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 };
4331
};
4432
}

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,

0 commit comments

Comments
 (0)