Skip to content

Commit b2a8aeb

Browse files
committed
style(ui): improve code formatting and update page templates
- Apply consistent indentation, spacing, and line breaks in multiple components - Enhance readability in analytics, documentation, index, and settings pages - Adjust HTML element formatting for better alignment and visual clarity - Remove unnecessary empty lines and trailing spaces - Maintain existing functionality without behavior changes
1 parent c2e0d5a commit b2a8aeb

33 files changed

+773
-374
lines changed

web/src/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ export const appConfig: ApplicationConfig = {
6969
await firstValueFrom(authService.profile());
7070
}),
7171
],
72-
};
72+
};

web/src/app/components/theme/color-scheme-switcher.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import { ThemeService } from '../../services/theme.service';
1111
changeDetection: ChangeDetectionStrategy.OnPush,
1212
template: `
1313
@if (theme$ | async; as theme) {
14-
<a [ariaLabel]="theme" (click)="switchTheme()" class="p-2 rounded-lg bg-gray-200 hover:bg-gray-300 transition-colors">
14+
<a
15+
[ariaLabel]="theme"
16+
(click)="switchTheme()"
17+
class="p-2 rounded-lg bg-gray-200 hover:bg-gray-300 transition-colors"
18+
>
1519
@switch (theme) {
1620
@case ('light') {
1721
<svg
@@ -113,4 +117,4 @@ export class ColorSchemeSwitcherComponent {
113117
switchTheme(): void {
114118
this.themeService.switchTheme().then();
115119
}
116-
}
120+
}

web/src/app/directives/if-logged.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ export class IfNotLoggedDirective implements OnInit, OnDestroy {
8989
@Input() set ifNotLogged(condition: any) {
9090
// null
9191
}
92-
}
92+
}

web/src/app/formly/button-type.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { LucideAngularModule } from 'lucide-angular';
99
<button
1010
style="width: 100%;"
1111
[type]="props['buttonType'] || 'button'"
12-
[class]="props['class'] || 'flex items-center justify-center text-lg font-bold py-3 px-6 rounded-xl text-white bg-pastel-blue transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#8A89F0] to-[#A2C0F5] tracking-wide'"
12+
[class]="
13+
props['class'] ||
14+
'flex items-center justify-center text-lg font-bold py-3 px-6 rounded-xl text-white bg-pastel-blue transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#8A89F0] to-[#A2C0F5] tracking-wide'
15+
"
1316
(click)="buttonClick()"
1417
>
1518
<span *ngIf="props.label">{{ props.label }}</span>

web/src/app/formly/color-select-type.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ export class ColorSelectTypeComponent
154154
selectOption(option: ColorOption) {
155155
this.selectedValue = option.value;
156156
this.formControl.setValue(option.value);
157-
157+
158158
// Trigger validation
159159
this.formControl.markAsDirty();
160160
this.formControl.updateValueAndValidity();
161-
161+
162162
setTimeout(() => {
163163
this.isOpen$.next(false);
164164

@@ -169,4 +169,4 @@ export class ColorSelectTypeComponent
169169
}
170170
});
171171
}
172-
}
172+
}

web/src/app/formly/flat-input-wrapper.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ export class FlatInputWrapperComponent extends FieldWrapper<FormlyFieldConfig> {
8888
}
8989
return errors;
9090
}
91-
}
91+
}

web/src/app/formly/get-formly-type.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* eslint-disable @typescript-eslint/no-explicit-any */
32
import { FormlyFieldConfig } from '@ngx-formly/core';
43

web/src/app/guards/theme.guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export class StoreThemeInClientGuard implements CanActivate {
1212
this.themeService.type = LocalStorageEnum.client;
1313
return true;
1414
}
15-
}
15+
}

web/src/app/pages/analytics.page.ts

Lines changed: 78 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,86 +14,103 @@ export const routeMeta: RouteMeta = {
1414
imports: [LucideAngularModule],
1515
template: `
1616
<h1 class="text-4xl font-extrabold text-gray-800 mb-2">Analytics (Mock)</h1>
17-
<p class="text-xl text-gray-500 mb-8">Track your dashboard usage and performance</p>
18-
17+
<p class="text-xl text-gray-500 mb-8">
18+
Track your dashboard usage and performance
19+
</p>
20+
1921
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
2022
<!-- Usage Statistics Card -->
2123
<div class="bg-white p-6 rounded-2xl long-shadow">
2224
<div class="flex items-center mb-4">
23-
<i-lucide
24-
name="chart-bar-big"
25-
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg">
25+
<i-lucide
26+
name="chart-bar-big"
27+
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg"
28+
>
2629
</i-lucide>
2730
<h2 class="text-2xl font-bold text-gray-800">Usage Statistics</h2>
2831
</div>
29-
32+
3033
<div class="space-y-4">
31-
<div class="flex justify-between items-center pb-2 border-b border-gray-100">
34+
<div
35+
class="flex justify-between items-center pb-2 border-b border-gray-100"
36+
>
3237
<span class="text-gray-600">Total Dashboards</span>
3338
<span class="text-2xl font-bold text-pastel-blue">12</span>
3439
</div>
35-
36-
<div class="flex justify-between items-center pb-2 border-b border-gray-100">
40+
41+
<div
42+
class="flex justify-between items-center pb-2 border-b border-gray-100"
43+
>
3744
<span class="text-gray-600">Active Devices</span>
3845
<span class="text-2xl font-bold text-pastel-blue">8</span>
3946
</div>
40-
41-
<div class="flex justify-between items-center pb-2 border-b border-gray-100">
47+
48+
<div
49+
class="flex justify-between items-center pb-2 border-b border-gray-100"
50+
>
4251
<span class="text-gray-600">Widgets Deployed</span>
4352
<span class="text-2xl font-bold text-pastel-blue">42</span>
4453
</div>
45-
54+
4655
<div class="flex justify-between items-center">
4756
<span class="text-gray-600">Avg. Updates/Day</span>
4857
<span class="text-2xl font-bold text-pastel-blue">127</span>
4958
</div>
5059
</div>
5160
</div>
52-
61+
5362
<!-- Device Performance Card -->
5463
<div class="bg-white p-6 rounded-2xl long-shadow">
5564
<div class="flex items-center mb-4">
56-
<i-lucide
57-
name="smartphone"
58-
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg">
65+
<i-lucide
66+
name="smartphone"
67+
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg"
68+
>
5969
</i-lucide>
6070
<h2 class="text-2xl font-bold text-gray-800">Device Performance</h2>
6171
</div>
62-
72+
6373
<div class="space-y-4">
64-
<div class="flex justify-between items-center pb-2 border-b border-gray-100">
74+
<div
75+
class="flex justify-between items-center pb-2 border-b border-gray-100"
76+
>
6577
<span class="text-gray-600">Avg. Response Time</span>
6678
<span class="text-2xl font-bold text-pastel-blue">24ms</span>
6779
</div>
68-
69-
<div class="flex justify-between items-center pb-2 border-b border-gray-100">
80+
81+
<div
82+
class="flex justify-between items-center pb-2 border-b border-gray-100"
83+
>
7084
<span class="text-gray-600">Uptime</span>
7185
<span class="text-2xl font-bold text-pastel-blue">99.8%</span>
7286
</div>
73-
74-
<div class="flex justify-between items-center pb-2 border-b border-gray-100">
87+
88+
<div
89+
class="flex justify-between items-center pb-2 border-b border-gray-100"
90+
>
7591
<span class="text-gray-600">Offline Events</span>
7692
<span class="text-2xl font-bold text-pastel-blue">3</span>
7793
</div>
78-
94+
7995
<div class="flex justify-between items-center">
8096
<span class="text-gray-600">Cache Hit Rate</span>
8197
<span class="text-2xl font-bold text-pastel-blue">87%</span>
8298
</div>
8399
</div>
84100
</div>
85101
</div>
86-
102+
87103
<!-- Recent Activity Section -->
88104
<div class="bg-white p-6 rounded-2xl long-shadow mb-8">
89105
<div class="flex items-center mb-4">
90-
<i-lucide
91-
name="activity"
92-
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg">
106+
<i-lucide
107+
name="activity"
108+
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg"
109+
>
93110
</i-lucide>
94111
<h2 class="text-2xl font-bold text-gray-800">Recent Activity</h2>
95112
</div>
96-
113+
97114
<div class="overflow-x-auto">
98115
<table class="w-full">
99116
<thead>
@@ -110,64 +127,82 @@ export const routeMeta: RouteMeta = {
110127
<td class="py-3">Kitchen Display</td>
111128
<td class="py-3">Dashboard Update</td>
112129
<td class="py-3">
113-
<span class="px-2 py-1 rounded-full text-xs bg-green-100 text-green-800">Success</span>
130+
<span
131+
class="px-2 py-1 rounded-full text-xs bg-green-100 text-green-800"
132+
>Success</span
133+
>
114134
</td>
115135
</tr>
116136
<tr class="border-b border-gray-100 hover:bg-gray-50">
117137
<td class="py-3 text-gray-600">5 hours ago</td>
118138
<td class="py-3">Living Room Tablet</td>
119139
<td class="py-3">Widget Added</td>
120140
<td class="py-3">
121-
<span class="px-2 py-1 rounded-full text-xs bg-green-100 text-green-800">Success</span>
141+
<span
142+
class="px-2 py-1 rounded-full text-xs bg-green-100 text-green-800"
143+
>Success</span
144+
>
122145
</td>
123146
</tr>
124147
<tr class="border-b border-gray-100 hover:bg-gray-50">
125148
<td class="py-3 text-gray-600">1 day ago</td>
126149
<td class="py-3">Bedroom Phone</td>
127150
<td class="py-3">Settings Changed</td>
128151
<td class="py-3">
129-
<span class="px-2 py-1 rounded-full text-xs bg-yellow-100 text-yellow-800">Warning</span>
152+
<span
153+
class="px-2 py-1 rounded-full text-xs bg-yellow-100 text-yellow-800"
154+
>Warning</span
155+
>
130156
</td>
131157
</tr>
132158
<tr class="border-b border-gray-100 hover:bg-gray-50">
133159
<td class="py-3 text-gray-600">2 days ago</td>
134160
<td class="py-3">Office Display</td>
135161
<td class="py-3">Connection Lost</td>
136162
<td class="py-3">
137-
<span class="px-2 py-1 rounded-full text-xs bg-red-100 text-red-800">Error</span>
163+
<span
164+
class="px-2 py-1 rounded-full text-xs bg-red-100 text-red-800"
165+
>Error</span
166+
>
138167
</td>
139168
</tr>
140169
</tbody>
141170
</table>
142171
</div>
143172
</div>
144-
173+
145174
<!-- Data Export Section -->
146175
<div class="bg-white p-6 rounded-2xl long-shadow">
147176
<div class="flex items-center mb-4">
148-
<i-lucide
149-
name="download"
150-
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg">
177+
<i-lucide
178+
name="download"
179+
class="w-10 h-10 text-pastel-blue bg-pastel-blue/10 rounded-lg"
180+
>
151181
</i-lucide>
152182
<h2 class="text-2xl font-bold text-gray-800">Data Export</h2>
153183
</div>
154-
184+
155185
<p class="text-gray-600 mb-4">
156186
Export your analytics data for further analysis or reporting.
157187
</p>
158-
188+
159189
<div class="flex flex-wrap gap-4">
160-
<button class="flex items-center text-lg font-bold py-3 px-6 rounded-xl text-white transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#8A89F0] to-[#A2C0F5] tracking-wide">
190+
<button
191+
class="flex items-center text-lg font-bold py-3 px-6 rounded-xl text-white transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#8A89F0] to-[#A2C0F5] tracking-wide"
192+
>
161193
<i-lucide name="file-text" class="w-5 h-5 mr-2"></i-lucide>
162194
Export as CSV
163195
</button>
164-
<button class="flex items-center text-lg font-bold py-3 px-6 rounded-xl text-white bg-gray-500 transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#AAB1BF] to-[#8B92A0] tracking-wide">
196+
<button
197+
class="flex items-center text-lg font-bold py-3 px-6 rounded-xl text-white bg-gray-500 transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#AAB1BF] to-[#8B92A0] tracking-wide"
198+
>
165199
<i-lucide name="chart-bar-big" class="w-5 h-5 mr-2"></i-lucide>
166200
Export as JSON
167201
</button>
168-
<a
202+
<a
169203
href="/analytics/delete"
170-
class="flex items-center text-lg font-bold py-3 px-6 rounded-xl text-white transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#FF988A] to-[#FFD5A2] text-gray-800">
204+
class="flex items-center text-lg font-bold py-3 px-6 rounded-xl text-white transition-all duration-300 transform hover:scale-[1.02] flat-btn-shadow bg-gradient-to-tr from-[#FF988A] to-[#FFD5A2] text-gray-800"
205+
>
171206
<i-lucide name="trash-2" class="w-5 h-5 mr-2"></i-lucide>
172207
Delete Data
173208
</a>
@@ -179,4 +214,4 @@ export default class AnalyticsPageComponent {
179214
showError() {
180215
alert('Feature coming soon!');
181216
}
182-
}
217+
}

web/src/app/pages/analytics/delete.page.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@ export const routeMeta: RouteMeta = {
2323
class="text-gray-500 hover:text-pastel-blue transition-colors mb-10 mt-2 flex items-center"
2424
>
2525
<i-lucide name="arrow-left" class="w-6 h-6 mr-0 lg:mr-2"></i-lucide>
26-
<span class="mobile-hidden lg:inline text-lg font-medium">Back to Analytics</span>
26+
<span class="mobile-hidden lg:inline text-lg font-medium"
27+
>Back to Analytics</span
28+
>
2729
</a>
2830
Permanently remove analytics data.
2931
</p>
3032
3133
<!-- Analytics Data Deletion Panel -->
3234
<div class="bg-white p-6 rounded-2xl long-shadow mb-8 space-y-4">
33-
<form
34-
[formGroup]="form"
35-
(ngSubmit)="onSubmit()"
36-
class="w-full"
37-
>
35+
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="w-full">
3836
<div class="mb-6">
3937
<p class="text-lg text-gray-700 mb-2">
4038
Are you sure you want to delete all analytics data?
4139
</p>
4240
<p class="text-gray-500">
43-
This action cannot be undone. All collected analytics data will be permanently removed.
41+
This action cannot be undone. All collected analytics data will be
42+
permanently removed.
4443
</p>
4544
</div>
4645
@@ -74,4 +73,4 @@ export default class AnalyticsDeletePageComponent {
7473
alert('Analytics data deleted successfully!');
7574
// In a real application, this would call a service to delete the data
7675
}
77-
}
76+
}

0 commit comments

Comments
 (0)