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(dashboard-qa): solve some QAs #4608

Merged
merged 2 commits into from
Aug 29, 2024
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 @@ -397,7 +397,7 @@ const getFieldWidth = (field: TableWidgetField): string|undefined => {
minWidth: getFieldMinWidth(field),
width: getFieldWidth(field),
maxWidth: getFieldWidth(field),
...(rowIndex !== props.items?.length - 1 ? getHeatmapColorStyle(item, field) : {}),
...(rowIndex !== props.items?.length - 1 || !props.totalInfo?.toggleValue ? getHeatmapColorStyle(item, field) : {}),
}"
>
<span ref="labelRef"
Expand Down Expand Up @@ -494,8 +494,8 @@ const getFieldWidth = (field: TableWidgetField): string|undefined => {
tbody {
tr {
&:nth-child(odd) {
@apply bg-gray-100;
td {
@apply bg-gray-100;
&.sub-total {
@apply bg-violet-150;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
import { computed, onMounted, reactive } from 'vue';

import { flatMapDeep, uniq } from 'lodash';

import { PEmpty, PFieldTitle, PSearch } from '@cloudforet/mirinae';
import type { BoardSet } from '@cloudforet/mirinae/types/data-display/board/type';

Expand Down Expand Up @@ -48,6 +50,15 @@ const state = reactive({
labels: d.labels,
}));
}),
allExistingLabels: computed(() => {
const OOTBTemplates = getFilteredTemplates(dashboardCreatePageState.dashboardTemplates, '', [], []);
const dashboards: DashboardModel[] = storeState.isWorkspaceMember ? dashboardGetters.privateItems : dashboardGetters.allItems;
const existingTemplates = getFilteredTemplates(dashboards, '', [], []);
return uniq([
...flatMapDeep(OOTBTemplates.map((d) => d.labels)),
...flatMapDeep(existingTemplates.map((d) => d.labels)),
]);
}),
});

const filterState = reactive({
Expand Down Expand Up @@ -90,7 +101,8 @@ onMounted(() => {
<div class="dashboard-create-step-1">
<p-search :value.sync="filterState.inputValue" />
<div class="contents-container">
<dashboard-create-step1-search-filter @select-label="handleSelectLabels"
<dashboard-create-step1-search-filter :labels="state.allExistingLabels"
@select-label="handleSelectLabels"
@select-provider="handleSelectProvider"
/>
<div class="template-contents-area">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
import { computed, reactive } from 'vue';

import { uniq } from 'lodash';

import {
PFieldTitle, PCheckboxGroup, PCheckbox, PLazyImg, PSelectDropdown,
} from '@cloudforet/mirinae';
Expand All @@ -17,7 +19,11 @@ export interface FilterLabelItem {
name: string;
image?: string;
}
interface Props {
labels: string[];
}

const props = defineProps<Props>();
const emit = defineEmits<{(e:'select-label', labels: FilterLabelItem[]):void;
(e:'select-provider', plugins: FilterLabelItem[]):void;
(e:'select-plugin', plugins: PluginItem[]):void;
Expand All @@ -34,7 +40,7 @@ const state = reactive({
image: provider.icon,
}))),
labels: computed(() => Object.values(DASHBOARD_LABELS)),
labelList: computed(() => state.labels.map((label) => ({
labelList: computed(() => uniq([...state.labels, ...props.labels]).map((label) => ({
label,
name: label,
image: null,
Expand Down
Loading