Skip to content
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
5 changes: 4 additions & 1 deletion src/types/Access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { RoleId } from 'types/Role';

export type Access = {
type: AccessType;
roles: RoleId[];
roles?: RoleId[];
resources?: string[];
};

export type BasicAccessType = 'read' | 'write' | 'create' | 'admin';
export type AccessType =
| 'self'
| 'create_own'
| 'create_all'
| 'read_own'
Expand Down
8 changes: 4 additions & 4 deletions src/types/AdvancedLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import { SimpleConditional } from './BaseComponent';

export type LogicTriggerSimple = {
type: 'simple';
simple: SimpleConditional;
simple?: SimpleConditional;
};

export type LogicTriggerJavascript = {
type: 'javascript';
javascript: string;
javascript?: string;
};

export type LogicTriggerJson = {
type: 'json';
json: RulesLogic;
json?: RulesLogic;
};

export type LogicTriggerEvent = {
type: 'event';
event: string;
event?: string;
};

export type LogicTrigger =
Expand Down
3 changes: 3 additions & 0 deletions src/types/BaseComponent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { RulesLogic } from 'json-logic-js';
import { AdvancedLogic } from './AdvancedLogic';
import { getModelType } from 'utils/formUtil';
import { Access, BasicAccessType } from './Access';
export type JSONConditional = { json: RulesLogic };
export type LegacyConditional = {
show: boolean | string | null;
Expand Down Expand Up @@ -85,6 +86,8 @@ export type BaseComponent = {
height: string;
};
allowCalculateOverride?: boolean;
submissionAccess?: Access[];
defaultPermission?: BasicAccessType;
encrypted?: boolean;
showCharCount?: boolean;
showWordCount?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/types/process/ProcessorContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type ProcessorContext<ProcessorScope> = {
form?: Form;
paths?: ComponentPaths;
submission?: Submission;
current?: Submission; // The current submission from database.
components?: Component[];
instance?: PassedComponentInstance;
process?: ProcessType;
Expand Down
Loading