Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/components/specific/models/models-table/ModelsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,25 @@ export default {
],
setup(props) {
const { t } = useI18n();
const { isLG, isXL } = useStandardBreakpoints();
const { isLG, isXL, isXXL } = useStandardBreakpoints();
const { projectFileStructure } = useFiles();

const modelsTable = ref(null);
const columns = computed(() => {
let filteredColumns = columnsDef;
if (isLG.value) {
filteredColumns = filteredColumns.filter((col) =>
["name", "status", "actions"].includes(col.id)
["name", "status", "actions"].includes(col.id),
);
} else if (isXL.value) {
filteredColumns = filteredColumns.filter((col) =>
["name", "creator", "lastupdate", "status", "actions"].includes(col.id)
["name", "tags", "creator", "lastupdate", "status", "actions"].includes(col.id),
);
} else if (isXXL.value) {
filteredColumns = filteredColumns.filter((col) =>
["name", "tags", "location", "creator", "lastupdate", "status", "actions"].includes(
col.id,
),
);
}
return filteredColumns.map((col) => ({
Expand All @@ -170,7 +176,7 @@ export default {
nameEditMode = reactive({});
props.models.forEach((model) => (nameEditMode[model.id] = false));
},
{ immediate: true }
{ immediate: true },
);

const getFoldersInFolder = (folder) => collectDescendants(folder, isFolder);
Expand All @@ -183,7 +189,7 @@ export default {
} else {
return [];
}
})
}),
);
const allFiles = computed(() =>
projectFileStructure.value.children.flatMap((file) => {
Expand All @@ -192,7 +198,7 @@ export default {
} else {
return file;
}
})
}),
);

const tagsByModelId = computed(() => {
Expand All @@ -216,7 +222,7 @@ export default {
props.models.map((model) => ({
...model,
tags: tagsByModelId.value[model.id] ?? [],
}))
})),
);

return {
Expand Down
22 changes: 11 additions & 11 deletions src/components/specific/models/models-table/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,53 @@ export default [
id: "id",
label: "ID",
width: "100px",
align: "center"
align: "center",
},
{
id: "name",
text: "t.name"
text: "t.name",
},
{
id: "tags",
text: "ModelsTable.headers.tags",
filter: true,
filterKey: "name",
width: "100px",
align: "center"
align: "center",
},
{
id: "location",
text: "ModelsTable.headers.location",
width: "200px",
align: "left"
width: "150px",
align: "left",
},
{
id: "version",
text: "ModelsTable.headers.version",
width: "100px",
align: "center"
align: "center",
},
{
id: "creator",
text: "t.createdBy",
width: "160px",
align: "center"
align: "center",
},
{
id: "lastupdate",
text: "t.modifiedOn",
width: "160px",
align: "center"
align: "center",
},
{
id: "status",
text: "t.status",
width: "120px",
align: "center"
align: "center",
},
{
id: "actions",
label: " ",
width: "200px"
}
width: "200px",
},
];
Loading