Skip to content

Commit 730dc9c

Browse files
authored
Refactor ApplicationsCenter for clarity and improved naming (#1062)
NethServer/dev#7837
1 parent d4aa94f commit 730dc9c

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

core/ui/src/views/ApplicationsCenter.vue

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,7 @@
202202
:alt="row.name + ' logo'"
203203
class="module-logo"
204204
/>
205-
<span class="app-name">{{
206-
row.module.charAt(0).toUpperCase() + row.module.slice(1)
207-
}}</span>
205+
<span class="app-name">{{ row.module }}</span>
208206
</a>
209207
</cv-data-table-cell>
210208
<cv-data-table-cell>
@@ -744,25 +742,28 @@ export default {
744742
745743
// extract installed modules
746744
const extractedModules = [];
747-
for (const obj of modules) {
748-
const updates = obj.updates;
749-
for (const item of obj.installed) {
745+
for (const moduleData of modules) {
746+
const updates = moduleData.updates;
747+
for (const item of moduleData.installed) {
750748
// look for updates for this item
751749
const updateEntry = updates.find((u) => u.id === item.id);
752750
// if found, merge data from updateEntry into item
753-
const source = updateEntry || item;
751+
const installedData = updateEntry || item;
754752
extractedModules.push({
755-
id: source.id || "",
753+
id: installedData.id || "",
756754
// Use module logo URL if available, else fallback to instance logo later in the template
757-
logo: obj.logo && obj.logo.startsWith("http") ? obj.logo : "",
758-
module: source.module || "",
759-
node: source.node || "",
760-
node_ui_name: source.node_ui_name || "",
761-
ui_name: source.ui_name || "",
762-
ui_note: source.ui_note || "",
763-
version: source.version || "",
764-
update: source.update || "",
765-
appInfoData: obj, // needed for clone/move/info modals
755+
logo:
756+
moduleData.logo && moduleData.logo.startsWith("http")
757+
? moduleData.logo
758+
: "",
759+
module: moduleData.name || "", // we want a humanized module name
760+
node: installedData.node || "",
761+
node_ui_name: installedData.node_ui_name || "",
762+
ui_name: installedData.ui_name || "",
763+
ui_note: installedData.ui_note || "",
764+
version: installedData.version || "",
765+
update: installedData.update || "",
766+
appInfoData: moduleData, // needed for clone/move/info modals
766767
});
767768
}
768769
}

0 commit comments

Comments
 (0)