Skip to content

Commit e543b8e

Browse files
Format frontend files with nx format
1 parent 89f43e8 commit e543b8e

File tree

4 files changed

+43
-32
lines changed

4 files changed

+43
-32
lines changed

client/modules/dashboard/src/Dashboard/Dashboard.module.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
flex-grow: 1;
168168
}
169169

170-
171170
/* Dashboard.module.css */
172171

173172
.favoriteToggle {
@@ -219,4 +218,3 @@
219218
transform: scale(1.2);
220219
color: darkorange;
221220
}
222-

client/modules/dashboard/src/Dashboard/FavoriteTools.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,19 @@ const FavoriteTools = () => {
3434

3535
const { data, isLoading, isError } = useAppsListing();
3636

37-
const allApps: AppData[] = data?.categories?.flatMap((cat) =>
38-
cat.apps.map((app) => ({
39-
app_id: app.app_id,
40-
version: app.version || '',
41-
definition: {
42-
id: app.app_id,
43-
notes: {
44-
label: app.label,
37+
const allApps: AppData[] =
38+
data?.categories?.flatMap((cat) =>
39+
cat.apps.map((app) => ({
40+
app_id: app.app_id,
41+
version: app.version || '',
42+
definition: {
43+
id: app.app_id,
44+
notes: {
45+
label: app.label,
46+
},
4547
},
46-
},
47-
}))
48-
) ?? [];
48+
}))
49+
) ?? [];
4950

5051
const resolvedFavorites = favorites
5152
.map((fav) => {
@@ -89,9 +90,7 @@ const FavoriteTools = () => {
8990
const handleRemove = async (toolId: string) => {
9091
try {
9192
await removeFavorite(toolId);
92-
setFavorites((prev) =>
93-
prev.filter((tool) => tool.tool_id !== toolId)
94-
);
93+
setFavorites((prev) => prev.filter((tool) => tool.tool_id !== toolId));
9594
} catch (err) {
9695
console.error('Failed to remove favorite:', err);
9796
}

client/modules/dashboard/src/Dashboard/QuickLinksNavbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ const Quicklinks = () => {
2222
</div>
2323
);
2424
};
25-
export default Quicklinks;
25+
export default Quicklinks;

client/modules/workspace/src/AppsSideNav/AppsSideNav.tsx

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ import {
99
removeFavorite,
1010
} from '../../../dashboard/src/api/favouritesApi';
1111

12-
export const AppsSideNav: React.FC<{ categories: TAppCategory[] }> = ({ categories }) => {
12+
export const AppsSideNav: React.FC<{ categories: TAppCategory[] }> = ({
13+
categories,
14+
}) => {
1315
const [favoriteToolIds, setFavoriteToolIds] = useState<string[]>([]);
1416
const [loadingFavorites, setLoadingFavorites] = useState(true);
15-
const [updatingToolIds, setUpdatingToolIds] = useState<Set<string>>(new Set());
17+
const [updatingToolIds, setUpdatingToolIds] = useState<Set<string>>(
18+
new Set()
19+
);
1620

1721
useEffect(() => {
1822
const fetchFavorites = async () => {
1923
try {
2024
const favs = await getUserFavorites();
21-
const toolIds = (favs || []).map((fav: { tool_id: string; version?: string }) =>
22-
fav.tool_id + (fav.version || '')
25+
const toolIds = (favs || []).map(
26+
(fav: { tool_id: string; version?: string }) =>
27+
fav.tool_id + (fav.version || '')
2328
);
2429
setFavoriteToolIds(toolIds);
2530
} catch (err) {
@@ -81,7 +86,9 @@ export const AppsSideNav: React.FC<{ categories: TAppCategory[] }> = ({ categori
8186

8287
category.apps.forEach((app) => {
8388
const toolId = app.app_id + (app.version || '');
84-
const linkPath = `${app.app_id}${app.version ? `?appVersion=${app.version}` : ''}`;
89+
const linkPath = `${app.app_id}${
90+
app.version ? `?appVersion=${app.version}` : ''
91+
}`;
8592
const linkLabel = app.shortLabel || app.label || app.bundle_label;
8693
const isFavorite = favoriteToolIds.includes(toolId);
8794

@@ -135,16 +142,20 @@ export const AppsSideNav: React.FC<{ categories: TAppCategory[] }> = ({ categori
135142
}
136143
});
137144

138-
const bundleItems = Object.entries(bundles).map(([bundleKey, bundle], index) =>
139-
getItem(
140-
`${bundle.label} [${bundle.apps.length}]`,
141-
bundleKey,
142-
index,
143-
bundle.apps.sort((a, b) => a.priority - b.priority)
144-
)
145+
const bundleItems = Object.entries(bundles).map(
146+
([bundleKey, bundle], index) =>
147+
getItem(
148+
`${bundle.label} [${bundle.apps.length}]`,
149+
bundleKey,
150+
index,
151+
bundle.apps.sort((a, b) => a.priority - b.priority)
152+
)
145153
);
146154

147-
return [...categoryItems.sort((a, b) => a.priority - b.priority), ...bundleItems];
155+
return [
156+
...categoryItems.sort((a, b) => a.priority - b.priority),
157+
...bundleItems,
158+
];
148159
};
149160

150161
const items: MenuItem[] = categories
@@ -172,9 +183,12 @@ export const AppsSideNav: React.FC<{ categories: TAppCategory[] }> = ({ categori
172183
? `${currentApp.bundle_label}${currentApp.bundle_id}`
173184
: '';
174185

175-
const selectedKey = `${appId}${appVersion || ''}${currentApp?.bundle_id ?? ''}`;
186+
const selectedKey = `${appId}${appVersion || ''}${
187+
currentApp?.bundle_id ?? ''
188+
}`;
176189

177-
if (loadingFavorites) return <div style={{ padding: 16 }}>Loading tools...</div>;
190+
if (loadingFavorites)
191+
return <div style={{ padding: 16 }}>Loading tools...</div>;
178192

179193
return (
180194
<>

0 commit comments

Comments
 (0)