From fa44e5f70faad69d36170ad61f1b3771324224b4 Mon Sep 17 00:00:00 2001 From: Florian Strehl Date: Fri, 12 Jul 2024 09:24:16 +0200 Subject: [PATCH] Fixed some linting --- .../LQPollDraft.class/instance/isValid.st | 4 ++-- .../LQPollDraft.class/methodProperties.json | 2 +- .../instance/testNewWithPollDraft.st | 6 +++--- .../LQSavePollDraftsTest.class/methodProperties.json | 2 +- .../LQPollDraftBuilder.class/class/newWithPollDraft..st | 7 ++++--- .../LQPollDraftBuilder.class/instance/host..st | 4 ---- .../LQPollDraftBuilder.class/instance/host.st | 4 ---- .../LQPollDraftBuilder.class/instance/removeQuestion.st | 2 +- .../LQPollDraftBuilder.class/methodProperties.json | 6 ++---- .../LQPollDraftMenu.class/instance/populatePollDrafts.st | 3 +-- .../LQPollDraftMenu.class/methodProperties.json | 2 +- .../instance/isEveryChoiceRanked.st | 2 +- .../LQSelectionAnswerPanel.class/methodProperties.json | 2 +- 13 files changed, 18 insertions(+), 28 deletions(-) delete mode 100644 packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host..st delete mode 100644 packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host.st diff --git a/packages/Liquid-Core.package/LQPollDraft.class/instance/isValid.st b/packages/Liquid-Core.package/LQPollDraft.class/instance/isValid.st index cf7eaf87..3efd3c9a 100644 --- a/packages/Liquid-Core.package/LQPollDraft.class/instance/isValid.st +++ b/packages/Liquid-Core.package/LQPollDraft.class/instance/isValid.st @@ -1,6 +1,6 @@ accessing isValid - self questionList notEmpty ifFalse: [^ false]. - self questionList do: [:question | (question title isEmptyOrNil not and: [question choiceList notEmpty or: [question isFreeTextQuestion]]) ifFalse: [^ false]]. + self questionList ifEmpty: [^ false]. + (self questionList contains: [:question | (question title isEmptyOrNil not and: [question choiceList notEmpty or: [question isFreeTextQuestion]]) not]) ifTrue: [^ false]. ^ true \ No newline at end of file diff --git a/packages/Liquid-Core.package/LQPollDraft.class/methodProperties.json b/packages/Liquid-Core.package/LQPollDraft.class/methodProperties.json index 9e664014..94924018 100644 --- a/packages/Liquid-Core.package/LQPollDraft.class/methodProperties.json +++ b/packages/Liquid-Core.package/LQPollDraft.class/methodProperties.json @@ -7,7 +7,7 @@ "getChoiceIdentifiersFor:" : "FLST 7/11/2024 20:42", "getChoiceNamesFor:" : "bwe 5/22/2022 20:26", "initialize" : "FLST 7/11/2024 20:42", - "isValid" : "FLST 7/11/2024 20:42", + "isValid" : "FLST 7/12/2024 09:23", "pollDraftId" : "FLST 7/11/2024 20:42", "pollDraftId:" : "FLST 7/11/2024 20:42", "questionList" : "NM 5/13/2021 14:01", diff --git a/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/instance/testNewWithPollDraft.st b/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/instance/testNewWithPollDraft.st index 56793b13..2728434f 100644 --- a/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/instance/testNewWithPollDraft.st +++ b/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/instance/testNewWithPollDraft.st @@ -3,6 +3,6 @@ testNewWithPollDraft | pollDraftBuilder | pollDraftBuilder := LQPollDraftBuilder newWithPollDraft: self pollDraft. self assert: pollDraftBuilder questionBuilders size equals: 3. - self assert: (pollDraftBuilder questionBuilders at: 1) class equals: LQMultiChoiceQuestionBuilder. - self assert: (pollDraftBuilder questionBuilders at: 2) class equals: LQPriorityQuestionBuilder. - self assert: (pollDraftBuilder questionBuilders at: 3) class equals: LQFreeTextQuestionBuilder. \ No newline at end of file + self assert: (pollDraftBuilder questionBuilders first) class equals: LQMultiChoiceQuestionBuilder. + self assert: (pollDraftBuilder questionBuilders second) class equals: LQPriorityQuestionBuilder. + self assert: (pollDraftBuilder questionBuilders third) class equals: LQFreeTextQuestionBuilder. \ No newline at end of file diff --git a/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/methodProperties.json b/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/methodProperties.json index 88bc2ffa..9599bce1 100644 --- a/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/methodProperties.json +++ b/packages/Liquid-Tests.package/LQSavePollDraftsTest.class/methodProperties.json @@ -7,6 +7,6 @@ "pollDraft:" : "vl 6/6/2024 20:06", "setUp" : "vl 6/6/2024 20:02", "tearDown" : "vl 6/6/2024 20:20", - "testNewWithPollDraft" : "vl 7/10/2024 13:33", + "testNewWithPollDraft" : "FLST 7/12/2024 09:19", "testRemovePollDrafts" : "vl 6/6/2024 20:20", "testSavePollDrafts" : "vl 6/7/2024 14:27" } } diff --git a/packages/Liquid-UI.package/LQPollDraftBuilder.class/class/newWithPollDraft..st b/packages/Liquid-UI.package/LQPollDraftBuilder.class/class/newWithPollDraft..st index 1e90ab95..3e6a6b95 100644 --- a/packages/Liquid-UI.package/LQPollDraftBuilder.class/class/newWithPollDraft..st +++ b/packages/Liquid-UI.package/LQPollDraftBuilder.class/class/newWithPollDraft..st @@ -1,14 +1,15 @@ instance creation newWithPollDraft: aLQPollDraft - | aPollDraftBuilder | + | aPollDraftBuilder questionBuilders | aPollDraftBuilder := self new. aPollDraftBuilder pollDraft: aLQPollDraft. aPollDraftBuilder questionBuilders removeAll. - aLQPollDraft questionList do: [:currentQuestion | | questionBuilder | + questionBuilders := aLQPollDraft questionList collect: [:currentQuestion | | questionBuilder | currentQuestion isMultiChoiceQuestion ifTrue: [questionBuilder := LQMultiChoiceQuestionBuilder new]. currentQuestion isPriorityQuestion ifTrue: [questionBuilder := LQPriorityQuestionBuilder new]. currentQuestion isFreeTextQuestion ifTrue: [questionBuilder := LQFreeTextQuestionBuilder new]. questionBuilder question: currentQuestion. - aPollDraftBuilder questionBuilders add: questionBuilder]. + questionBuilder]. + aPollDraftBuilder questionBuilders addAll: questionBuilders. ^ aPollDraftBuilder \ No newline at end of file diff --git a/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host..st b/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host..st deleted file mode 100644 index 0827711f..00000000 --- a/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -host: anObject - - host := anObject \ No newline at end of file diff --git a/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host.st b/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host.st deleted file mode 100644 index 04d48494..00000000 --- a/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/host.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -host - - ^ host \ No newline at end of file diff --git a/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/removeQuestion.st b/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/removeQuestion.st index 23b3e337..0544d4cb 100644 --- a/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/removeQuestion.st +++ b/packages/Liquid-UI.package/LQPollDraftBuilder.class/instance/removeQuestion.st @@ -1,7 +1,7 @@ modifying removeQuestion - self questionBuilders size > 0 ifTrue: [ + self questionBuilders ifNotEmpty: [ self pollDraft removeQuestionAt: self getIndex. self removeQuestionBuilderAt: self getIndex. self setIndex: self questionBuilders size. diff --git a/packages/Liquid-UI.package/LQPollDraftBuilder.class/methodProperties.json b/packages/Liquid-UI.package/LQPollDraftBuilder.class/methodProperties.json index 890067e8..1be6d176 100644 --- a/packages/Liquid-UI.package/LQPollDraftBuilder.class/methodProperties.json +++ b/packages/Liquid-UI.package/LQPollDraftBuilder.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newWithPollDraft:" : "FLST 7/11/2024 20:44", + "newWithPollDraft:" : "FLST 7/12/2024 09:23", "newWithTitle:" : "ape 7/23/2022 09:58", "newWithTitle:and:" : "Ingmar Vogel 6/7/2024 11:53" }, "instance" : { @@ -29,8 +29,6 @@ "frame:fromTop:fromLeft:width:" : "FLST 7/11/2024 20:44", "generateRandomID" : "FLST 7/11/2024 20:44", "getIndex" : "bn 8/2/2022 16:58", - "host" : "FLST 7/11/2024 20:44", - "host:" : "FLST 7/11/2024 20:44", "initialize" : "FLST 7/11/2024 20:44", "list" : "bn 8/2/2022 16:58", "openManageUserSetsMenu" : "bn 8/2/2022 18:08", @@ -41,7 +39,7 @@ "questionBuilders" : "FLST 7/11/2024 20:44", "questionBuilders:" : "FLST 7/11/2024 20:44", "questionListFrame" : "FLST 7/11/2024 20:44", - "removeQuestion" : "FLST 7/11/2024 20:44", + "removeQuestion" : "FLST 7/12/2024 08:46", "removeQuestionBuilderAt:" : "FLST 7/11/2024 20:44", "removeQuestionButtonFrame" : "FLST 7/11/2024 20:44", "runPoll" : "FLST 7/11/2024 20:44", diff --git a/packages/Liquid-UI.package/LQPollDraftMenu.class/instance/populatePollDrafts.st b/packages/Liquid-UI.package/LQPollDraftMenu.class/instance/populatePollDrafts.st index 5059cbb3..93f7bc75 100644 --- a/packages/Liquid-UI.package/LQPollDraftMenu.class/instance/populatePollDrafts.st +++ b/packages/Liquid-UI.package/LQPollDraftMenu.class/instance/populatePollDrafts.st @@ -2,6 +2,5 @@ modifying populatePollDrafts | draftCollection | - draftCollection := OrderedCollection new. - LQRemotePollRepoServer pollDraftRepo items do: [:item | draftCollection add: item]. + draftCollection := LQRemotePollRepoServer pollDraftRepo items collect: [:item | item]. self pollDrafts: draftCollection \ No newline at end of file diff --git a/packages/Liquid-UI.package/LQPollDraftMenu.class/methodProperties.json b/packages/Liquid-UI.package/LQPollDraftMenu.class/methodProperties.json index 2457b85d..3bffc238 100644 --- a/packages/Liquid-UI.package/LQPollDraftMenu.class/methodProperties.json +++ b/packages/Liquid-UI.package/LQPollDraftMenu.class/methodProperties.json @@ -11,6 +11,6 @@ "initialize" : "FLST 7/11/2024 20:44", "pollDrafts" : "FLST 7/11/2024 20:44", "pollDrafts:" : "FLST 7/11/2024 20:44", - "populatePollDrafts" : "FLST 7/11/2024 20:44", + "populatePollDrafts" : "FLST 7/12/2024 09:23", "removeDraft" : "FLST 7/11/2024 20:44", "showDraft" : "FLST 7/11/2024 20:44" } } diff --git a/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/instance/isEveryChoiceRanked.st b/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/instance/isEveryChoiceRanked.st index c06c9b1e..0515dd39 100644 --- a/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/instance/isEveryChoiceRanked.st +++ b/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/instance/isEveryChoiceRanked.st @@ -1,4 +1,4 @@ validation isEveryChoiceRanked - ^ self question isPriorityQuestion ==> (self selectedChoices size = self question maxNumberOfChoices) + ^ self question isPriorityQuestion ==> (self selectedChoices size = self question maxNumberOfChoices) \ No newline at end of file diff --git a/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/methodProperties.json b/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/methodProperties.json index 6c4f7521..44c19c9a 100644 --- a/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/methodProperties.json +++ b/packages/Liquid-UI.package/LQSelectionAnswerPanel.class/methodProperties.json @@ -21,7 +21,7 @@ "getRankingIndices" : "FLST 7/11/2024 20:44", "getRemainingVotedChoices" : "Anton Eichstädt 6/4/2024 11:59", "initialize" : "FLST 7/11/2024 20:44", - "isEveryChoiceRanked" : "FLST 7/11/2024 20:44", + "isEveryChoiceRanked" : "FLST 7/12/2024 09:23", "isValidSelection:ForChoiceAt:" : "Anton Eichstädt 5/25/2024 14:21", "isValidSizedSelection:" : "FLST 7/11/2024 20:44", "question:" : "FLST 7/11/2024 20:44",