Просмотр исходного кода

change definition file of IPageGrantData

yuken 3 лет назад
Родитель
Сommit
4a133aab4c

+ 2 - 2
packages/app/src/components/Page/FixPageGrantAlert.tsx

@@ -7,8 +7,8 @@ import {
 
 import { toastError, toastSuccess } from '~/client/util/apiNotification';
 import { apiv3Put } from '~/client/util/apiv3-client';
-import { PageGrant } from '~/interfaces/page';
-import { IRecordApplicableGrant, IResIsGrantNormalizedGrantData, IPageGrantData } from '~/interfaces/page-grant';
+import { PageGrant, IPageGrantData } from '~/interfaces/page';
+import { IRecordApplicableGrant, IResIsGrantNormalizedGrantData } from '~/interfaces/page-grant';
 import { useCurrentPageId, useHasParent } from '~/stores/context';
 import { useSWRxApplicableGrant, useSWRxIsGrantNormalized } from '~/stores/page';
 

+ 1 - 8
packages/app/src/interfaces/page-grant.ts

@@ -1,4 +1,4 @@
-import { PageGrant } from './page';
+import { PageGrant, IPageGrantData } from './page';
 
 export type IDataApplicableGroup = {
   applicableGroups?: {_id: string, name: string}[] // TODO: Typescriptize model
@@ -9,13 +9,6 @@ export type IRecordApplicableGrant = Record<PageGrant, IDataApplicableGrant>
 export type IResApplicableGrant = {
   data?: IRecordApplicableGrant
 }
-export type IPageGrantData = {
-  grant: number,
-  grantedGroup?: {
-    id: string,
-    name: string
-  }
-}
 export type IResIsGrantNormalizedGrantData = {
   isForbidden: boolean,
   currentPageGrant: IPageGrantData,

+ 11 - 3
packages/app/src/interfaces/page.ts

@@ -1,9 +1,9 @@
 import { Ref, Nullable } from './common';
-import { IUser } from './user';
-import { IRevision, HasRevisionShortbody } from './revision';
-import { ITag } from './tag';
 import { HasObjectId } from './has-object-id';
+import { IRevision, HasRevisionShortbody } from './revision';
 import { SubscriptionStatusType } from './subscription';
+import { ITag } from './tag';
+import { IUser } from './user';
 
 
 export interface IPage {
@@ -117,6 +117,14 @@ export type IPageWithMeta<M = IPageInfoAll> = IDataWithMeta<IPageHasId, M>;
 export type IPageToDeleteWithMeta = IDataWithMeta<HasObjectId & (IPage | { path: string, revision: string }), IPageInfoForEntity | unknown>;
 export type IPageToRenameWithMeta = IPageToDeleteWithMeta;
 
+export type IPageGrantData = {
+  grant: number,
+  grantedGroup?: {
+    id: string,
+    name: string
+  }
+}
+
 export type IDeleteSinglePageApiv1Result = {
   ok: boolean
   path: string,