2020-05-20 21:44:58 +02:00
|
|
|
use seed::prelude::WebSocketMessage;
|
|
|
|
|
|
|
|
use jirs_data::{IssueId, IssueStatusId, WsMsg};
|
2020-05-19 11:55:55 +02:00
|
|
|
|
|
|
|
use crate::shared::styled_editor::Mode as TabMode;
|
2020-05-20 21:44:58 +02:00
|
|
|
use crate::FieldId;
|
2020-05-19 11:55:55 +02:00
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum FieldChange {
|
|
|
|
LinkCopied(FieldId, bool),
|
|
|
|
TabChanged(FieldId, TabMode),
|
|
|
|
ToggleCommentForm(FieldId, bool),
|
|
|
|
EditComment(FieldId, i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum BoardPageChange {
|
|
|
|
// dragging
|
|
|
|
IssueDragStarted(IssueId),
|
|
|
|
IssueDragStopped(IssueId),
|
|
|
|
DragLeave(IssueId),
|
|
|
|
ExchangePosition(IssueId),
|
|
|
|
IssueDragOverStatus(IssueStatusId),
|
|
|
|
IssueDropZone(IssueStatusId),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum UsersPageChange {
|
|
|
|
ResetForm,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum ProjectPageChange {
|
|
|
|
ResetForm,
|
2020-05-20 10:18:37 +02:00
|
|
|
SubmitProjectSettingsForm,
|
2020-05-19 11:55:55 +02:00
|
|
|
// dragging
|
|
|
|
ColumnDragStarted(IssueStatusId),
|
|
|
|
ColumnDragStopped(IssueStatusId),
|
|
|
|
ColumnDragLeave(IssueStatusId),
|
|
|
|
ColumnExchangePosition(IssueStatusId),
|
|
|
|
ColumnDragOverStatus(IssueStatusId),
|
|
|
|
ColumnDropZone(IssueStatusId),
|
|
|
|
// edit issue status name
|
|
|
|
EditIssueStatusName(Option<IssueStatusId>),
|
2020-05-20 10:18:37 +02:00
|
|
|
SubmitIssueStatusForm,
|
2020-05-19 11:55:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum ProfilePageChange {
|
|
|
|
SubmitForm,
|
|
|
|
}
|
|
|
|
|
2020-05-22 17:35:32 +02:00
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum InvitationPageChange {
|
|
|
|
SubmitForm,
|
|
|
|
}
|
|
|
|
|
2020-05-31 16:08:48 +02:00
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum ReportsPageChange {
|
|
|
|
DayHovered(Option<chrono::NaiveDate>),
|
|
|
|
DaySelected(Option<chrono::NaiveDate>),
|
|
|
|
}
|
|
|
|
|
2020-05-19 11:55:55 +02:00
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub enum PageChanged {
|
|
|
|
Users(UsersPageChange),
|
|
|
|
ProjectSettings(ProjectPageChange),
|
|
|
|
Profile(ProfilePageChange),
|
|
|
|
Board(BoardPageChange),
|
2020-05-22 17:35:32 +02:00
|
|
|
Invitation(InvitationPageChange),
|
2020-05-31 16:08:48 +02:00
|
|
|
Reports(ReportsPageChange),
|
2020-05-19 11:55:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum WebSocketChanged {
|
2020-05-20 21:44:58 +02:00
|
|
|
WsMsg(WsMsg),
|
2020-05-19 11:55:55 +02:00
|
|
|
WebSocketMessage(WebSocketMessage),
|
|
|
|
WebSocketMessageLoaded(Vec<u8>),
|
|
|
|
WebSocketOpened,
|
|
|
|
WebSocketClosed,
|
|
|
|
SendPing,
|
2020-05-20 21:44:58 +02:00
|
|
|
Bounced(WsMsg),
|
2020-05-19 11:55:55 +02:00
|
|
|
}
|