Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix code asset call in code node and globalize small dropdown rule #2379

Merged
merged 1 commit into from
Dec 6, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
}
}

.sm {
height: 2rem;
.p-dropdown-sm {
.p-dropdown-label {
padding: 0.5rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
editable
placeholder="Add people and groups"
@update:model-value="(value) => addNewSelectedUser(value.id)"
class="w-full sm"
class="w-full p-dropdown-sm"
/>
<section class="selected-users" v-if="selectedUsers.size > 0">
<h6>People and groups with access</h6>
Expand All @@ -32,7 +32,7 @@
</section>
<section>
<h6>General access</h6>
<Dropdown v-model="generalAccess" :options="generalAccessOptions" class="sm">
<Dropdown v-model="generalAccess" :options="generalAccessOptions" class="p-dropdown-sm">
<template #value="slotProps">
<div class="general-access-option">
<i :class="slotProps.value.icon" />
Expand Down Expand Up @@ -228,7 +228,7 @@ li {
font-size: var(--font-tiny);
}

.p-dropdown.sm {
.p-dropdown {
margin-bottom: 0.5rem;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Dropdown
v-model="selectedPermission"
:options="permissions"
class="sm"
class="p-dropdown-sm"
@change="selectPermission"
/>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<template v-if="code">{{ code?.name }}</template>
<template v-else>
<Dropdown
class="w-full"
class="w-full p-dropdown-sm"
:options="codeAssets"
option-label="name"
v-model="code"
Expand All @@ -17,6 +17,7 @@
<script setup lang="ts">
import _ from 'lodash';
import { WorkflowNode } from '@/types/workflow';
import { getCodeAsset } from '@/services/code';
import { onMounted, ref, computed, watch } from 'vue';
import { Code } from '@/types/Types';
import { useProjects } from '@/composables/project';
Expand All @@ -35,7 +36,7 @@ const codeAssets = computed<Code[]>(() => useProjects().activeProject.value?.ass

onMounted(async () => {
if (props.node.state.codeAssetId) {
code.value = codeAssets.value.find(({ id }) => id === props.node.state.codeAssetId) ?? null;
code.value = await getCodeAsset(props.node.state.codeAssetId);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</template>
<template v-else>
<Dropdown
class="w-full p-button-sm p-button-outlined"
class="w-full p-dropdown-sm"
:options="datasets"
option-label="name"
v-model="dataset"
Expand Down Expand Up @@ -180,19 +180,4 @@ section {
.p-button:deep(span) {
margin-top: 0.25rem;
}

/* TODO: These are wrongly named and should be a general rule for small dropdowns in the SASS themes */
.p-button-sm.p-button-outlined {
border: 1px solid var(--surface-border);
padding-top: 0rem;
padding-bottom: 0rem;
}

.p-button-sm.p-button-outlined:deep(.p-dropdown-label) {
padding: 0.5rem;
}

.p-button-sm.p-button-outlined:hover {
border: 1px solid var(--surface-border-hover);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</template>
<template v-else>
<Dropdown
class="w-full p-button-sm p-button-outlined"
class="w-full p-dropdown-sm"
v-model="selectedModel"
:options="models"
option-label="header.name"
Expand Down Expand Up @@ -111,17 +111,4 @@ main {
border-radius: var(--border-radius);
overflow: hidden;
}

/* TODO: These are wrongly named and should be a general rule for small dropdowns in the SASS themes */
.p-button-sm.p-button-outlined {
border: 1px solid var(--surface-border);
}

.p-button-sm.p-button-outlined:hover {
border: 1px solid var(--surface-border-hover);
}

.p-button-sm.p-button-outlined:deep(.p-dropdown-label) {
padding: 0.5rem;
}
</style>