bitque/jirs-client/src/changes.rs

84 lines
1.9 KiB
Rust
Raw Normal View History

2020-05-20 21:44:58 +02:00
use seed::prelude::WebSocketMessage;
use jirs_data::{IssueId, IssueStatusId, WsMsg};
use crate::shared::styled_editor::Mode as TabMode;
2020-05-20 21:44:58 +02:00
use crate::FieldId;
#[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,
SubmitProjectSettingsForm,
// dragging
ColumnDragStarted(IssueStatusId),
ColumnDragStopped(IssueStatusId),
ColumnDragLeave(IssueStatusId),
ColumnExchangePosition(IssueStatusId),
ColumnDragOverStatus(IssueStatusId),
ColumnDropZone(IssueStatusId),
// edit issue status name
EditIssueStatusName(Option<IssueStatusId>),
SubmitIssueStatusForm,
}
#[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>),
}
#[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),
}
#[derive(Debug)]
pub enum WebSocketChanged {
2020-05-20 21:44:58 +02:00
WsMsg(WsMsg),
WebSocketMessage(WebSocketMessage),
WebSocketMessageLoaded(Vec<u8>),
WebSocketOpened,
WebSocketClosed,
SendPing,
2020-05-20 21:44:58 +02:00
Bounced(WsMsg),
}