Skip to content

Commit

Permalink
Fixes #217
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed Sep 10, 2023
1 parent df238f4 commit 925fecc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,27 @@ CombinedWebInteractionInterpreterTest >> testSetValueToWithoutTriggeringChangeOf
'<input id="15" type="text"/><button id="button-id2" type="button">Ok</button><button id="button-id4" type="button">Cancel</button><script type="text/javascript">$("#button-id2").click(function(event){Willow.callServer({"url":"/","data":"1"})});$("#button-id4").click(function(event){Willow.callServer({"url":"/","data":"3"})});</script>'
]

{ #category : #'tests - Configuring' }
CombinedWebInteractionInterpreterTest >> testShowLoadingNotificationDisplayingApplying [

| interpreter html |

interpreter := self combinedInterpreter.

interpreter
showLoadingNotificationDisplaying: 'Loading...'
applying: [ :view | view addClass willow ].
html := self renderUsing: [ :canvas |
canvas
render: okButton;
render: cancelButton
].
self
assert: html
equals:
'<button id="button-id2" type="button">Ok</button><button id="button-id4" type="button">Cancel</button><script type="text/javascript">$("#button-id2").click(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});$("#button-id4").click(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"3"})});</script>'
]

{ #category : #'tests - Configuring - DOM' }
CombinedWebInteractionInterpreterTest >> testShowLoadingNotificationStyledAsAll [

Expand Down
7 changes: 7 additions & 0 deletions source/Willow-Core/CombinedWebInteractionInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ CombinedWebInteractionInterpreter >> setValueTo: aValueProvider withoutTriggerin
interpretersDo: [ :interpreter | interpreter setValueTo: aValueProvider withoutTriggeringChangeOf: aView ]
]

{ #category : #Configuring }
CombinedWebInteractionInterpreter >> showLoadingNotificationDisplaying: aWebView applying: aComponentCommand [

self interpretersDo: [ :interpreter |
interpreter showLoadingNotificationDisplaying: aWebView applying: aComponentCommand ]
]

{ #category : #Configuring }
CombinedWebInteractionInterpreter >> showLoadingNotificationStyledAsAll: classes [

Expand Down
2 changes: 1 addition & 1 deletion source/Willow-Core/WebInteractionInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ WebInteractionInterpreter >> setValueTo: aValueProvider withoutTriggeringChangeO
WebInteractionInterpreter >> showLoadingNotificationDisplaying: aWebView applying: aComponentCommand [

interaction onTriggerExecute:
(LoadingNotificationCommand displaying: aWebView applying: aComponentCommand)
( LoadingNotificationCommand displaying: aWebView applying: aComponentCommand )
]

{ #category : #Configuring }
Expand Down
6 changes: 6 additions & 0 deletions source/Willow-Core/WebInteractionInterpreterBehavior.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ WebInteractionInterpreterBehavior >> show: aRenderable whileCallingServerToRende
render: anIdentifiedWebView
]

{ #category : #Configuring }
WebInteractionInterpreterBehavior >> showLoadingNotificationDisplaying: aWebView applying: aComponentCommand [

self subclassResponsibility
]

{ #category : #Configuring }
WebInteractionInterpreterBehavior >> showLoadingNotificationStyledAsAll: classes [

Expand Down

0 comments on commit 925fecc

Please sign in to comment.