-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Update provides
in the registry accept an array of strings
#2930
Conversation
…and warn if package still has legacy provides
@reactioncommerce/core any idea why |
Ah, nevermind... that's the "custom rates", not "discount-codes"... and I did that.. because we don't yet have "custom rates".... (which is pricing by "tag",etc.) |
Are we expecting that there are still some packages running deprecated (warnings working great!).:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when I searched for provides: "
I didn't find any instances that had not yet been converted to using the array format, but still received warnings indicated this was in use, on a fresh installation, no existing data.
@aaronjudd interesting - do you have any packages in your |
I think this may have be an issue where the warning is triggering on any registry entry that does not have a |
@aaronjudd Good catch on that review, looks like I was catching instances where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reaction reset
in marketplace- login as admin
- view orders panel
- stop the initial running instance
- switch to this branch
Server console warns
5:57:45.435Z WARN Reaction: Plugin reaction-accounts is using a deprecated version of the provides property for the accounts registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.436Z WARN Reaction: Plugin reaction-accounts is using a deprecated version of the provides property for the /dashboard/account/settings registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.436Z WARN Reaction: Plugin reaction-accounts is using a deprecated version of the provides property for the dashboard/accounts registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.436Z WARN Reaction: Plugin reaction-accounts is using a deprecated version of the provides property for the account/profile registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.491Z WARN Reaction: Plugin reaction-catalog is using a deprecated version of the provides property for the undefined registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.491Z WARN Reaction: Plugin reaction-catalog is using a deprecated version of the provides property for the catalog/settings registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.587Z WARN Reaction: Plugin reaction-connectors is using a deprecated version of the provides property for the connectors registry entry. Since v1.5.0 registry provides accepts an array of strings.
15:57:45.587Z WARN Reaction: Plugin reaction-connectors is using a deprecated version of the provides property for the settings/connectors registry entry. Since v1.5.0 registry provides accepts an array of strings.
15
.....
- Login in again as admin,
- view orders (or accounts)
- stop reaction
- run again
- warnings cleared, registry updated
The registry warnings being gone on restart is what I expected, but because the warning in that case will not appear again, should the messaging reflect this?
However, there appears to a bug in the UI logic for the admin panel that was probably tied to checking the "provides" type.. (see screenshots)..
Interesting thought on the warnings being a one-time thing. They are only triggered when we find a registry entry with a string value for I see the error on the UI, and that does seem like it could be triggered by a |
Currently there aren't any permissions that use the `provides` as a label, but this be pretty if it gets used and has multiple provides values
Guards inclusion checks for provides being undefined
@aaronjudd I've updated the warning message to include
I've also identified and fixed the issue that was causing the dashboard panel to render in the small view. There are a few other spots in our code that were checking for Array.prototype.includes has the side-affect of checking for string inclusion as well as array inclusion. I think in this case this is a positive thing, though there are instances where it could be detrimental.
the downside here would be any cases where something like this could occur:
We don't currently have any instances where this would be possible and since we're forcibly moving to arrays, I think it's okay, but we could do an equality check on string types, and use |
This PR resolves #2897 by enabling the use of multiple
provides
values in an array, making registry entries such asprovides: ["paymentSettings", "marketplacePaymentSettings"]
valid.Going forward we will use a method based on this to determine if a given plugin is for ready for marketplace. This PR does not contain any functionality to identify marketplace ready packages itself, but it does provide the structure for that.
It does not accept both a String and an Array as was suggested in the issue. That would have required using a
blackbox
type in Simple Schema which felt like the wrong direction. Instead a migration is provided which will upgrade any packages that currently exist on the system from using (using "dashboard" for example)provides: "dashboard"
toprovides: ["dashboard"]
.The update to Reaction Apps which filters packages to determine if a given plugin registry entry is a match has been updated to check against the simple schema type of a registry property. If the schema property type and the existing registry property are both
array
s then we will check to see if the filter matches an element in the array rather than checking to see if there is an exact match.This maintains backwards compatibility to any package that manages to avoid getting upgraded.