From 9b9ddfe7541304a0ca168c5ab9cfcc14e8d17286 Mon Sep 17 00:00:00 2001 From: Maximiliano Tabacman Date: Fri, 22 Jan 2021 16:48:05 -0300 Subject: [PATCH 1/2] Added deprecation methods for removed classes and messages. --- .../DropDownListWebView.class.st | 26 ++++++++ .../SingleSelectionListBoxWebView.class.st | 63 +++++++++++++++++++ ...SingleSelectionListBoxWebView.extension.st | 10 --- ...st => SingleSelectionWebView.extension.st} | 4 +- 4 files changed, 91 insertions(+), 12 deletions(-) create mode 100644 source/Willow-Core-MigrationTo14/DropDownListWebView.class.st create mode 100644 source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.class.st delete mode 100644 source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.extension.st rename source/Willow-Core-MigrationTo14/{DropDownListWebView.extension.st => SingleSelectionWebView.extension.st} (67%) diff --git a/source/Willow-Core-MigrationTo14/DropDownListWebView.class.st b/source/Willow-Core-MigrationTo14/DropDownListWebView.class.st new file mode 100644 index 00000000..5bdc122d --- /dev/null +++ b/source/Willow-Core-MigrationTo14/DropDownListWebView.class.st @@ -0,0 +1,26 @@ +Class { + #name : #DropDownListWebView, + #superclass : #Object, + #category : #'Willow-Core-MigrationTo14' +} + +{ #category : #'instance creation' } +DropDownListWebView class >> applying: aComponentCommand [ + + self + deprecated: + 'Use componentSupplier dropdownListApplying: if available, otherwise create a SingleSelectionWebView using the same implementation' + transformWith: + '`@receiver applying: `@aComponentCommand' + -> 'self componentSupplier dropdownListApplying: `@aComponentCommand' + when: [ thisContext activeHome notNil + and: [ thisContext activeHome sender receiver respondsTo: #componentSupplier ] + ]; + deprecated: + 'Use componentSupplier dropdownListApplying: if available, otherwise create a SingleSelectionWebView using the same implementation' + transformWith: + '`@receiver applying: `@aComponentCommand' + -> 'SingleSelectionWebView dropDownListApplying: `@aComponentCommand applyingToOptions: [ ]'. + + ^ SingleSelectionWebView dropDownListApplying: aComponentCommand applyingToOptions: [ ] +] diff --git a/source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.class.st b/source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.class.st new file mode 100644 index 00000000..aaf53eb8 --- /dev/null +++ b/source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.class.st @@ -0,0 +1,63 @@ +Class { + #name : #SingleSelectionListBoxWebView, + #superclass : #Object, + #category : #'Willow-Core-MigrationTo14' +} + +{ #category : #'instance creation' } +SingleSelectionListBoxWebView class >> displayingAtOnce: aNumberOfElements [ + + self + deprecated: + 'Use componentSupplier singleSelectionListBoxDisplayingAtOnce:applying: if available, otherwise create a SingleSelectionWebView using the same implementation' + transformWith: + '`@receiver displayingAtOnce: `@aNumberOfElements' + -> + 'self componentSupplier singleSelectionListBoxDisplayingAtOnce: `@aNumberOfElements applying: [ ]' + when: [ thisContext activeHome notNil + and: [ thisContext activeHome sender receiver respondsTo: #componentSupplier ] + ]; + deprecated: + 'Use componentSupplier singleSelectionListBoxDisplayingAtOnce:applying: if available, otherwise create a SingleSelectionWebView using the same implementation' + transformWith: + '`@receiver displayingAtOnce: `@aNumberOfElements' + -> + 'SingleSelectionWebView + listBoxDisplayingAtOnce: `@aNumberOfElements + applying: [ ] + applyingToOptions: [ ]'. + + ^ SingleSelectionWebView + listBoxDisplayingAtOnce: aNumberOfElements + applying: [ ] + applyingToOptions: [ ] +] + +{ #category : #'instance creation' } +SingleSelectionListBoxWebView class >> displayingAtOnce: aNumberOfElements applying: aComponentCommand [ + + self + deprecated: + 'Use componentSupplier singleSelectionListBoxDisplayingAtOnce:applying: if available, otherwise create a SingleSelectionWebView using the same implementation' + transformWith: + '`@receiver displayingAtOnce: `@aNumberOfElements applying: `@aComponentCommand' + -> + 'self componentSupplier singleSelectionListBoxDisplayingAtOnce: `@aNumberOfElements applying: `@aComponentCommand' + when: [ thisContext activeHome notNil + and: [ thisContext activeHome sender receiver respondsTo: #componentSupplier ] + ]; + deprecated: + 'Use componentSupplier singleSelectionListBoxDisplayingAtOnce:applying: if available, otherwise create a SingleSelectionWebView using the same implementation' + transformWith: + '`@receiver displayingAtOnce: `@aNumberOfElements applying: `@aComponentCommand' + -> + 'SingleSelectionWebView + listBoxDisplayingAtOnce: `@aNumberOfElements + applying: `@aComponentCommand + applyingToOptions: [ ]'. + + ^ SingleSelectionWebView + listBoxDisplayingAtOnce: aNumberOfElements + applying: aComponentCommand + applyingToOptions: [ ] +] diff --git a/source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.extension.st b/source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.extension.st deleted file mode 100644 index 57fee572..00000000 --- a/source/Willow-Core-MigrationTo14/SingleSelectionListBoxWebView.extension.st +++ /dev/null @@ -1,10 +0,0 @@ -Extension { #name : #SingleSelectionListBoxWebView } - -{ #category : #'*Willow-Core-MigrationTo14' } -SingleSelectionListBoxWebView >> onTrigger [ - - self - deprecated: 'Use #on instead.' - transformWith: '`@receiver onTrigger' -> '`@receiver on trigger'. - ^ self on trigger -] diff --git a/source/Willow-Core-MigrationTo14/DropDownListWebView.extension.st b/source/Willow-Core-MigrationTo14/SingleSelectionWebView.extension.st similarity index 67% rename from source/Willow-Core-MigrationTo14/DropDownListWebView.extension.st rename to source/Willow-Core-MigrationTo14/SingleSelectionWebView.extension.st index 4fc52982..5d0f4532 100644 --- a/source/Willow-Core-MigrationTo14/DropDownListWebView.extension.st +++ b/source/Willow-Core-MigrationTo14/SingleSelectionWebView.extension.st @@ -1,7 +1,7 @@ -Extension { #name : #DropDownListWebView } +Extension { #name : #SingleSelectionWebView } { #category : #'*Willow-Core-MigrationTo14' } -DropDownListWebView >> onTrigger [ +SingleSelectionWebView >> onTrigger [ self deprecated: 'Use #on instead.' From c2b0bc4dbd086532831972eb9a64005c3e9aff0f Mon Sep 17 00:00:00 2001 From: Maximiliano Tabacman Date: Fri, 22 Jan 2021 16:55:27 -0300 Subject: [PATCH 2/2] Completed migration guide with changes to single selection web views. --- docs/Components.md | 4 ++-- docs/Migration-Guide.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Components.md b/docs/Components.md index 3769b427..72d57e35 100644 --- a/docs/Components.md +++ b/docs/Components.md @@ -78,8 +78,8 @@ There's a variety of single selection components to choose. All of them support - `notifyChangesTo:` can be used to subscribe for receiving a notification when the selection changes The component supplier supports several single selection components: -- `dropdownListApplying:` will provide a dropdown list -- `singleSelectionListBoxDisplayingAtOnce:applying:` will provide a list box +- `dropdownListApplying:` and - `dropdownListApplying:applyingToOptions:` provide a dropdown list +- `singleSelectionListBoxDisplayingAtOnce:applying:` and `singleSelectionListBoxDisplayingAtOnce:applying:applyingToOptions: provide a list box - `radioRenderingWith:applyingToLabel:applyingToInput:` will provide a group of radio boxes ### Multiple Selection diff --git a/docs/Migration-Guide.md b/docs/Migration-Guide.md index ed23d581..d1c725b9 100644 --- a/docs/Migration-Guide.md +++ b/docs/Migration-Guide.md @@ -41,6 +41,8 @@ To reflect this, `PhrasingContainerWebView`, `GenericContainerWebView` and `IdentifiedWebView` have all been replaced by `ContainerWebView`. The deprecated classes are now located in the migration package `Willow-Core-MigrationTo14` and all their instance creation method now include a transformation rule. If the senders has access to a component supplier, "divs" can be created by sending `divisionContainerWrapping:applying:` and "spans" by sending `inlineContainerWrapping:applying:`. For all other scenarios, a `ContainerWebView` can specify the code to create the container element in the second argument of `wrapping:intoElementBuiltUsing:applying:`. The old requirement of using an `IdentifiedWebView` to allow re-rendering applies now to `ContainerWebView`, except this new class will only specify an id when its interaction is configured before it is rendered for the first time. Checks have been implemented to detect cases where the developer might need to send `beIdentifiable`in order to ensure an id is created for the container element. +`DropDownListWebView` and `SingleSelectionListBoxWebView` have been replaced by `SingleSelectionWebView`. The deprecated classes are now located in the migration package `Willow-Core-MigrationTo14` and all their instance creation method now include a transformation rule. If the senders has access to a component supplier, drop downs can be created by sending `dropdownListApplying:` and list boxes by sending `listBoxDisplayingAtOnce:applying:`. Otherwise they can be created by sending the corresponding instance creation method in `SingleSelectionWebView`. + ## Version 10 to 11 `executeOnClient:` no longer receives the script and now the block result it's automatically attached to it. So you have to: