Skip to content

Commit 04d2eec

Browse files
committed
fix(arc-saas): review changes
review changes GH-64
1 parent aab6838 commit 04d2eec

File tree

8 files changed

+14
-38
lines changed

8 files changed

+14
-38
lines changed

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 = '3be3tt3bkl6sf1pkdiurejejm7phdvhd1fnkch7esiva38p6g6v';
382+
clientSecret.value = this.appConfig.publicKey;;
383383
form.appendChild(clientSecret);
384384
document.body.appendChild(form);
385385
form.submit();

projects/saas-ui/src/app/main/commands/add-features.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class AddFeaturesCommand<T> extends PostAPICommand<Feature[]> {
1414
super(
1515
apiService,
1616
adapter,
17-
`https://arc-saas.net/subscription-service/plans/${planId}/features`,
17+
`${appConfig.baseApiUrl}${appConfig.subscriptionServiceUrl}/plans/${planId}/features`,
1818
);
1919
}
2020
}

projects/saas-ui/src/app/main/commands/edit-features.command.ts renamed to projects/saas-ui/src/app/main/commands/edit-features-by-planid.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {ApiService, IAdapter, PatchAPICommand} from '@project-lib/core/api';
33
import {Inject} from '@angular/core';
44
import {APP_CONFIG} from '@project-lib/app-config';
55
import {IAnyObject} from '@project-lib/core/i-any-object';
6-
export class EditFeaturesCommand<T> extends PatchAPICommand<T> {
6+
export class EditFeaturesByPlanIdCommand<T> extends PatchAPICommand<T> {
77
constructor(
88
apiService: ApiService,
99
adapter: IAdapter<T>,

projects/saas-ui/src/app/main/commands/get-feature-by-id.command.ts renamed to projects/saas-ui/src/app/main/commands/get-feature-by-planid.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {IAnyObject} from '@project-lib/core/i-any-object';
66
import {Plan} from '../../shared/models';
77
import {FeatureValues} from '../../shared/models/feature-values.model';
88
import {PlanWithFeatures} from '../../shared/models/plans-features.model';
9-
export class GetFeatureByIdCommand<T> extends GetAPICommand<PlanWithFeatures> {
9+
export class GetFeatureByPlanIdCommand<T> extends GetAPICommand<PlanWithFeatures> {
1010
parameters: {};
1111
constructor(
1212
apiService: IApiService,

projects/saas-ui/src/app/main/commands/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ export * from './get-total-tenant.command';
1616
export * from './get-total-plan.command';
1717
export * from './get-total-billing-plan.command';
1818
export * from './add-features.command';
19-
export * from './edit-features.command';
20-
export * from './get-feature-by-id.command';
19+
export * from './edit-features-by-planid.command';
20+
export * from './get-feature-by-planid.command';
2121
export * from './get-features.command';

projects/saas-ui/src/app/main/components/add-plan/add-plan.component.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ <h3>General Details</h3>
1616
<div class="input-box">
1717
<div class="input-title icon-wrapper">
1818
<span>Name <span class="required">*</span></span>
19-
<!-- <nb-icon
20-
icon="info-outline"
21-
class="info-icon"
22-
[nbTooltip]="
23-
'Please enter the name of the plan. This is a required field.'
24-
"
25-
></nb-icon> -->
2619
</div>
2720
<div class="input-container">
2821
<div class="input">
@@ -49,7 +42,7 @@ <h3>General Details</h3>
4942
<div class="select">
5043
<nb-select
5144
class="dropdown-wrapper"
52-
placeholder="Select Plan"
45+
placeholder="Choose Your Plan"
5346
status="basic"
5447
formControlName="billingCycleId"
5548
>
@@ -127,11 +120,6 @@ <h3>General Details</h3>
127120
nbInput
128121
rows="4"
129122
></textarea>
130-
<!-- <nb-icon
131-
icon="info-outline"
132-
class="info-icon"
133-
nbTooltip="Please write Description about the plan. This field is required."
134-
></nb-icon> -->
135123
</div>
136124
</div>
137125
</div>
@@ -235,7 +223,6 @@ <h3>Plan Configuration</h3>
235223
</div>
236224

237225
<!-- AddPlan button -->
238-
<!-- *ngIf="isEditMode" -->
239226
<div class="regbtn button-wrapper">
240227
<button
241228
nbButton

projects/saas-ui/src/app/main/components/add-plan/add-plan.component.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export class AddPlanComponent implements OnInit {
101101
}
102102

103103
addPlan() {
104-
// if (this.addPlanForm.valid) {
105104
const domainData = this.addPlanForm.value;
106105
domainData.price = parseFloat(domainData.price);
107106
domainData.tier = String(domainData.tier);
@@ -211,9 +210,8 @@ export class AddPlanComponent implements OnInit {
211210
this.billingplanService
212211
.getPlanById(this.activateRoute.snapshot.params.id)
213212
.subscribe(response => {
214-
// const body = JSON.parse(JSON.stringify(response)).body;
215213
const tierName = response.tier;
216-
// response.tier = JSON.stringify(body.tier);
214+
217215

218216
this.addPlanForm = this.fb.group({
219217
name: [response.name, Validators.required],
@@ -229,17 +227,13 @@ export class AddPlanComponent implements OnInit {
229227
this.featureListService
230228
.getFeatureById(this.activateRoute.snapshot.params.id)
231229
.subscribe(resp => {
232-
// const featureBody = JSON.parse(JSON.stringify(resp)).body;
233-
// const features = resp.features;
234230
const features = resp.features;
235-
// (f as any).key
236231
this.featureValue = resp;
237232
this.createFeatureControls();
238233
const featuresGroup = this.addPlanForm.get('features') as FormGroup;
239234
if (featuresGroup) {
240235
Object.keys(featuresGroup.controls).forEach(controlName => {
241236
featuresGroup.get(controlName)?.setValue(
242-
// features.find(item => item.key === controlName)?.value?.value,
243237
features.find(item => item.key === controlName)?.value?.value,
244238
);
245239
});
@@ -324,8 +318,6 @@ export class AddPlanComponent implements OnInit {
324318
.subscribe(respFeature => {
325319
console.log(respFeature);
326320
});
327-
328-
// this.featureListService.editFeatures()
329321
} else {
330322
// Handle form validation errors if necessary
331323
console.error('Form is invalid');
@@ -362,8 +354,6 @@ export class AddPlanComponent implements OnInit {
362354
getCurrencyDetails() {
363355
this.billingplanService.getCurrencyDetails().subscribe(response => {
364356
this.currencyOptions = response;
365-
366-
// test
367357
if (this.currencyOptions.length > 0) {
368358
this.defaultCurrencyId = this.currencyOptions[0].id;
369359
this.addPlanForm.get('currencyId').setValue(this.defaultCurrencyId);
@@ -374,7 +364,6 @@ export class AddPlanComponent implements OnInit {
374364
getBillingCycleDetails() {
375365
this.billingplanService.getBillingCycles().subscribe(cycleResp => {
376366
this.billingOptions = cycleResp;
377-
// test
378367
if (this.billingOptions.length > 0) {
379368
this.defaultBillingCycleId = this.billingOptions[0].id;
380369
this.addPlanForm.get('billingCycleId').setValue(this.defaultBillingCycleId);

projects/saas-ui/src/app/shared/services/feature-list-service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import {Observable, catchError, throwError} from 'rxjs';
1818
import {AddFeaturesCommand} from '../../main/commands/add-features.command';
1919
import {FeatureValues} from '../models/feature-values.model';
2020
import {AuthTokenSkipHeader} from '@project-lib/core/constants';
21-
import {EditFeaturesCommand} from '../../main/commands/edit-features.command';
22-
import {GetFeatureByIdCommand} from '../../main/commands/get-feature-by-id.command';
21+
import {EditFeaturesByPlanIdCommand} from '../../main/commands/edit-features-by-planid.command';
22+
import {GetFeatureByPlanIdCommand} from '../../main/commands/get-feature-by-planid.command';
2323
import {PlanWithFeatures} from '../models/plans-features.model';
2424

2525
interface BackendFilter<MT extends object = AnyObject> {
@@ -68,8 +68,8 @@ export class FeatureListService {
6868
}
6969

7070
editFeatures(featureValue: FeatureValues[], planId: string) {
71-
const command: EditFeaturesCommand<FeatureValues[]> =
72-
new EditFeaturesCommand(
71+
const command: EditFeaturesByPlanIdCommand<FeatureValues[]> =
72+
new EditFeaturesByPlanIdCommand(
7373
this.apiService,
7474
this.anyAdapter,
7575
planId,
@@ -82,8 +82,8 @@ export class FeatureListService {
8282
}
8383

8484
getFeatureById(planId: string) {
85-
const command: GetFeatureByIdCommand<PlanWithFeatures> =
86-
new GetFeatureByIdCommand(
85+
const command: GetFeatureByPlanIdCommand<PlanWithFeatures> =
86+
new GetFeatureByPlanIdCommand(
8787
this.apiService,
8888
this.anyAdapter,
8989
planId,

0 commit comments

Comments
 (0)