fix: Typescript check (#21)

* fix: typescript check error

* fix: typescript check error

* fix: typescript check error

* fix: typescript check error

* fix: typescript check error
This commit is contained in:
Takeshi Kimata
2024-07-28 00:20:24 +09:00
committed by GitHub
parent 44b7c7b9c3
commit c60491db09
60 changed files with 496 additions and 311 deletions

21
frontend/types/base.ts Normal file
View File

@@ -0,0 +1,21 @@
export type PageType = {
params: {
locale: string;
};
};
export type GlobalRoleType = {
uid: 'administrator' | 'user';
};
export type MemberRoleType = {
uid: 'manager' | 'developer' | 'reporter';
};
export type AutomationStatusType = {
uid: 'automated' | 'automation-not-required' | 'cannot-be-automated' | 'obsolete';
};
export type TemplateType = {
uid: 'text' | 'step';
};

View File

@@ -45,8 +45,8 @@ type RunCaseType = {
type CaseAttachmentType = {
createdAt: Date;
updatedAt: Date;
CaseId: number;
AttachmentId: number;
caseId: number;
attachmentId: number;
};
type AttachmentType = {
@@ -59,16 +59,6 @@ type AttachmentType = {
caseAttachments: CaseAttachmentType;
};
type CaseTypeCountType = {
type: number;
count: number;
};
type CasePriorityCountType = {
priority: number;
count: number;
};
type CasesMessages = {
testCaseList: string;
id: string;
@@ -97,6 +87,7 @@ type CaseMessages = {
pleaseEnterTitle: string;
description: string;
testCaseDescription: string;
priority: string;
type: string;
template: string;
testDetail: string;
@@ -119,12 +110,4 @@ type CaseMessages = {
areYouSureLeave: string;
};
export type {
CaseType,
StepType,
AttachmentType,
CaseTypeCountType,
CasePriorityCountType,
CasesMessages,
CaseMessages,
};
export type { CaseType, StepType, AttachmentType, CasesMessages, CaseMessages };

16
frontend/types/chart.ts Normal file
View File

@@ -0,0 +1,16 @@
import { ApexOptions } from 'apexcharts';
export type ChartDataType = {
series: ApexOptions['series'];
options: ApexOptions;
};
export type CaseTypeCountType = {
type: number;
count: number;
};
export type CasePriorityCountType = {
priority: number;
count: number;
};

6
frontend/types/locale.ts Normal file
View File

@@ -0,0 +1,6 @@
export type LocaleCodeType = 'en' | 'ja';
export type LocaleType = {
code: LocaleCodeType;
name: string;
};

View File

@@ -13,14 +13,8 @@ export type ProjectType = {
Runs: RunType[]; // additional property
};
export type ProjectsMessages = {
projectList: string;
newProject: string;
id: string;
publicity: string;
name: string;
detail: string;
lastUpdate: string;
export type ProjectDialogMessages = {
project: string;
projectName: string;
projectDetail: string;
public: string;
@@ -28,7 +22,20 @@ export type ProjectsMessages = {
ifYouMakePublic: string;
close: string;
create: string;
update: string;
pleaseEnter: string;
};
export type ProjectsMessages = {
projectList: string;
newProject: string;
id: string;
publicity: string;
public: string;
private: string;
name: string;
detail: string;
lastUpdate: string;
noProjectsFound: string;
};
@@ -36,5 +43,6 @@ export type ProjectMessages = {
home: string;
testCases: string;
testRuns: string;
members: string;
settings: string;
};

View File

@@ -7,6 +7,7 @@ type RunType = {
projectId: number;
createdAt: string;
updatedAt: string;
RunCases?: RunCaseType[];
};
type RunCaseType = {
@@ -15,6 +16,8 @@ type RunCaseType = {
caseId: number;
status: number;
editState: 'notChanged' | 'changed' | 'new' | 'deleted';
createdAt: string;
updatedAt: string;
};
type RunStatusCountType = {

View File

@@ -4,12 +4,9 @@ export type SettingsMessages = {
projectDetail: string;
projectOwner: string;
editProject: string;
project: string;
publicity: string;
public: string;
private: string;
ifYouMakePublic: string;
update: string;
deleteProject: string;
delete: string;
close: string;

View File

@@ -8,5 +8,5 @@ export type ToastMessages = {
};
export type ToastContextType = {
showToast: (text: string, mode: string) => {};
showToast: (text: string, mode: string) => void;
};

View File

@@ -1,3 +1,4 @@
import { LocaleCodeType } from './locale';
import { ToastMessages } from './toast';
export type UserType = {
@@ -10,8 +11,8 @@ export type UserType = {
};
export type TokenProps = {
toastMessages: ToastMessages;
locale: string;
toastMessages?: ToastMessages;
locale?: LocaleCodeType;
children?: React.ReactNode;
};
@@ -73,6 +74,8 @@ export type AdminMessages = {
username: string;
role: string;
noUsersFound: string;
administrator: string;
user: string;
};
export type AccountDropDownMessages = {