Skip to content

Commit

Permalink
Added poll draft menu
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-str committed Jun 4, 2024
1 parent 7b3b759 commit 77e24b4
Show file tree
Hide file tree
Showing 34 changed files with 193 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
asString
^ self title
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
initialize-release
initialize

super initialize.
self questionList: OrderedCollection new
self questionList: OrderedCollection new;
pollDraftId: UUID new asString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
pollDraftId: aUUID
pollDraftId := aUUID
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
pollDraftId
^ pollDraftId
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
},
"instance" : {
"addQuestion:" : "CG 7/30/2021 19:06",
"asString" : "FLST 6/4/2024 15:12",
"getChoiceIdentifiersFor:" : "JT 8/2/2022 18:14",
"getChoiceNamesFor:" : "bwe 5/22/2022 20:26",
"initialize" : "kge 7/21/2022 21:52",
"initialize" : "FLST 6/4/2024 12:11",
"pollDraftId" : "FLST 6/4/2024 11:59",
"pollDraftId:" : "FLST 6/4/2024 12:00",
"questionList" : "NM 5/13/2021 14:01",
"questionList:" : "CG 7/30/2021 19:06",
"removeQuestionAt:" : "vl 5/27/2024 12:42",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"instvars" : [
"title",
"questionList",
"userSetID" ],
"userSetID",
"pollDraftId" ],
"name" : "LQPollDraft",
"pools" : [
],
Expand Down
5 changes: 0 additions & 5 deletions packages/Liquid-Network.package/.squot-contents

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
pollDraftRepo: aLQObjectRepo
PollDraftRepo := aLQObjectRepo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
pollDraftRepo
PollDraftRepo
ifNil: [self pollDraftRepo: LQLocalObjectRepo new].
^ PollDraftRepo
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"class" : {
"isServerActive" : "JT 8/2/2022 18:09",
"pollDraftRepo" : "FLST 6/4/2024 11:46",
"pollDraftRepo:" : "FLST 6/4/2024 11:46",
"pollRepo" : "ape 6/19/2022 15:11",
"pollRepo:" : "JT 8/2/2022 18:09",
"port" : "ms 8/4/2022 11:23",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"classinstvars" : [
],
"classvars" : [
"PollDraftRepo",
"PollRepo",
"Server" ],
"commentStamp" : "kge 7/16/2022 21:45",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instance creation
openWithPollDraft: aLQPollDraft
| aPollDraftBuilder |
aPollDraftBuilder := self new.
aPollDraftBuilder pollDraft: aLQPollDraft.
ToolBuilder open: aPollDraftBuilder
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
toolbuilder
addQuestionButtonFrame

^ self
frame: 0.925
fromTop: 0.85
fromLeft: 0.25
width: 0.50
width: 0.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
toolbuilder
buildSaveDraftButtonWith: aBuilder
^ aBuilder pluggableButtonSpec new model: self;
label: 'Save Draft';
help: 'Save the poll for later.';
action: #saveDraft;
frame: (LayoutFrame new topFraction: 0.92;
leftFraction: 0.33;
rightFraction: 0.66;
bottomFraction: 1;
yourself);
yourself
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
toolbuilder
buildWith: builder

buildWith: builder
| windowSpec |

windowSpec := self buildWindowWith: builder specs: {
(self questionListFrame) -> [self buildQuestionListWith: builder].
(self questionBuilderFrame) ->
[builder pluggablePanelSpec new
model: self;
layout: #vertical;
children: #buildQuestionBuilder;
yourself].
(self runPollButtonFrame) -> [self buildRunPollButtonWith: builder].
(self addQuestionButtonFrame) -> [self buildAddQuestionButtonWith: builder].
(self addManageUserSetsFrame) -> [self buildManageUserSetsButton: builder].
(self removeQuestionButtonFrame) -> [self buildRemoveQuestionButtonWith: builder].
}.
windowSpec := self buildWindowWith: builder specs: {self questionListFrame
-> [self buildQuestionListWith: builder]. self questionBuilderFrame
-> [builder pluggablePanelSpec new model: self;
layout: #vertical;
children: #buildQuestionBuilder;
yourself]. self runPollButtonFrame
-> [self buildRunPollButtonWith: builder]. self addQuestionButtonFrame
-> [self buildAddQuestionButtonWith: builder]. self addManageUserSetsFrame
-> [self buildManageUserSetsButton: builder]. self removeQuestionButtonFrame
-> [self buildRemoveQuestionButtonWith: builder].
self saveDraftButtonFrame -> [self buildSaveDraftButtonWith: builder]}.
windowSpec label: 'Liquid - Create a Poll'.
^ builder build: windowSpec


^ builder build: windowSpec
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
toolbuilder
runPollButtonFrame

^ self
frame: 1
fromTop: 0.925
fromLeft: 0.25
width: 0.75
fromLeft: 0.75
width: 0.25
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
modifying
saveDraft
LQRemotePollRepoServer pollDraftRepo items at: self pollDraft pollDraftId put: self pollDraft
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
toolbuilder
saveDraftButtonFrame
^ self
frame: 1
fromTop: 0.925
fromLeft: 0.25
width: 0.5
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"class" : {
"newWithTitle:" : "ape 7/23/2022 09:58" },
"newWithTitle:" : "ape 7/23/2022 09:58",
"openWithPollDraft:" : "FLST 6/4/2024 15:19" },
"instance" : {
"addManageUserSetsFrame" : "bn 8/2/2022 16:57",
"addQuestion" : "bn 8/2/2022 18:07",
"addQuestionBuilder:" : "kge 8/1/2022 19:03",
"addQuestionButtonFrame" : "Ingmar Vogel 5/19/2024 15:31",
"addQuestionButtonFrame" : "FLST 6/4/2024 11:40",
"buildAddQuestionButtonWith:" : "Ingmar Vogel 5/19/2024 15:28",
"buildManageUserSetsButton:" : "kge 8/1/2022 20:56",
"buildMaxNumberOfChoicesInputWith:" : "kge 8/1/2022 20:46",
"buildMaxNumberOfChoicesLabelWith:" : "kge 8/1/2022 20:46",
"buildQuestionBuilder" : "bn 8/2/2022 16:57",
"buildQuestionListWith:" : "JT 8/5/2022 18:51",
"buildRemoveQuestionButtonWith:" : "vl 5/27/2024 12:40",
"buildRunPollButtonWith:" : "kge 8/1/2022 20:56",
"buildWith:" : "Ingmar Vogel 5/19/2024 15:29",
"buildRunPollButtonWith:" : "FLST 6/4/2024 11:32",
"buildSaveDraftButtonWith:" : "FLST 6/4/2024 11:42",
"buildWith:" : "FLST 6/4/2024 11:39",
"currentQuestion" : "bn 8/2/2022 16:58",
"currentQuestion:" : "bn 6/23/2022 22:15",
"frame:fromTop:fromLeft:width:" : "bn 8/2/2022 16:58",
Expand All @@ -34,5 +36,7 @@
"removeQuestionBuilderAt:" : "vl 5/27/2024 12:39",
"removeQuestionButtonFrame" : "vl 5/27/2024 12:39",
"runPoll" : "JT 8/5/2022 18:52",
"runPollButtonFrame" : "bn 8/2/2022 16:59",
"runPollButtonFrame" : "FLST 6/4/2024 11:35",
"saveDraft" : "FLST 6/4/2024 12:09",
"saveDraftButtonFrame" : "FLST 6/4/2024 11:41",
"setIndex:" : "bn 6/23/2022 22:17" } }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
as yet unclassified
buildPollDraftListViewWith: aBuilder
^ aBuilder pluggableListSpec new model: self;
list: #pollDrafts;
getIndex: #choiceSelected;
setIndex: #choiceSelected:;
frame: (LayoutFrame new topFraction: 0.1;
bottomFraction: 0.65;
leftFraction: 0.1;
rightFraction: 0.9;
yourself);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
as yet unclassified
buildRemovePollDraftButtonWith: aBuilder
^ aBuilder pluggableButtonSpec new model: self;
label: 'Remove Draft';
action: #removeDraft;
frame: (LayoutFrame new topFraction: 0.83;
bottomFraction: 0.98;
leftFraction: 0.1;
rightFraction: 0.9;
yourself);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
as yet unclassified
buildShowPollDraftButtonWith: aBuilder
^ aBuilder pluggableButtonSpec new model: self;
label: 'Show Draft';
action: #showDraft;
frame: (LayoutFrame new topFraction: 0.67;
bottomFraction: 0.82;
leftFraction: 0.1;
rightFraction: 0.9;
yourself);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
buildWith: aBuilder
^ aBuilder build: (aBuilder pluggableWindowSpec new model: self;
label: 'Liquid - Poll Drafts';
extent: self extent;
children: {self buildPollDraftListViewWith: aBuilder. self buildShowPollDraftButtonWith: aBuilder. self buildRemovePollDraftButtonWith: aBuilder};
yourself)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
choiceSelected: anIndex
choiceSelected := anIndex. self changed: #choiceSelected
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
choiceSelected
^ choiceSelected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
as yet unclassified
initialize
super initialize.
self choiceSelected: 0;
populatePollDrafts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
pollDrafts: anOrderedCollection
pollDrafts := anOrderedCollection. self changed: #pollDrafts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
pollDrafts
^ pollDrafts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
populatePollDrafts
| draftCollection |
draftCollection := OrderedCollection new.
LQRemotePollRepoServer pollDraftRepo items
do: [:item | draftCollection add: item].
self pollDrafts: draftCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
as yet unclassified
removeDraft
| selectedDraft |
self choiceSelected isZero
ifTrue: [^ self].
selectedDraft := self pollDrafts at: self choiceSelected.
LQRemotePollRepoServer pollDraftRepo removeKey: selectedDraft pollDraftId.
self populatePollDrafts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
as yet unclassified
showDraft
| selectedDraft |
self choiceSelected isZero
ifTrue: [^ self].
selectedDraft := self pollDrafts at: self choiceSelected.
LQPollDraftBuilder openWithPollDraft: selectedDraft.
self destroy.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"class" : {
},
"instance" : {
"buildPollDraftListViewWith:" : "FLST 6/4/2024 14:53",
"buildRemovePollDraftButtonWith:" : "FLST 6/4/2024 15:22",
"buildShowPollDraftButtonWith:" : "FLST 6/4/2024 15:22",
"buildWith:" : "FLST 6/4/2024 15:23",
"choiceSelected" : "FLST 6/4/2024 14:48",
"choiceSelected:" : "FLST 6/4/2024 14:49",
"initialize" : "FLST 6/4/2024 15:04",
"pollDrafts" : "FLST 6/4/2024 15:00",
"pollDrafts:" : "FLST 6/4/2024 15:31",
"populatePollDrafts" : "FLST 6/4/2024 15:13",
"removeDraft" : "FLST 6/4/2024 15:35",
"showDraft" : "FLST 6/4/2024 15:17" } }
15 changes: 15 additions & 0 deletions packages/Liquid-UI.package/LQPollDraftMenu.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category" : "Liquid-UI",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"choiceSelected",
"pollDrafts" ],
"name" : "LQPollDraftMenu",
"pools" : [
],
"super" : "LQModel",
"type" : "normal" }

0 comments on commit 77e24b4

Please sign in to comment.