Skip to content

Commit

Permalink
Remove code files from resources panel (#5073)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannParis authored Oct 7, 2024
1 parent 019c2fc commit eabc5f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,22 @@
<AccordionTab v-for="[type, assetItems] in assetItemsMap" :key="type">
<template #header>
<div class="flex justify-space-between w-full">
<div class="flex align-items-center w-full">
<template v-if="type === AssetType.Document">Documents</template>
<template v-else-if="type === AssetType.Code">Code Files</template>
<template v-else>{{ capitalize(type) }}s</template>
<header class="flex align-items-center w-full">
{{ capitalize(type) }}s
<aside>({{ assetItems.length }})</aside>
</div>
</header>
<!-- New asset buttons for some types -->
<Button
v-if="type === AssetType.Model || type === AssetType.Workflow"
class="new-button"
v-if="type === AssetType.Model || type === AssetType.Code || type === AssetType.Workflow"
icon="pi pi-plus"
label="New"
text
size="small"
text
@click.stop="emit('open-new-asset', type)"
/>
</div>
</template>

<!-- These are all the resources. They're buttons because they're click and draggable. -->
<Button
v-for="assetItem in assetItems"
Expand All @@ -94,14 +91,13 @@
pageType === AssetType.Workflow &&
(assetItem.pageType === AssetType.Model ||
assetItem.pageType === AssetType.Dataset ||
assetItem.pageType === AssetType.Code ||
assetItem.pageType === AssetType.Document)
"
@dragstart="startDrag({ assetId: assetItem.assetId, pageType: assetItem.pageType })"
@dragend="endDrag"
:class="isEqual(draggedAsset, assetItem) ? 'dragged-asset' : ''"
fallback-class="original-asset"
:force-fallback="true"
force-fallback
>
<tera-asset-icon :asset-type="assetItem.pageType as AssetType" />
<span class="p-button-label">{{ assetItem.assetName }}</span>
Expand Down Expand Up @@ -221,7 +217,7 @@ nav {
gap: var(--gap-4);
}

header {
nav > header {
padding-left: var(--gap-2);
padding-right: var(--gap-2);
display: flex;
Expand Down
10 changes: 7 additions & 3 deletions packages/client/hmi-client/src/types/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ export enum ProjectPages {
*/
export const listOfVisibleAssetTypes: AssetType[] = Object.values(AssetType).filter(
(type) =>
![AssetType.Artifact, AssetType.Simulation, AssetType.ModelConfiguration, AssetType.InterventionPolicy].includes(
type
)
![
AssetType.Artifact,
AssetType.Code,
AssetType.Simulation,
AssetType.ModelConfiguration,
AssetType.InterventionPolicy
].includes(type)
);

/**
Expand Down

0 comments on commit eabc5f0

Please sign in to comment.