Skip to content

Commit

Permalink
fix: fix inventory model location
Browse files Browse the repository at this point in the history
Signed-off-by: sulmo <[email protected]>
  • Loading branch information
sulmoJ committed Nov 23, 2023
1 parent a9ead3e commit 2da3a1d
Show file tree
Hide file tree
Showing 46 changed files with 66 additions and 58 deletions.
4 changes: 3 additions & 1 deletion apps/web/src/lib/access-control/page-permission-helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import type { RoleType } from '@/schema/inventory/cloud-service-report/model';

import type { RoleType } from '@/schema/identity/role/type';

import type {
PagePermissionMap,
Expand All @@ -20,6 +21,7 @@ import type { LNBItem, LNBMenu } from '@/common/modules/navigations/lnb/type';




export const getDefaultPagePermissionList = (isDomainOwner: boolean, roleType?: RoleType): PagePermissionTuple[] => {
if (isDomainOwner) return DOMAIN_OWNER_DEFAULT_PERMISSIONS;
if (roleType === 'SYSTEM') return SYSTEM_USER_DEFAULT_PERMISSIONS;
Expand Down
25 changes: 25 additions & 0 deletions apps/web/src/schema/identity/policy/model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Tags, TimeStamp } from '@/schema/_common/model';

export interface PolicyModel {
created_at: TimeStamp;
domain_id: string;
name: string;
permissions: Array<string>;
policy_id: string;
repository_info?: RepositoryInfoDataModel;
tags: Tags;
policy_type?: string;
project_id?: string;
labels?: any;
state?: PolicyState;
updated_at?: TimeStamp;
}

interface RepositoryInfoDataModel {
repository_id: string;
name: string;
repository_type: string;
endpoint: string;
}

type PolicyState = 'ENABLED' | 'DISABLED';
2 changes: 1 addition & 1 deletion apps/web/src/schema/identity/role-binding/model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TimeStamp } from '@/schema/_common/model';
import type { ProjectGroupModel } from '@/schema/identity/project-group/model';
import type { ProjectModel } from '@/schema/identity/project/model';
import type { RoleModel } from '@/schema/inventory/cloud-service-report/model';
import type { RoleModel } from '@/schema/identity/role/model';

export interface RoleBindingModel {
created_at: TimeStamp;
Expand Down
17 changes: 17 additions & 0 deletions apps/web/src/schema/identity/role/model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Tags, TimeStamp } from '@/schema/_common/model';
import type { RoleType } from '@/schema/identity/role/type';
import type { Policy } from '@/schema/inventory/cloud-service-report/model';

import type { RawPagePermission } from '@/lib/access-control/config';

export interface RoleModel {
created_at: TimeStamp;
deleted_at?: TimeStamp;
domain_id: string;
name: string;
policies?: Policy[];
page_permissions: RawPagePermission[];
role_id: string;
role_type: RoleType;
tags?: Tags; // [ description: string ]
}
3 changes: 3 additions & 0 deletions apps/web/src/schema/identity/role/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { ROLE_TYPE } from '@/schema/identity/role/constant';

export type RoleType = typeof ROLE_TYPE[keyof typeof ROLE_TYPE];
24 changes: 0 additions & 24 deletions apps/web/src/schema/identity/user-group/model.ts
Original file line number Diff line number Diff line change
@@ -1,24 +0,0 @@
import type { Tags, TimeStamp } from '@/schema/_common/model';

export interface PolicyModel {
created_at: TimeStamp;
domain_id: string;
name: string;
permissions: Array<string>;
policy_id: string;
repository_info?: RepositoryInfoDataModel;
tags: Tags;
policy_type?: string;
project_id?: string;
labels?: any;
state?: PolicyState;
updated_at?: TimeStamp;
}

interface RepositoryInfoDataModel {
repository_id: string;
name: string;
repository_type: string;
endpoint: string;
}
type PolicyState = 'ENABLED' | 'DISABLED';
20 changes: 0 additions & 20 deletions apps/web/src/schema/inventory/cloud-service-report/model.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
import type { Tags, TimeStamp } from '@/schema/_common/model';
import type { ROLE_TYPE } from '@/schema/identity/role/constant';

import type { RawPagePermission } from '@/lib/access-control/config';


export type RoleType = typeof ROLE_TYPE[keyof typeof ROLE_TYPE];

export interface RoleModel {
created_at: TimeStamp;
deleted_at?: TimeStamp;
domain_id: string;
name: string;
policies?: Policy[];
page_permissions: RawPagePermission[];
role_id: string;
role_type: RoleType;
tags?: Tags; // [ description: string ]
}

export interface Policy {
policy_id: string;
policy_type: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/schema/inventory/job-task/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { JobTaskError } from '@/services/asset-inventory/types/collector-hi

export interface JobTaskModel {
job_task_id: string;
status: string;
status: string;
create_count: number;
updated_count: number;
failure_count: number;
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import type { ToolboxOptions } from '@cloudforet/core-lib/component-util/toolbox
import { ApiQueryHelper } from '@cloudforet/core-lib/space-connector/helper';
import { SpaceRouter } from '@/router';
import type { PolicyModel } from '@/schema/identity/user-group/model';
import type { PolicyModel } from '@/schema/identity/policy/model';
import type { Policy } from '@/schema/inventory/cloud-service-report/model';
import { store } from '@/store';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ import type { DataTableField } from '@spaceone/design-system/types/data-display/
import { iso8601Formatter } from '@cloudforet/core-lib';
import { SpaceConnector } from '@cloudforet/core-lib/space-connector';
import type { PolicyModel } from '@/schema/identity/user-group/model';
import type { RoleModel } from '@/schema/inventory/cloud-service-report/model';
import type { PolicyModel } from '@/schema/identity/policy/model';
import type { RoleModel } from '@/schema/identity/role/model';
import { store } from '@/store';
import { i18n } from '@/translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ import {
import { PHeading } from '@spaceone/design-system';
import type { Policy, RoleModel, RoleType } from '@/schema/inventory/cloud-service-report/model';
import type { RoleModel } from '@/schema/identity/role/model';
import type { RoleType } from '@/schema/identity/role/type';
import type { Policy } from '@/schema/inventory/cloud-service-report/model';
import { i18n } from '@/translations';
import type { RawPagePermission } from '@/lib/access-control/config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { PPaneLayout, PHeading } from '@spaceone/design-system';
import { find, isEqual } from 'lodash';
import { ROLE_TYPE } from '@/schema/identity/role/constant';
import type { RoleType } from '@/schema/inventory/cloud-service-report/model';
import type { RoleType } from '@/schema/identity/role/type';
import type { RawPagePermission } from '@/lib/access-control/config';
import { PAGE_PERMISSION_TYPE } from '@/lib/access-control/config';
Expand All @@ -60,6 +60,7 @@ import type { PageAccessMenuItem } from '@/services/administration/types/page-ac
const getIndividualPagePermissions = (menuItem: PageAccessMenuItem): RawPagePermission[] => {
if (menuItem.id === 'all') return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import {
} from '@spaceone/design-system';
import { ROLE_TYPE } from '@/schema/identity/role/constant';
import type { RoleType } from '@/schema/inventory/cloud-service-report/model';
import type { RoleType } from '@/schema/identity/role/type';
import { i18n } from '@/translations';
import { useFormValidator } from '@/common/composables/form-validator';
Expand All @@ -76,6 +76,7 @@ import type { BaseInfoFormData } from '@/services/administration/components/Role
import { ROLE_TYPE_BADGE_OPTION } from '@/services/administration/constants/role-constant';
interface RoleTypeForm {label: string; key: string; description: TranslateResult}
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { iso8601Formatter } from '@cloudforet/core-lib';
import type { KeyDataType, ValueHandler, ValueItem } from '@cloudforet/core-lib/component-util/query-search/type';

import type { TimeStamp } from '@/schema/_common/model';
import type { PolicyModel } from '@/schema/identity/user-group/model';
import type { PolicyModel } from '@/schema/identity/policy/model';

import { POLICY_TYPE } from '@/services/administration/constants/policy-constant';
import type { PolicyType } from '@/services/administration/types/policy-type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { PHeading, PButton } from '@spaceone/design-system';
import { SpaceConnector } from '@cloudforet/core-lib/space-connector';
import { SpaceRouter } from '@/router';
import type { RoleModel } from '@/schema/inventory/cloud-service-report/model';
import type { RoleModel } from '@/schema/identity/role/model';
import { i18n } from '@/translations';
import { showSuccessMessage } from '@/lib/helper/notice-alert-helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { PHeading, PButton } from '@spaceone/design-system';
import { SpaceConnector } from '@cloudforet/core-lib/space-connector';
import { SpaceRouter } from '@/router';
import type { RoleModel } from '@/schema/inventory/cloud-service-report/model';
import type { RoleModel } from '@/schema/identity/role/model';
import { i18n } from '@/translations';
import { showSuccessMessage } from '@/lib/helper/notice-alert-helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SpaceConnector } from '@cloudforet/core-lib/space-connector';


import type { ListResponse } from '@/schema/_common/model';
import type { PolicyModel } from '@/schema/identity/user-group/model';
import type { PolicyModel } from '@/schema/identity/policy/model';

import ErrorHandler from '@/common/composables/error/errorHandler';

Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/store/modules/user/getters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Getter } from 'vuex';

import type { RoleType } from '@/schema/inventory/cloud-service-report/model';
import type { RoleType } from '@/schema/identity/role/type';

import { languages } from '@/store/modules/user/config';

Expand All @@ -14,6 +14,7 @@ import {

import type { UserState } from './type';


export const isDomainOwner = (state: UserState): boolean => state.userType === 'DOMAIN_OWNER';
export const languageLabel = (state: UserState): string => languages[state.language as string] || state.language;
export const roleNames = (state: UserState): Array<string> => {
Expand Down

0 comments on commit 2da3a1d

Please sign in to comment.