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

FIO-8228: Expanding the types for Project Roles and Access Information. #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
180 changes: 103 additions & 77 deletions src/types/project/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,98 +4,124 @@ import { ProjectSettings } from 'types/project/settings';
export type ProjectId = string;

export type Project = {
_id: ProjectId;
title: string;
name: string;
type?: ProjectType;
description?: string;
tag?: string;
owner: SubmissionId;
project?: string;
remote?: any;
plan: ProjectPlan;
billing?: ProjectBilling;
apiCalls?: ProjectApiCalls;
steps: Array<string>;
framework: ProjectFramework;
primary: boolean;
access: Access[];
trial?: Date | string;
lastDeploy?: Date | string;
stageTitle: string;
machineName: string;
config?: Record<string, string>;
protect: boolean;
settings?: ProjectSettings;
remoteSecret?: string;

formDefaults: {
revisions?: 'current' | 'original';
};
public?: {
custom?: {
css?: string;
js?: string;
_id: ProjectId;
title: string;
name: string;
type?: ProjectType;
description?: string;
tag?: string;
owner: SubmissionId;
project?: string;
remote?: any;
plan: ProjectPlan;
billing?: ProjectBilling;
apiCalls?: ProjectApiCalls;
steps: Array<string>;
framework: ProjectFramework;
primary: boolean;
access: Access[];
trial?: Date | string;
lastDeploy?: Date | string;
stageTitle: string;
machineName: string;
config?: Record<string, string>;
protect: boolean;
settings?: ProjectSettings;
remoteSecret?: string;
builderConfig?: any;
formDefaults: {
revisions?: 'current' | 'original';
};
public?: {
custom?: {
css?: string;
js?: string;
};
formModule?: string;
};
formModule?: string;
};

// Database timestamps
created: Date | string;
modified: Date | string;
deleted: Date | string;
// Database timestamps
created: Date | string;
modified: Date | string;
deleted: Date | string;
};

export type ProjectRef = {
_id?: ProjectId;
name?: string;
};

export type ProjectType = 'project' | 'stage' | 'tenant';

export type ProjectPlan = 'basic' | 'independent' | 'team' | 'trial' | 'commercial';

export type ProjectFramework =
| 'angular'
| 'angular2'
| 'react'
| 'vue'
| 'html5'
| 'simple'
| 'custom'
| 'aurelia'
| 'javascript';
| 'angular'
| 'angular2'
| 'react'
| 'vue'
| 'html5'
| 'simple'
| 'custom'
| 'aurelia'
| 'javascript';

export type ProjectUsage = {
projects?: number;
tenants?: number;
stages?: number;
livestages?: number;
forms?: number;
emails?: number;
submissionRequests?: number;
formRequests?: number;
pdfs?: number;
pdfDownloads?: number;
remoteStages?: number;
apiServers?: number;
pdfServers?: number;
formManagers?: number;
vpats?: number;
submissionServers?: number;
plan?: ProjectPlan;
startDate?: string;
options?: {
sac?: boolean;
vpat?: boolean;
pdfBasic?: boolean;
};
projects?: number;
tenants?: number;
stages?: number;
livestages?: number;
forms?: number;
emails?: number;
submissionRequests?: number;
formRequests?: number;
pdfs?: number;
pdfDownloads?: number;
remoteStages?: number;
apiServers?: number;
pdfServers?: number;
formManagers?: number;
vpats?: number;
submissionServers?: number;
plan?: ProjectPlan;
startDate?: string;
options?: {
sac?: boolean;
vpat?: boolean;
pdfBasic?: boolean;
};
};

export type ProjectBilling = {
calls: number;
checked: number;
exceeds: boolean;
usage: ProjectUsage;
calls: number;
checked: number;
exceeds: boolean;
usage: ProjectUsage;
};

export type ProjectApiCalls = {
limit: ProjectUsage;
used: ProjectUsage;
reset: Date | string;
limit: ProjectUsage;
used: ProjectUsage;
reset: Date | string;
};

export type ProjectRole = {
_id: string;
title: string;
default: boolean;
admin: boolean;
};

export type FormAccessInfo = {
_id: string;
name: string;
path: string;
title: string;
access: Record<string, Access>;
submissionAccess: Record<string, Access>;
};

export type ProjectAccessInfo = {
roles: Record<string, ProjectRole>;
forms: Record<string, FormAccessInfo>;
};
Loading