Skip to content

More HotWired improvements #1454

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
@@ -1,5 +1,4 @@
*Seaside-HotwireTurbo-Core
turboShow: aComponent

aComponent addDecoration: (WATurboFrame newWithId: self turboframeDecoration id).
^ self show: aComponent
^ self turboShow: aComponent onAnswer: [ :value | ]

Check warning on line 4 in repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow..st#L4

Added line #L4 was not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Seaside-HotwireTurbo-Core
turboShow: aComponent onAnswer: aBlock

aComponent addDecoration: (WATurboFrame newWithId: self turboframeDecoration id).
^ self show: aComponent onAnswer: aBlock

Check warning on line 5 in repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow.onAnswer..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow.onAnswer..st#L1-L5

Added lines #L1 - L5 were not covered by tests
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
initialization
initializeTests

Check warning on line 3 in repository/Seaside-Tests-HotwireTurbo.package/WAAllHotwiredFunctionalTests.class/instance/initializeTests.st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAAllHotwiredFunctionalTests.class/instance/initializeTests.st#L3

Added line #L3 was not covered by tests
classes := WAHotwiredFunctionalTest allSubclasses asSortedCollection: [ :a :b | a name < b name ].
current := WAValueHolder with: classes first new

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialization
initialize

super initialize.
counter := 0

Check warning on line 5 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/initialize.st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/initialize.st#L1-L5

Added lines #L1 - L5 were not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rendering
renderContentOn: html

html heading
level: 1;
with: counter.
html anchor
callback: [ self turboShow: (WAHotwireTurboEditableCounterTestComponent newWith: counter) onAnswer: [ :value | counter := value ] ];
with: 'Edit'

Check warning on line 9 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/renderContentOn..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/renderContentOn..st#L1-L9

Added lines #L1 - L9 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAHotwireTurboTestComponent",
"instvars" : [
"counter"
],
"name" : "WAHotwireTurboCounterTestComponent",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance creation
newWith: aNumber

^ self new counter: aNumber

Check warning on line 4 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/class/newWith..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/class/newWith..st#L1-L4

Added lines #L1 - L4 were not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialization
counter: aNumber

count := aNumber

Check warning on line 4 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/counter..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/counter..st#L1-L4

Added lines #L1 - L4 were not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rendering
renderContentOn: html

html heading
level: 1;
with: count.
html anchor
callback: [ count := count + 1 ];
with: '++'.
html space.
html anchor
callback: [ count := count - 1 ];
with: '--'.
html space.
html anchor
callback: [ self answer: count ];
with: 'Close'

Check warning on line 17 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/renderContentOn..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/renderContentOn..st#L1-L17

Added lines #L1 - L17 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"instvars" : [
"count"
],
"name" : "WAHotwireTurboCalledTestComponent",
"name" : "WAHotwireTurboEditableCounterTestComponent",
"type" : "normal"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
initialize

super initialize.
comp1 := WAHotwireTurboTestComponent new addDecoration: WATurboFrame new; yourself.
comp2 := WAHotwireTurboTestComponent new addDecoration: WATurboFrame new; yourself.
comp1 := WAHotwireTurboCounterTestComponent new addDecoration: WATurboFrame new; yourself.
comp2 := WAHotwireTurboCounterTestComponent new addDecoration: WATurboFrame new; yourself.

Check warning on line 6 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/initialize.st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/initialize.st#L5-L6

Added lines #L5 - L6 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
html paragraph: 'Both counters are wrapped as turbo frames. Clicking on an action (++ or --) in either one of the counters should only update the counter itself. The rest of the page should not have been updated.'.

html render: comp1.
"html render: comp2"
html render: comp2

Check warning on line 9 in repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/renderContentOn..st

View check run for this annotation

Codecov / codecov/patch

repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/renderContentOn..st#L9

Added line #L9 was not covered by tests

This file was deleted.

Loading