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: popover target slot width changes according to lsb width change in metricLSB, verification message when adding a user #5226

Closed
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
8 changes: 4 additions & 4 deletions apps/web/src/common/modules/monitoring/Monitoring.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@

<script lang="ts">
import {
computed, getCurrentInstance, reactive, toRefs, watch,
computed, reactive, toRefs, watch,
} from 'vue';
import type { Vue } from 'vue/types/vue';
import { useRouter } from 'vue-router/composables';

import dayjs from 'dayjs';
import {
Expand Down Expand Up @@ -180,7 +180,7 @@ export default {
},
},
setup(props) {
const vm = getCurrentInstance()?.proxy as Vue;
const router = useRouter();
const userStore = useUserStore();
const state = reactive({
showLoader: computed(() => props.loading || state.metricsLoading),
Expand Down Expand Up @@ -213,7 +213,7 @@ export default {
resources = resources.map((resource, idx) => ({
...resource,
color: COLORS[idx],
link: vm.$router.resolve(referenceRouter(resource.id, { resource_type: 'inventory.Server' })).href,
link: router.resolve(referenceRouter(resource.id, { resource_type: 'inventory.Server' })).href,
}));
state.availableResources = sortBy(resources, (m) => m.name);
};
Expand Down
24 changes: 20 additions & 4 deletions apps/web/src/common/modules/page-layouts/VerticalPageLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ import { useWindowSize } from '@vueuse/core/index';
import {
computed, reactive, ref, watch,
} from 'vue';
import { useRoute } from 'vue-router/composables';

import { clone } from 'lodash';

import { PVerticalLayout } from '@cloudforet/mirinae';

import { useGlobalUIStore } from '@/store/global-ui/global-ui-store';

import { MENU_ID } from '@/lib/menu/config';

import FNB from '@/common/modules/navigations/FNB.vue';
import { useGnbStore } from '@/common/modules/navigations/stores/gnb-store';
import type { Breadcrumb } from '@/common/modules/page-layouts/type';
Expand All @@ -35,12 +40,20 @@ const { width: contentsWidth } = useElementSize(contentRef);
const storeState = reactive({
isMinimizeNavRail: computed(() => gnbGetters.isMinimizeNavRail),
});

const route = useRoute();

const state = reactive({
padding: computed(() => {
if (contentsWidth.value <= 1920) return '0';
if (storeState.isMinimizeNavRail) return width.value - 1980;
return width.value - 2180;
}),
menuId: computed<string>(() => {
const reversedMatched = clone(route.matched).reverse();
const closestRoute = reversedMatched.find((d) => d.meta?.menuId !== undefined);
return closestRoute?.meta?.menuId;
}),
});

watch(() => props.breadcrumbs, () => {
Expand All @@ -52,10 +65,13 @@ watch(() => props.breadcrumbs, () => {
</script>

<template>
<p-vertical-layout v-bind="$props"
ref="contentRef"
class="vertical-page-layout"
v-on="$listeners"
<p-vertical-layout
v-bind="$props"
ref="contentRef"
class="vertical-page-layout"
:width="width"
:enable-double-click-resize="state.menuId === MENU_ID.METRIC_EXPLORER"
v-on="$listeners"
>
<template #sidebar="prop">
<slot name="sidebar"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import {
computed, getCurrentInstance, reactive, watch,
computed, reactive, watch,
} from 'vue';
import type { Vue } from 'vue/types/vue';
import { useRouter } from 'vue-router/composables';


import { makeReferenceValueHandler } from '@cloudforet/core-lib/component-util/query-search';
Expand All @@ -29,7 +29,8 @@ import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
const props = defineProps<{
activatedProjects: string[];
}>();
const vm = getCurrentInstance()?.proxy as Vue;
const router = useRouter();

const allReferenceStore = useAllReferenceStore();
const userWorkspaceStore = useUserWorkspaceStore();
const storeState = reactive({
Expand Down Expand Up @@ -98,7 +99,7 @@ const onChange = async (options?: any) => {
await listAlertByProject();
};
const onClickProjectBox = (item) => {
vm.$router.push({ name: PROJECT_ROUTE.DETAIL.TAB.ALERT._NAME, params: { id: item.project_id } });
router.push({ name: PROJECT_ROUTE.DETAIL.TAB.ALERT._NAME, params: { id: item.project_id } });
};

/* init */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import {
computed, getCurrentInstance, reactive, watch,
computed, reactive, watch,
} from 'vue';
import type { Vue } from 'vue/types/vue';
import { useRouter } from 'vue-router/composables';

import dayjs from 'dayjs';
import { find } from 'lodash';
Expand Down Expand Up @@ -55,7 +55,7 @@ interface Activity {
status?: string;
}

const vm = getCurrentInstance()?.proxy as Vue;
const router = useRouter();

const userWorkspaceStore = useUserWorkspaceStore();
const storeState = reactive({
Expand Down Expand Up @@ -155,7 +155,7 @@ const onClickBox = (projectId, date) => {
{ k: 'project_id', v: projectId, o: '=' },
{ k: 'created_at', v: date.split(' ')[0], o: '=t' },
]);
vm.$router.replace({
router.replace({
name: ALERT_MANAGER_ROUTE.ALERT._NAME,
query: {
filters: urlQueryHelper.rawQueryStrings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const handleDeleteNote = async () => {
<span class="date">{{ iso8601Formatter(state.noteList[index].created_at, state.timezone) }}</span>
</p>
<p-select-dropdown style-type="icon-button"
button-icon="ic_chevron-down"
button-icon="ic_ellipsis-horizontal"
:menu="state.menuItems"
menu-position="right"
use-fixed-menu-style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ onUnmounted(() => {
<template>
<fragment>
<vertical-page-layout v-if="state.lsbVisible">
<template #sidebar>
<asset-inventory-l-s-b />
<template #sidebar="prop">
<asset-inventory-l-s-b :width="prop.width" />
</template>
<template #default>
<router-view />
Expand Down
12 changes: 11 additions & 1 deletion apps/web/src/services/asset-inventory/AssetInventoryLSB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import CloudServiceLSB from '@/services/asset-inventory/components/CloudServiceL
import MetricExplorerLSB from '@/services/asset-inventory/components/MetricExplorerLSB.vue';
import SecurityLSB from '@/services/asset-inventory/components/SecurityLSB.vue';


interface props {
width: number;
}

const props = defineProps<props>();

const route = useRoute();

const state = reactive({
Expand All @@ -19,12 +26,15 @@ const state = reactive({
return closestRoute?.meta?.menuId;
}),
});

</script>

<template>
<fragment>
<cloud-service-l-s-b v-if="state.menuId === MENU_ID.CLOUD_SERVICE" />
<metric-explorer-l-s-b v-else-if="state.menuId === MENU_ID.METRIC_EXPLORER" />
<metric-explorer-l-s-b v-else-if="state.menuId === MENU_ID.METRIC_EXPLORER"
:width="width"
/>
<security-l-s-b v-else-if="state.menuId === MENU_ID.SECURITY" />
</fragment>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
<script lang="ts">
import { useInfiniteScroll } from '@vueuse/core';
import {
computed, getCurrentInstance, onMounted, reactive, toRefs, watch,
computed, onMounted, reactive, toRefs, watch,
} from 'vue';
import type { Vue } from 'vue/types/vue';
import { useRoute } from 'vue-router/composables';

import type { Dayjs } from 'dayjs';
import dayjs from 'dayjs';
Expand Down Expand Up @@ -190,7 +190,7 @@ export default {
},
},
setup(props) {
const vm = getCurrentInstance()?.proxy as Vue;
const route = useRoute();
const userStore = useUserStore();
const state = reactive({
loading: true,
Expand All @@ -202,7 +202,7 @@ export default {
noteItemMap: {} as { [key: string]: NoteModel[] },
selectedHistoryItem: undefined as undefined | CloudServiceHistoryItem,
selectedKeyName: undefined as undefined | string,
showDetailOverlay: computed(() => vm.$route.hash === `#${HISTORY_OVERLAY_HASH_NAME}`),
showDetailOverlay: computed(() => route.hash === `#${HISTORY_OVERLAY_HASH_NAME}`),
totalCount: 0,
pageStart: 1,
searchText: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ import { useAssetInventorySettingsStore } from '@/services/asset-inventory/store
import { useMetricExplorerPageStore } from '@/services/asset-inventory/stores/metric-explorer-page-store';
import type { NamespaceSubItemType } from '@/services/asset-inventory/types/asset-analysis-type';

interface props {
width : number
}
const props = defineProps<props>();

const lsbRef = ref<HTMLElement|null>(null);
const { width: lsbWidth } = useElementSize(lsbRef);

Expand Down Expand Up @@ -295,16 +300,18 @@ watch(() => storeState.selectedNamespace, (selectedNamespace) => {
<template>
<div class="metric-explorer-l-s-b">
<p-popover class="metric-select-guide-popover"
:is-visible="guidePopoverState.metricGuideVisible"
:is-visible.sync="guidePopoverState.metricGuideVisible"
position="right"
ignore-outside-click
ignore-target-click
boundary=".metric-explorer-l-s-b"
:trigger="POPOVER_TRIGGER.NONE"
min-width="21.5rem"
:style="{ left: `${lsbWidth}px`}"
>
<l-s-b ref="lsbRef"
:menu-set="state.menuSet"
:style="{ width: `${props.width}px` }"
>
<template #collapsible-contents-starred>
<div v-if="state.starredMenuSet.length > 0">
Expand Down Expand Up @@ -418,6 +425,7 @@ watch(() => storeState.selectedNamespace, (selectedNamespace) => {
/>
</template>
</l-s-b>

<template #content>
<div class="metric-select-guide-content">
<p class="title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,29 @@

<script lang="ts">
import {
defineComponent, getCurrentInstance, reactive, toRefs,
defineComponent, reactive, toRefs,
} from 'vue';
import type { Vue } from 'vue/types/vue';
import { useRouter } from 'vue-router/composables';

import { PButton } from '@cloudforet/mirinae';

import { AUTH_ROUTE } from '@/services/auth/routes/route-constant';



export default defineComponent({
name: 'KEYCLOAKODIC',
components: {
PButton,
},
setup() {
const vm = getCurrentInstance()?.proxy as Vue;
const router = useRouter();
const state = reactive({
keycloakVisible: false,
});

const openKeycloakSignIn = () => {
vm.$router.push({ name: AUTH_ROUTE.SIGN_IN.KEYCLOAK._NAME });
router.push({ name: AUTH_ROUTE.SIGN_IN.KEYCLOAK._NAME });
};
return {
openKeycloakSignIn,
Expand Down
10 changes: 6 additions & 4 deletions apps/web/src/services/auth/components/SignInRightContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<script lang="ts">
import { useWindowSize } from '@vueuse/core/index';
import {
computed, getCurrentInstance, reactive, toRefs,
computed, reactive, toRefs,
} from 'vue';
import type { Vue } from 'vue/types/vue';
import { useRoute, useRouter } from 'vue-router/composables';

import {
PI, screens,
Expand All @@ -58,7 +58,9 @@ export default {
},
},
setup() {
const vm = getCurrentInstance()?.proxy as Vue;
const router = useRouter();
const route = useRoute();

const domainStore = useDomainStore();
const displayStore = useDisplayStore();
const { width } = useWindowSize();
Expand All @@ -69,7 +71,7 @@ export default {

/* event */
const hideErrorMessage = () => {
if (vm.$route.query.error) vm.$router.replace({ query: { error: null } });
if (route.query.error) router.replace({ query: { error: null } });
displayStore.setIsSignInFailed(false);
};

Expand Down
7 changes: 2 additions & 5 deletions apps/web/src/services/auth/pages/PasswordPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@
<script setup lang="ts">
import type { ComponentPublicInstance, ComputedRef } from 'vue';
import {
computed,
getCurrentInstance, onMounted, reactive, ref,
computed, onMounted, reactive, ref,
} from 'vue';
import { useRoute, useRouter } from 'vue-router/composables';
import type { Vue } from 'vue/types/vue';

import dayjs from 'dayjs';
import type { JwtPayload } from 'jwt-decode';
Expand Down Expand Up @@ -135,7 +133,6 @@ const props = withDefaults(defineProps<Props>(), {

const passwordFormEl = ref<ComponentPublicInstance<PasswordFormExpose>>();

const vm = getCurrentInstance()?.proxy as Vue;
const router = useRouter();
const route = useRoute();

Expand Down Expand Up @@ -195,7 +192,7 @@ const handleClickButton = () => {
resetInputs();
};
const getSSOTokenFromUrl = (): string|undefined => {
const query = vm.$router.currentRoute.query;
const query = router.currentRoute.query;
return query.sso_access_token as string;
};
const getUserIdFromToken = (ssoAccessToken: string): string | undefined => {
Expand Down
Loading
Loading