Skip to content

Commit

Permalink
Merge remote-tracking branch 'cloudforet-io/master' into feature-coll…
Browse files Browse the repository at this point in the history
…ector-tag-routing

Signed-off-by: sulmo <[email protected]>
  • Loading branch information
sulmoJ committed Oct 7, 2024
2 parents f90495e + ba90601 commit 253fd44
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 43 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/dispatch_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,8 @@ env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

jobs:
mirinae:
runs-on: ubuntu-latest
steps:
- name: Invoke mirinae release workflow
id: mirinae
uses: convictional/[email protected]
with:
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
github_token: ${{ secrets.PAT_TOKEN }}
workflow_file_name: dispatch_mirinae_release.yaml
wait_workflow: true
propagate_failure: true
wait_interval: 5
ref: ${{ github.ref_name }}

storybook:
runs-on: ubuntu-latest
needs: mirinae
steps:
- name: Invoke storybook release workflow
uses: convictional/[email protected]
Expand All @@ -55,7 +38,6 @@ jobs:

versioning_and_docker:
runs-on: ubuntu-latest
needs: mirinae
outputs:
new_commit_sha: ${{ steps.get_sha.outputs.NEW_COMMIT_SHA }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "2.0.0-dev195",
"version": "2.0.0-dev197",
"private": true,
"description": "Cloudforet Console Web Application",
"author": "Cloudforet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ export const getWidgetBasedOnDate = (granularity: string, end?: string): string
const _dateFormat = getDateFormat(granularity);
if (end) {
if (granularity === 'DAILY') {
const now = dayjs.utc();
const endDate = dayjs.utc(end);

if (now.isSame(endDate, 'month')) {
return now.format(_dateFormat);
}
return endDate.endOf('month').format(_dateFormat);
}
return dayjs.utc(end).format(_dateFormat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,24 +246,26 @@ const handleUpdateCount = (value: number) => {
};
};
const handleSelectDynamicFields = (value: MenuItem) => {
const _orderedFixedValue = orderBy(state.proxyValue.dynamicFieldInfo?.fixedValue);
// delete case
if (state.proxyValue.dynamicFieldInfo?.fixedValue.includes(value.name)) {
const _orderedFixedValue = orderBy(state.proxyValue.dynamicFieldInfo?.fixedValue?.filter((d) => d !== value.name)) || [];
state.proxyValue = {
...state.proxyValue,
dynamicFieldInfo: {
...state.proxyValue.dynamicFieldInfo,
fixedValue: [...(_orderedFixedValue ?? []).filter((d) => d !== value.name)],
fixedValue: _orderedFixedValue,
},
};
return;
}
// add case
const _orderedFixedValue = orderBy([...state.proxyValue.dynamicFieldInfo?.fixedValue || [], value.name]);
state.proxyValue = {
...state.proxyValue,
dynamicFieldInfo: {
...state.proxyValue.dynamicFieldInfo,
fixedValue: [
...(_orderedFixedValue ?? []), value.name,
],
fixedValue: _orderedFixedValue,
},
};
};
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/common/modules/widgets/_widgets/table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
defineExpose, reactive, computed, watch, onMounted,
} from 'vue';
import dayjs from 'dayjs';
import { flatMap, map, uniq } from 'lodash';
import { SpaceConnector } from '@cloudforet/core-lib/space-connector';
Expand Down Expand Up @@ -97,7 +98,12 @@ const state = reactive({
if (isDateField(state.tableDataField) || state.groupByField?.some((groupBy) => Object.values(DATE_FIELD).includes(groupBy))) {
if (state.granularity === GRANULARITY.YEARLY) subtract = 3;
if (state.granularity === GRANULARITY.MONTHLY) subtract = 12;
if (state.granularity === GRANULARITY.DAILY) subtract = 30;
if (state.granularity === GRANULARITY.DAILY) {
// if basedOnDate is end of month, need to assign date count of that month
const endOfMonth = dayjs.utc(state.basedOnDate).endOf('month').date();
if (dayjs.utc(state.basedOnDate).date() === endOfMonth) subtract = endOfMonth;
else subtract = 30;
}
}
const [start, end] = getWidgetDateRange(state.granularity, state.basedOnDate, subtract);
return { start, end };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import type { PublicFolderUnshareParameters } from '@/schema/dashboard/public-fo
import { i18n } from '@/translations';
import { useAppContextStore } from '@/store/app-context/app-context-store';
import { useDashboardStore } from '@/store/dashboard/dashboard-store';
import { useAllReferenceStore } from '@/store/reference/all-reference-store';
import type { PublicDashboardReferenceMap } from '@/store/reference/public-dashboard-reference-store';
import type { PublicFolderReferenceItem, PublicFolderReferenceMap } from '@/store/reference/public-folder-reference-store';
import { showErrorMessage, showSuccessMessage } from '@/lib/helper/notice-alert-helper';
Expand Down Expand Up @@ -41,12 +41,13 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<{(e: 'update:visible', visible: boolean): void,
}>();
const appContextStore = useAppContextStore();
const dashboardStore = useDashboardStore();
const dashboardGetters = dashboardStore.getters;
const dashboardMainPageStore = useDashboardMainPageStore();
const dashboardMainPageState = dashboardMainPageStore.state;
const allReferenceStore = useAllReferenceStore();
const storeState = reactive({
isAdminMode: computed(() => appContextStore.getters.isAdminMode),
dashboards: computed<PublicDashboardReferenceMap>(() => allReferenceStore.getters.publicDashboard),
folders: computed<PublicFolderReferenceMap>(() => allReferenceStore.getters.publicFolder),
});
const state = reactive({
Expand All @@ -61,10 +62,10 @@ const state = reactive({
name: _folderName,
type: 'FOLDER',
}];
const _dashboardItems: DashboardDataTableItem[] = Object.entries(storeState.dashboards)
.filter(([, d]) => d.data.folderId === dashboardMainPageState.selectedFolderId)
const _dashboardItems: DashboardDataTableItem[] = Object.entries(dashboardGetters.allDashboardItems)
.filter(([, d]) => d.folder_id === dashboardMainPageState.selectedFolderId)
.map(([, d]) => ({
id: d.key,
id: d.dashboard_id,
name: d.name,
location: _folderName,
type: 'DASHBOARD',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const state = reactive({
return storeState.projectGroup[props.item.parentId].name;
}),
isStarred: computed(() => storeState.favoriteItems.some((item) => item.itemId === props.item.id)),
toolsetMenuItems: [
toolsetMenuItems: computed(() => [
{
type: 'item',
name: 'update',
Expand All @@ -78,7 +78,7 @@ const state = reactive({
label: i18n.t('PROJECT.DETAIL.DELETE'),
icon: 'ic_delete',
},
],
]),
toolsetMenuVisible: false,
});
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/store/dashboard/dashboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export const useDashboardStore = defineStore('dashboard', () => {
}
const res: ListResponse<FolderModel> = await fetcher({
query: {
...folderApiQueryHelper.data,
sort: [{ key: 'created_at', desc: true }],
},
});
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudforet-console",
"version": "2.0.0-dev195",
"version": "2.0.0-dev197",
"private": true,
"workspaces": [
"apps/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/mirinae/src/navigation/tabs/tab/PTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ onClickOutside(hiddenTabsMenuRef, hideHiddenTabs);
<p-text-button v-if="item?.name === CUSTOM_BACK_BUTTON"
style-type="highlight"
>
{{ $t('COMPONENT.CONTEXT_MENU.BACK') }}
{{ $t('COMPONENT.TAB.BACK') }}
</p-text-button>
<template v-else>
{{ item?.label || item?.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const {
targetRef: folderTabRef,
position: 'left',
menuRef: contextMenuRef,
multiSelectable: false,
});
onClickOutside(folderTabRef, () => {
Expand Down

0 comments on commit 253fd44

Please sign in to comment.