Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail dialog rebased #281

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ buildClosePollButtonWith: aBuilder

^ aBuilder pluggableButtonSpec new
model: self;
enabled: #closePollButtonEnabled;
label: 'Close Poll';
help: 'Close poll to prevent participants from handing in answers';
action: #closePoll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ buildDeletePollButtonWith: aBuilder

^ aBuilder pluggableButtonSpec new
model: self;
enabled: #pollSelected;
label: 'Delete Poll';
help: 'Delete Poll to clear space for new polls.';
action: #deletePoll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ buildExportResultsButtonWith: aBuilder
^ aBuilder pluggableButtonSpec new
model: self;
label: 'Export Results';
enabled: #pollSelected;
help: 'Export the results of the currently selected poll to ressources/DataExports as a .csv file named after the poll id.';
action: #exportResults;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ buildIdCopyButtonWith: aBuilder

^ aBuilder pluggableButtonSpec new
model: self;
enabled: #pollSelected;
label: 'Copy Poll-Link to Clipboard';
action: #copyPollLink;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
toolbuilder
buildOpenMailDialogButtonWith: aBuilder

^ aBuilder pluggableButtonSpec new
model: self;
label: 'Send Mails';
help: 'You can only send mails if a User Set is selected in the poll draft builder.';
action: #openMailDialog;
enabled: #mailDialogButtonEnabled;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildWith: builder
layout: #vertical;
children: #buildVisualization;
yourself].
self openMailDialogButtonFrame -> [self buildOpenMailDialogButtonWith: builder].
self deletePollButtonFrame -> [self buildDeletePollButtonWith: builder].
self createPollFromSavedPollsButtonFrame -> [self buildCreatePollFromSavedDraftsButton: builder].
self idCopyButtonFrame -> [self buildIdCopyButtonWith: builder].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
modifying
closePoll

self currentPoll isZero ifFalse: [
(LQRemotePollRepoServer pollRepo
at: self currentPollID
ifAbsent: [^ 'This poll does not exist.']) closeWithPassword: (LQPasswordManager default
findPasswordFor: self currentPollID
ifAbsent: [^ UIManager default inform: 'You don''t have access to this poll.']).
self changed: #pollIDString]
self changed: #closePollButtonEnabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
toolbuilder
closePollButtonEnabled

^ (self pollSelected) and: [(LQRemotePollRepoServer pollRepo at: self currentPollID) isOpen]
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
modifying
copyPollLink

self currentPoll isZero ifFalse: [
Clipboard clipboardText: self currentLink asText.
"Interacting with clipboard takes a bit of time
otherwise we get faulty results when quickly
accessing the Clipboard afterwards"
(Delay forSeconds: self clipboardDelay) wait]
(Delay forSeconds: self clipboardDelay) wait
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
modifying
deletePoll

self currentPoll isZero ifFalse: [
LQRemotePollRepoServer pollRepo
at: self currentPollID
ifAbsent: [^ 'This poll does not exist.'].
LQRemotePollRepoServer pollRepo removeKey: self currentPollID.
self setIndex: self pollList size]
self setIndex: self pollList size
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
modifying
exportResults

self currentPoll isZero ifFalse: [
LQRemotePollRepoServer pollRepo
at: self currentPollID
ifAbsent: [^ 'This poll does not exist.'].
(LQRemotePollRepoServer pollRepo at: self currentPollID) exportCSV]
(LQRemotePollRepoServer pollRepo at: self currentPollID) exportCSV
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
toolbuilder
mailDialogButtonEnabled

^ (self pollSelected) and: [(LQRemotePollRepoServer pollRepo at: self currentPollID) requiresAuthentication]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
modifying
openMailDialog

LQMailDialog openWithPoll: self currentPollID
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
toolbuilder
openMailDialogButtonFrame

^ self frame: 0.825 fromTop: 0.75 fromLeft: 0.75 width: 0.25
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
accessing
pollIDString

(self currentPoll isZero or: [self pollList isEmpty]) ifFalse: [
(LQRemotePollRepoServer pollRepo at: self currentPollID) isOpen ifFalse: [^ 'Poll closed!'].
self currentPoll isZero ifFalse: [
^ self currentPollID asString].
self pollList ifEmpty: [^ 'No Polls on your Server!'].
^ 'No poll selected!'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
toolbuilder
pollSelected

^ self currentPoll isZero not
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ setIndex: index
self stopRefreshingVisualization.
self changed: #buildVisualization.
self changed: #pollIDString.
self changed: #getIndex
self changed: #getIndex.
self changed: #mailDialogButtonEnabled.
self changed: #closePollButtonEnabled.
self changed: #pollSelected
23 changes: 15 additions & 8 deletions packages/Liquid-UI.package/LQHostMenu.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
"newWithTitle:" : "ape 7/23/2022 09:58",
"open" : "6/23/2024 17:58:45" },
"instance" : {
"buildClosePollButtonWith:" : "FLST 7/11/2024 20:44",
"buildClosePollButtonWith:" : "Ingmar Vogel 7/12/2024 11:01",
"buildCreateAnotherPollButton:" : "FLST 7/11/2024 20:44",
"buildCreatePollFromSavedDraftsButton:" : "FLST 7/12/2024 10:31",
"buildDeletePollButtonWith:" : "FLST 7/11/2024 20:44",
"buildExportResultsButtonWith:" : "FLST 7/11/2024 20:44",
"buildIDTextBoxWith:" : "FLST 7/11/2024 20:44",
"buildIdCopyButtonWith:" : "FLST 7/11/2024 20:44",
"buildIdCopyButtonWith:" : "Ingmar Vogel 7/12/2024 11:12",
"buildOpenMailDialogButtonWith:" : "Ingmar Vogel 7/12/2024 10:46",
"buildPollListWith:" : "FLST 7/11/2024 20:44",
"buildStopServerButtonWith:" : "FLST 7/11/2024 20:44",
"buildVisualization" : "FLST 7/11/2024 20:44",
"buildWith:" : "FLST 7/11/2024 20:44",
"clipboardDelay" : "FLST 7/11/2024 20:44",
"closePoll" : "FLST 7/11/2024 20:44",
"closePoll" : "Ingmar Vogel 7/12/2024 11:19",
"closePollButtonEnabled" : "Ingmar Vogel 7/12/2024 11:00",
"closePollButtonFrame" : "FLST 7/11/2024 20:44",
"copyPollLink" : "FLST 7/11/2024 20:44",
"copyPollLink" : "Ingmar Vogel 7/12/2024 11:12",
"createAnotherPollButtonFrame" : "FLST 7/11/2024 20:44",
"createPoll" : "FLST 7/11/2024 20:44",
"createPollFromSavedPollsButtonFrame" : "FLST 7/11/2024 20:44",
Expand All @@ -27,9 +29,9 @@
"currentPollID" : "FLST 7/11/2024 20:44",
"currentVisualizationControls" : "FLST 7/11/2024 20:44",
"currentVisualizationControls:" : "FLST 7/11/2024 20:44",
"deletePoll" : "FLST 7/11/2024 20:44",
"deletePoll" : "Ingmar Vogel 7/12/2024 11:11",
"deletePollButtonFrame" : "FLST 7/11/2024 20:44",
"exportResults" : "FLST 7/11/2024 20:44",
"exportResults" : "Ingmar Vogel 7/12/2024 11:11",
"exportResultsButtonFrame" : "FLST 7/11/2024 20:44",
"extent" : "6/23/2024 17:58:45",
"frame:fromTop:fromLeft:width:" : "FLST 7/11/2024 20:44",
Expand All @@ -38,10 +40,15 @@
"idTextBoxFrameFrame" : "FLST 7/11/2024 20:44",
"initialize" : "FLST 7/11/2024 20:44",
"openPollDraftMenu" : "FLST 7/12/2024 10:31",
"pollIDString" : "FLST 7/11/2024 20:44",
"mailDialogButtonEnabled" : "Ingmar Vogel 7/12/2024 10:50",
"openMailDialog" : "Ingmar Vogel 7/12/2024 10:29",
"openMailDialogButtonFrame" : "Ingmar Vogel 7/12/2024 10:26",
"openUserSetMenu" : "6/23/2024 17:58:45",
"pollIDString" : "Ingmar Vogel 7/12/2024 11:18",
"pollList" : "FLST 7/11/2024 20:44",
"pollListFrame" : "FLST 7/11/2024 20:44",
"setIndex:" : "FLST 7/11/2024 20:44",
"pollSelected" : "Ingmar Vogel 7/12/2024 10:56",
"setIndex:" : "Ingmar Vogel 7/12/2024 11:04",
"stopRefreshingVisualization" : "FLST 7/11/2024 20:44",
"stopServer" : "FLST 7/11/2024 20:44",
"stopServerButtonFrame" : "FLST 7/11/2024 20:44",
Expand Down
Loading