Skip to content

Commit f9335e3

Browse files
committed
add help support
1 parent 5fa7849 commit f9335e3

6 files changed

Lines changed: 41 additions & 14 deletions

File tree

1.12 KB
Loading

src/app/features/expense-wise/expense-wise.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<app-settings *ngSwitchCase="'settings'"></app-settings>
1515
<app-budget *ngSwitchCase="'budget'"></app-budget>
1616
<app-ai *ngSwitchCase="'ai'"></app-ai>
17+
<app-help-dashboard *ngSwitchCase="'help'"></app-help-dashboard>
1718
<app-home *ngSwitchDefault></app-home>
1819
</ng-container>
1920
</main>

src/app/features/expense-wise/expense-wise.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { AiComponent } from '../../features/ai/ai.component';
1717
import { SectionService } from '../../service/section/section.service';
1818
import { ScreenTypeService } from '../../service/screen-type/screen-type.service';
1919
import { NativeAppServiceService } from '../../service/native-app/native-app-service.service';
20+
import { HelpDashboard } from '../help-dashboard/help-dashboard';
2021
/**
2122
* Root component of the application.
2223
* Manages global state, mobile view detection, section tracking,
@@ -27,7 +28,7 @@ import { NativeAppServiceService } from '../../service/native-app/native-app-ser
2728
standalone: true,
2829
imports: [
2930
NavbarComponent, SidebarComponent, FooterComponent, ToastComponent, CommonModule, AddExpenseComponent,
30-
SettingsComponent, ListExpensesComponent, HomeComponent, BudgetComponent, CalendarComponent, AiComponent
31+
SettingsComponent, ListExpensesComponent, HomeComponent, BudgetComponent, CalendarComponent, AiComponent, HelpDashboard
3132
],
3233
templateUrl: './expense-wise.component.html',
3334
styleUrl: './expense-wise.component.css'

src/app/features/settings/settings.component.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ <h2 class="text-xl font-semibold text-[var(--color-accent)] mb-3">
4949
</button>
5050
</app-setting-item>
5151

52+
<!-- <app-setting-item label="Help & Support">
53+
<button (click)="openHelpCenter('help', $event)"
54+
class="p-2 rounded-lg bg-[var(--color-accent)] hover:opacity-90 transition flex items-center justify-center">
55+
<img src="assets/img/icon/icons8-help-50.png" alt="Update" class="w-5 h-5"
56+
style="filter: invert(100%);" />
57+
</button>
58+
</app-setting-item> -->
5259
</div>
5360

5461
<!-- 🧩 CATEGORY SETTINGS -->

src/app/features/settings/settings.component.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { BudgetService } from '../../service/localStorage/budget.service';
1515
import { UserData } from '../../component/settings-components/download-component/download-component.component';
1616
import { GlobalLoaderService } from '../../service/global-loader/global-loader.service';
1717
import { PostApiService } from '../../service/backend-api/post/post-api.service';
18+
import { SectionService } from '../../service/section/section.service';
1819
/**
1920
* @component
2021
* @description
@@ -102,6 +103,7 @@ export class SettingsComponent {
102103
private toastService: ToastService,
103104
private globalLoaderService: GlobalLoaderService,
104105
private postApiService: PostApiService,
106+
private sectionService: SectionService
105107
) { }
106108

107109
/**
@@ -200,19 +202,21 @@ export class SettingsComponent {
200202
this.deleteCategoryForm.markAllAsTouched();
201203
return;
202204
}
203-
const category_id = this.deleteCategoryForm.value;
204-
this.categoryService.delete(category_id.category_id);
205-
this.toastService.show(`Category deleted succesfully.`, 'success');
206-
this.closeDeleteCategoryModal();
207-
const existingCategories: Category[] = this.categoryService.getAll();
208-
let userId = this.userService.getValue<string>('id') || '0';
209-
if (existingCategories.some(cat => cat.user_id === userId)) {
210-
this.showEditCategoryOption = true;
211-
this.showDeleteCategoryOption = true;
212-
}
213-
else {
214-
this.showEditCategoryOption = false;
215-
this.showDeleteCategoryOption = false;
205+
if (confirm('Are you sure you want to delete this category?')) {
206+
const category_id = this.deleteCategoryForm.value;
207+
this.categoryService.delete(category_id.category_id);
208+
this.toastService.show(`Category deleted succesfully.`, 'success');
209+
this.closeDeleteCategoryModal();
210+
const existingCategories: Category[] = this.categoryService.getAll();
211+
let userId = this.userService.getValue<string>('id') || '0';
212+
if (existingCategories.some(cat => cat.user_id === userId)) {
213+
this.showEditCategoryOption = true;
214+
this.showDeleteCategoryOption = true;
215+
}
216+
else {
217+
this.showEditCategoryOption = false;
218+
this.showDeleteCategoryOption = false;
219+
}
216220
}
217221
}
218222

@@ -537,4 +541,9 @@ export class SettingsComponent {
537541
backupData(): void {
538542
this.postApiService.postUserData(true);
539543
}
544+
545+
openHelpCenter(section: string, event: Event): void {
546+
event.preventDefault();
547+
this.sectionService.setSection(section);
548+
}
540549
}

src/app/service/section/section.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,13 @@ export class SectionService {
3434
setSection(section: string): void {
3535
this.sectionSource.next(section);
3636
}
37+
38+
getFullUrl(): string {
39+
return window.location.href;
40+
}
41+
42+
getPathOnly(): string {
43+
return window.location.pathname;
44+
}
45+
3746
}

0 commit comments

Comments
 (0)