diff --git a/apps/web/src/schema/identity/user-group/model.ts b/apps/web/src/schema/identity/user-group/model.ts index 492937ca24..bd5c7be2e5 100644 --- a/apps/web/src/schema/identity/user-group/model.ts +++ b/apps/web/src/schema/identity/user-group/model.ts @@ -1,18 +1,15 @@ -import type { AuthType } from '@/schema/identity/user/type'; +import type { Tags } from '@/schema/_common/model'; +import type { UserModel } from '@/schema/identity/user/model'; export interface UserGroupModel { user_group_id: string; - description: string; - notification: number; - users: number; - created: string; -} - -export interface UserPerUserGroupModel { - user_id: string; name: string; - auth_type: AuthType; - last_activity: string; + description?: string; + users: UserModel[]; + tags: Tags; + workspace_id: string; + domain_id: string; + created_at: string; } export interface NotificationChannelPerUserGroupModel { diff --git a/apps/web/src/schema/identity/user-group/type.ts b/apps/web/src/schema/identity/user-group/type.ts index d0cded4d22..f50a2ead6e 100644 --- a/apps/web/src/schema/identity/user-group/type.ts +++ b/apps/web/src/schema/identity/user-group/type.ts @@ -1,11 +1,8 @@ import type { NotificationChannelPerUserGroupModel, UserGroupModel, - UserPerUserGroupModel, } from '@/schema/identity/user-group/model'; export type UserGroupListItemType = Partial; -export type UserListPerUserGroupItemType = Partial; - export type NotificationChannelListPerUserGroupItemType = Partial; diff --git a/apps/web/src/services/iam/components/UserGroupManagementAddGroupInfo.vue b/apps/web/src/services/iam/components/UserGroupManagementAddGroupInfo.vue index c9dc5fa9e1..d3d78dee0b 100644 --- a/apps/web/src/services/iam/components/UserGroupManagementAddGroupInfo.vue +++ b/apps/web/src/services/iam/components/UserGroupManagementAddGroupInfo.vue @@ -11,7 +11,9 @@ import { PFieldGroup, PTextInput } from '@cloudforet/mirinae'; - + diff --git a/apps/web/src/services/iam/components/UserGroupManagementAddNotificationChannelInfo.vue b/apps/web/src/services/iam/components/UserGroupManagementAddNotificationChannelInfo.vue deleted file mode 100644 index 06be6478a5..0000000000 --- a/apps/web/src/services/iam/components/UserGroupManagementAddNotificationChannelInfo.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/apps/web/src/services/iam/components/UserGroupManagementAddUsersModal.vue b/apps/web/src/services/iam/components/UserGroupManagementAddUsersModal.vue new file mode 100644 index 0000000000..9134770b3c --- /dev/null +++ b/apps/web/src/services/iam/components/UserGroupManagementAddUsersModal.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/apps/web/src/services/iam/components/UserGroupManagementEditModal.vue b/apps/web/src/services/iam/components/UserGroupManagementEditModal.vue index b875e26237..7e5f88b068 100644 --- a/apps/web/src/services/iam/components/UserGroupManagementEditModal.vue +++ b/apps/web/src/services/iam/components/UserGroupManagementEditModal.vue @@ -1,11 +1,11 @@ diff --git a/apps/web/src/services/iam/components/UserGroupManagementHeader.vue b/apps/web/src/services/iam/components/UserGroupManagementHeader.vue index 98c7b7a2d2..da2e581e0b 100644 --- a/apps/web/src/services/iam/components/UserGroupManagementHeader.vue +++ b/apps/web/src/services/iam/components/UserGroupManagementHeader.vue @@ -3,16 +3,16 @@ import { PHeading, PButton, PHeadingLayout } from '@cloudforet/mirinae'; import { i18n } from '@/translations'; +import { USER_GROUP_MODAL_TYPE } from '@/services/iam/constants/user-group-constant'; import { useUserGroupPageStore } from '@/services/iam/store/user-group-page-store'; const userGroupPageStore = useUserGroupPageStore(); const handleCreateGroup = () => { userGroupPageStore.updateModalSettings({ - type: 'create', + type: USER_GROUP_MODAL_TYPE.CREATE, title: i18n.t('IAM.USER_GROUP.MODAL.CREATE_USER_GROUP.TITLE'), themeColor: 'primary', - visible: 'create', }); }; diff --git a/apps/web/src/services/iam/components/UserGroupManagementScheduleSetting.vue b/apps/web/src/services/iam/components/UserGroupManagementScheduleSetting.vue new file mode 100644 index 0000000000..a0134645b3 --- /dev/null +++ b/apps/web/src/services/iam/components/UserGroupManagementScheduleSetting.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/apps/web/src/services/iam/components/UserGroupManagementTable.vue b/apps/web/src/services/iam/components/UserGroupManagementTable.vue index 6b1db003cd..e6c31a94c9 100644 --- a/apps/web/src/services/iam/components/UserGroupManagementTable.vue +++ b/apps/web/src/services/iam/components/UserGroupManagementTable.vue @@ -30,17 +30,13 @@ const queryTagHelper = useQueryTags({ keyItemSets: USER_GROUP_SEARCH_HANDLERS.ke const { queryTags } = queryTagHelper; const tableState = reactive({ - fields: computed(() => { - const baseFields = [ - { name: 'user_group_id', label: 'User Group ID' }, - { name: 'description', label: 'Description' }, - { name: 'notification', label: 'Notification' }, - { name: 'users', label: 'Users' }, - { name: 'created', label: 'Created' }, - ]; - - return [...baseFields]; - }), + fields: computed(() => [ + { name: 'user_group_id', label: 'User Group ID' }, + { name: 'description', label: 'Description' }, + { name: 'notification', label: 'Notification' }, + { name: 'users', label: 'Users' }, + { name: 'created', label: 'Created' }, + ]), valueHandlerMap: computed(() => ({ user_group_id: makeDistinctValueHandler('identity.UserGroup', 'user_group_id', 'string'), description: makeDistinctValueHandler('identity.UserGroup', 'description', 'string'), @@ -70,16 +66,16 @@ const dropdownState = reactive({ selectedAction: '', menuItems: computed(() => [ { - name: 'update', label: i18n.t('IAM.USER_GROUP.ACTION.UPDATE'), type: 'item', disabled: !editState.isEditable, + name: USER_GROUP_MODAL_TYPE.UPDATE, label: i18n.t('IAM.USER_GROUP.ACTION.UPDATE'), type: 'item', disabled: !editState.isEditable, }, { - name: 'remove', label: i18n.t('IAM.USER_GROUP.ACTION.REMOVE'), type: 'item', disabled: !editState.isRemoveAble, + name: USER_GROUP_MODAL_TYPE.REMOVE, label: i18n.t('IAM.USER_GROUP.ACTION.REMOVE'), type: 'item', disabled: !editState.isRemoveAble, }, { type: 'divider', }, { - name: 'add_new_user', label: i18n.t('IAM.USER_GROUP.ACTION.ADD_NEW_USER'), type: 'item', + name: USER_GROUP_MODAL_TYPE.ADD_NEW_USER, label: i18n.t('IAM.USER_GROUP.ACTION.ADD_NEW_USER'), type: 'item', disabled: !editState.isEditable, }, ]), // selectedMenuItems: [] as SelectDropdownMenuItem[], @@ -99,7 +95,11 @@ const handleSelectDropdown = async (inputText: string) => { switch (inputText) { case USER_GROUP_MODAL_TYPE.UPDATE: - console.log('TODO: Open Update User Group Modal'); + userGroupPageStore.updateModalSettings({ + type: USER_GROUP_MODAL_TYPE.UPDATE, + title: i18n.t('IAM.USER_GROUP.MODAL.CREATE_USER_GROUP.UPDATE_TITLE'), + themeColor: 'primary', + }); dropdownState.loading = false; break; case USER_GROUP_MODAL_TYPE.REMOVE: @@ -107,7 +107,11 @@ const handleSelectDropdown = async (inputText: string) => { dropdownState.loading = false; break; case USER_GROUP_MODAL_TYPE.ADD_NEW_USER: - console.log('TODO: Open Add Users to Selected User Group Modal'); + userGroupPageStore.updateModalSettings({ + type: USER_GROUP_MODAL_TYPE.ADD_NEW_USER, + title: i18n.t('IAM.USER_GROUP.MODAL.ADD_NEW_USER.TITLE'), + themeColor: 'primary', + }); dropdownState.loading = false; break; default: diff --git a/apps/web/src/services/iam/constants/user-group-constant.ts b/apps/web/src/services/iam/constants/user-group-constant.ts index 35a1598cc8..c6dff07fc9 100644 --- a/apps/web/src/services/iam/constants/user-group-constant.ts +++ b/apps/web/src/services/iam/constants/user-group-constant.ts @@ -1,46 +1,46 @@ -import type { KeyItemSet } from '@cloudforet/mirinae/types/controls/search/query-search/type'; +interface UserGroupSearchHandlers { + title: string; + items: {name: string; label: string; dataType?: string;}[] +} -export const USER_GROUP_SEARCH_HANDLERS = { - keyItemSets: [ - { - title: 'Properties', - items: [ - { name: 'user_group_name', label: 'User Group Name' }, - { name: 'description', label: 'Description' }, - { name: 'notification', label: 'Notification' }, - { name: 'users', label: 'Users' }, - { name: 'created', label: 'Created', dataType: 'datetime' }, - ], - }, - { - title: 'Advanced', - items: [{ - name: 'tags', - label: 'Tags', - dataType: 'object', - }], - }] as KeyItemSet[], -}; +export const USER_GROUP_SEARCH_HANDLERS: UserGroupSearchHandlers[] = [ + { + title: 'Properties', + items: [ + { name: 'user_group_name', label: 'User Group Name' }, + { name: 'description', label: 'Description' }, + { name: 'notification', label: 'Notification' }, + { name: 'users', label: 'Users' }, + { name: 'created', label: 'Created', dataType: 'datetime' }, + ], + }, + { + title: 'Advanced', + items: [{ + name: 'tags', + label: 'Tags', + dataType: 'object', + }], + }, +]; export const USER_GROUP_TABS = { USERS: 'users', NOTIFICATION_CHANNEL: 'notification_channel', -} as const; - -export const USER_GROUP_USERS_SEARCH_HANDLERS = { - keyItemSets: [ - { - title: 'Properties', - items: [ - { name: 'user_id', label: 'User ID' }, - { name: 'name', label: 'Name' }, - { name: 'auth_type', label: 'Auth Type' }, - { name: 'last_activity', label: 'Last Activity' }, - ], - }, - ], }; +export const USER_GROUP_USERS_SEARCH_HANDLERS: UserGroupSearchHandlers[] = [ + { + title: 'Properties', + items: [ + { name: 'user_id', label: 'User ID' }, + { name: 'name', label: 'Name' }, + { name: 'auth_type', label: 'Auth Type' }, + { name: 'last_activity', label: 'Last Activity' }, + ], + }, +]; + export const USER_GROUP_MODAL_TYPE = { UPDATE: 'update', REMOVE: 'remove', diff --git a/apps/web/src/services/iam/pages/UserGroupMainPage.vue b/apps/web/src/services/iam/pages/UserGroupMainPage.vue index f4216816ac..e0f8c9ecc3 100644 --- a/apps/web/src/services/iam/pages/UserGroupMainPage.vue +++ b/apps/web/src/services/iam/pages/UserGroupMainPage.vue @@ -1,6 +1,7 @@