mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Edit poll UX (#2151)
* Add edit poll on room proxy * Add CreatePollMode * Add “edit poll” presentation flow * Add delete poll section * Inject editing poll * Add submit action * Refactor validation logic * Add edit/delete actions * Fix bubble timestamp for polls * Update localisations * Refactor CreatePoll -> PollForm * Refactor tests * Update rust sdk to 0.0.5-november23 * Update confirmation alerts * Add edit support in TimelineItem menu * Refactor a11y id * Cleanup * Fix failing tests * Add tests * Refine isEditable workaround * Refactor timestamp in TimelineItemBubbledStylerView
This commit is contained in:
@@ -67,6 +67,15 @@ extension Poll {
|
||||
.mock(text: "USA 🇺🇸", votes: 2, allVotes: 10)],
|
||||
ended: true)
|
||||
}
|
||||
|
||||
static var emptyDisclosed: Self {
|
||||
mock(question: "What country do you like most?",
|
||||
pollKind: .disclosed,
|
||||
options: [.mock(text: "Italy 🇮🇹", votes: 0, allVotes: 0),
|
||||
.mock(text: "China 🇨🇳", votes: 0, allVotes: 0),
|
||||
.mock(text: "USA 🇺🇸", votes: 0, allVotes: 0)],
|
||||
createdByAccountOwner: true)
|
||||
}
|
||||
}
|
||||
|
||||
extension Poll.Option {
|
||||
@@ -81,13 +90,13 @@ extension Poll.Option {
|
||||
}
|
||||
|
||||
extension PollRoomTimelineItem {
|
||||
static func mock(poll: Poll, isOutgoing: Bool = true) -> Self {
|
||||
static func mock(poll: Poll, isOutgoing: Bool = true, isEditable: Bool = false) -> Self {
|
||||
.init(id: .init(timelineID: UUID().uuidString, eventID: UUID().uuidString),
|
||||
poll: poll,
|
||||
body: "poll",
|
||||
timestamp: "Now",
|
||||
isOutgoing: isOutgoing,
|
||||
isEditable: false,
|
||||
isEditable: isEditable,
|
||||
canBeRepliedTo: true,
|
||||
sender: .init(id: "userID"),
|
||||
properties: .init())
|
||||
|
||||
Reference in New Issue
Block a user