-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from totono/11-要望詳細入力ボタン位置変更または編集可
11 要望詳細入力ボタン位置変更または編集可
- Loading branch information
Showing
47 changed files
with
1,079 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
use sea_orm::entity::prelude::*; | ||
use serde::{Serialize, Deserialize}; | ||
use ts_rs::TS; | ||
|
||
#[derive(TS,Serialize,Deserialize,EnumIter, DeriveActiveEnum, Debug, Clone, PartialEq, Eq)] | ||
#[sea_orm(rs_type = "i32", db_type = "Integer")] | ||
#[ts(export)] | ||
pub enum CompleteStatus{ | ||
#[sea_orm(num_value = 0)] | ||
NotComplete, | ||
#[sea_orm(num_value = 1)] | ||
Completed, | ||
} | ||
|
||
#[derive(TS,Serialize, Deserialize, EnumIter, DeriveActiveEnum, Debug, Clone, PartialEq, Eq)] | ||
#[sea_orm(rs_type = "i32", db_type = "Integer")] | ||
#[ts(export)] | ||
pub enum DeleteStatus{ | ||
#[sea_orm(num_value = 0)] | ||
NotDelete, | ||
#[sea_orm(num_value = 1)] | ||
Deleted, | ||
use sea_orm::entity::prelude::*; | ||
use serde::{Serialize, Deserialize}; | ||
use ts_rs::TS; | ||
|
||
#[derive(TS,Serialize,Deserialize,EnumIter, DeriveActiveEnum, Debug, Clone, PartialEq, Eq)] | ||
#[sea_orm(rs_type = "i32", db_type = "Integer")] | ||
#[ts(export)] | ||
pub enum Completed{ | ||
No = 0, | ||
Yes = 1, | ||
} | ||
|
||
#[derive(TS,Serialize, Deserialize, EnumIter, DeriveActiveEnum, Debug, Clone, PartialEq, Eq)] | ||
#[sea_orm(rs_type = "i32", db_type = "Integer")] | ||
#[ts(export)] | ||
pub enum Deleted{ | ||
No = 0, | ||
Yes = 1, | ||
} | ||
|
||
#[derive(TS,Serialize, Deserialize, EnumIter, DeriveActiveEnum, Debug, Clone, PartialEq, Eq)] | ||
#[sea_orm(rs_type = "i32", db_type = "Integer")] | ||
#[ts(export)] | ||
pub enum ShouldNotify{ | ||
No = 0, | ||
Yes = 1, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
||
export type CompleteStatus = "NotComplete" | "Completed"; | ||
export type Completed = "No" | "Yes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
||
export type DeleteStatus = "NotDelete" | "Deleted"; | ||
export type Deleted = "No" | "Yes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
|
||
export type ShouldNotify = "No" | "Yes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
import type { CompleteStatus } from ".\\status\\CompleteStatus"; | ||
import type { DeleteStatus } from ".\\status\\DeleteStatus"; | ||
import type { Completed } from ".\\status\\CompleteStatus"; | ||
import type { Deleted } from ".\\status\\DeleteStatus"; | ||
import type { ShouldNotify } from ".\\status\\ShouldNotify"; | ||
|
||
export interface Model { id: number, title: string, text: string | null, file_path: string | null, completed_at: string | null, is_completed: CompleteStatus, limit_date: string | null, limit_time: string | null, should_notify: number | null, create_at: string, update_at: string | null, deleted_at: string | null, is_deleted: DeleteStatus, } | ||
export interface Model { id: number, title: string, text: string | undefined, file_path: string | null, completed_at: string | null, is_completed: Completed, limit_date: string | undefined, limit_time: string | undefined, should_notify: ShouldNotify, create_at: string, update_at: string | null, deleted_at: string | null, is_deleted: Deleted, } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Model } from "../../../bindings/tasks"; | ||
import { Completed } from "../../../bindings/status/CompleteStatus"; | ||
import { taskCommand } from "../../../ipcs"; | ||
import { Button } from "antd"; | ||
|
||
export const CompleteButton = (props: any) => { | ||
const clickHandle = (_e: any) => { | ||
console.log(props.data); | ||
taskCommand.setStatus(parseInt(props.data), "Yes"); | ||
props.setFetch(true); | ||
}; | ||
|
||
return ( | ||
<Button value={props.data} onClick={clickHandle}> | ||
Complete | ||
</Button> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import { DatePicker} from "antd"; | ||
import { Dayjs } from "dayjs"; | ||
import { Dispatch, SetStateAction } from "react"; | ||
import { InputState } from "../InputState"; | ||
import { dateTimeStyle } from "./dateTimeStyle"; | ||
|
||
|
||
type DateFormProps = { | ||
task: InputState; | ||
setTask: Dispatch<SetStateAction<InputState>>; | ||
value: Dayjs | null; | ||
} | ||
|
||
|
||
const dateFormat = "YYYY/MM/DD"; | ||
|
||
export const DateForm = ({task,setTask,value}:DateFormProps) => { | ||
|
||
const handleDateInput = (date: Dayjs | null) => { | ||
setTask({ ...task, limit_date: date?.format(dateFormat) ?? undefined }); | ||
}; | ||
|
||
return ( | ||
<DatePicker | ||
css={dateTimeStyle} | ||
name="date" | ||
value={value} | ||
onChange={handleDateInput} | ||
format={"MM/DD"} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import { TimePicker } from "antd" | ||
import dayjs, { Dayjs } from "dayjs"; | ||
import { Dispatch, SetStateAction, useState } from "react"; | ||
import * as objectSupport from "dayjs/plugin/objectSupport"; | ||
import { Model } from "../../../../bindings/tasks"; | ||
import { InputState } from "../InputState"; | ||
import { dateTimeStyle } from "./dateTimeStyle"; | ||
|
||
|
||
dayjs.extend(objectSupport); | ||
|
||
|
||
const timeFormat = "HH:mm"; | ||
const disabledTime = () => { | ||
return { disabledHours: () => [0, 1, 2, 3, 4, 5, 6, 7] } | ||
}; | ||
|
||
type TimeFormProps = { | ||
task: InputState; | ||
setTask: Dispatch<SetStateAction<InputState>>; | ||
value: string | undefined; | ||
} | ||
|
||
|
||
export const TimeForm = ({task,setTask,value}:TimeFormProps) => { | ||
|
||
console.log("TimeForm"); | ||
console.log(value); | ||
|
||
const hour = value ? parseInt(value.split(":")[0]) : undefined; | ||
const minute = value ? parseInt(value.split(":")[1]) : undefined; | ||
|
||
const time = value ? dayjs({hour:hour, minute:minute}) : undefined; | ||
|
||
const handleTimeInput = (time: Dayjs | null) => { | ||
console.log("task set"); | ||
console.log(time?.format(timeFormat)); | ||
setTask({ ...task, limit_time: time?.format(timeFormat) ?? undefined }); | ||
//console.log(task); | ||
}; | ||
|
||
return ( | ||
<TimePicker | ||
css = {dateTimeStyle} | ||
name="time" | ||
value={time} | ||
onSelect={handleTimeInput} | ||
onChange={handleTimeInput} | ||
disabledTime={disabledTime} | ||
hideDisabledOptions={true} | ||
minuteStep={5} | ||
format={timeFormat} | ||
/> | ||
) | ||
|
||
} |
Oops, something went wrong.