-
Notifications
You must be signed in to change notification settings - Fork 0
fix: qbd direct advanced settings onboarding changes and content changes #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| <p>qbd-direct-onboarding-advanced-settings works!</p> | ||
| <div class="tw-pb-48-px"> | ||
| <app-onboarding-steppers [onboardingSteps]="onboardingSteps"></app-onboarding-steppers> | ||
| <app-qbd-direct-advanced-settings></app-qbd-direct-advanced-settings> | ||
| </div> |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,31 @@ | ||||||||||||||||||||||||||||||||||||||||
| import { Component } from '@angular/core'; | ||||||||||||||||||||||||||||||||||||||||
| import { CommonModule } from '@angular/common'; | ||||||||||||||||||||||||||||||||||||||||
| import { Component, OnInit } from '@angular/core'; | ||||||||||||||||||||||||||||||||||||||||
| import { QbdDirectSharedModule } from '../../qbd-direct-shared/qbd-direct-shared.module'; | ||||||||||||||||||||||||||||||||||||||||
| import { SharedModule } from 'src/app/shared/shared.module'; | ||||||||||||||||||||||||||||||||||||||||
| import { QbdDirectAdvancedSettingsComponent } from "../../qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component"; | ||||||||||||||||||||||||||||||||||||||||
| import { QbdDirectOnboardingModel } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-onboarding.model'; | ||||||||||||||||||||||||||||||||||||||||
| import { brandingContent } from 'src/app/branding/branding-config'; | ||||||||||||||||||||||||||||||||||||||||
| import { OnboardingStepper } from 'src/app/core/models/misc/onboarding-stepper.model'; | ||||||||||||||||||||||||||||||||||||||||
| import { WorkspaceService } from 'src/app/core/services/common/workspace.service'; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| @Component({ | ||||||||||||||||||||||||||||||||||||||||
| selector: 'app-qbd-direct-onboarding-advanced-settings', | ||||||||||||||||||||||||||||||||||||||||
| standalone: true, | ||||||||||||||||||||||||||||||||||||||||
| imports: [], | ||||||||||||||||||||||||||||||||||||||||
| imports: [CommonModule, QbdDirectSharedModule, SharedModule, QbdDirectAdvancedSettingsComponent], | ||||||||||||||||||||||||||||||||||||||||
| templateUrl: './qbd-direct-onboarding-advanced-settings.component.html', | ||||||||||||||||||||||||||||||||||||||||
| styleUrl: './qbd-direct-onboarding-advanced-settings.component.scss' | ||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||
| export class QbdDirectOnboardingAdvancedSettingsComponent { | ||||||||||||||||||||||||||||||||||||||||
| export class QbdDirectOnboardingAdvancedSettingsComponent implements OnInit { | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| brandingContent = brandingContent.configuration.advancedSettings; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| onboardingSteps: OnboardingStepper[] = new QbdDirectOnboardingModel().getOnboardingSteps(this.brandingContent.stepName, this.workspaceService.getOnboardingState()); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Move complex initialization to ngOnInit. The - onboardingSteps: OnboardingStepper[] = new QbdDirectOnboardingModel().getOnboardingSteps(this.brandingContent.stepName, this.workspaceService.getOnboardingState());
+ onboardingSteps: OnboardingStepper[] = [];
+
+ ngOnInit(): void {
+ try {
+ const onboardingState = this.workspaceService.getOnboardingState();
+ this.onboardingSteps = new QbdDirectOnboardingModel().getOnboardingSteps(
+ this.brandingContent.stepName,
+ onboardingState
+ );
+ } catch (error) {
+ console.error('Failed to initialize onboarding steps:', error);
+ // Handle error appropriately
+ }
+ }📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| constructor( | ||||||||||||||||||||||||||||||||||||||||
| private workspaceService: WorkspaceService | ||||||||||||||||||||||||||||||||||||||||
| ) { } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ngOnInit(): void { | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Implement more robust string replacement logic
The current implementation using array index manipulation could be fragile if the array structure changes or if the string is not found. Consider implementing a more robust mapping approach.
📝 Committable suggestion