-
Notifications
You must be signed in to change notification settings - Fork 60
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
Feature: Adds new method to extensionRegistry for appendCondition & appendConditions #2233
Feature: Adds new method to extensionRegistry for appendCondition & appendConditions #2233
Conversation
Thanks for re-running the tests for me @madsrasmussen |
… condition loads first, as order of conditions are important
…y wait until the manifest is registered so late extensions will work as well Seems to work with my hack in an entrypoint and the console logs the extension with the updated condition but its the tests I am struggling to get to work. As this code is heavily worked from me trying to Google, read RXJS docs and talking with Copilot I am not fully in confident in this approach
Hiya @nielslyngsoe Adds This seems to work with my hack in an entrypoint file to hack with and the console logs the extension with the updated condition/s but its the tests I am struggling to get to work. Warning As this code is heavily worked from me trying to Google, read RXJS docs and talking with Copilot I am not fully in confident in this approach so please be gentle with me 🙈 |
…red to get the ext alias that matches
… but test says otherwise compared to using it in entrypoint
Needing to take a break from this test that is failing to demonstrate late loaded extension. Could do with some cleverer people than me from HQ to give me some input/thoughts
|
Hi @warrenbuckley you should not be needing to prepend or append. It will give the same result. Currently the system spins up all conditions, the order means nothing. :-) |
@nielslyngsoe I thought order would be important with last in winning surely?
For me I would have thought that the last one setting permitted to false I accept the extension to be loaded so it overrides the previous ones before it. Or with this way it would prevent the extension as last one is false
or perhaps this I would expect condition C to then make the extension appear
So can you confirm how it works please @nielslyngsoe Then happy to amend this PR once I fully grasp how conditions work. Warning Niels now confirmed that ALL must pass for it to be loaded in as an extension so the order is not important so the prepend stuff is not needed. If any one condition returns false then it won't load
|
@warrenbuckley It works in the way that all the listed conditions has to be valid for the extension to be shown. Therefore the order doesn't matter. :-) |
…ddCondtions As the order of conditions is not important, as all conditions set on an extensions must be true/valid
Still need to uncomment & reinvestigate the late loading test
I have refactored your code and written a few extra tests. I'm happy with the solution now. Notice I went away for the Async approach as it turned out that appended conditions, would be appended late, like two JS cycles, from when a extension manifest got registered. In other words, a late coming manifest, would be broadcasted and utilized by all subscribers, for then 2 cycles later to get the additional conditions appended. This was a unnecessary round trip, so I refactored so the additional conditions get appended before the manifest goes into the Extension Registry. I will wait for the v15/dev branch to get up to date with v.14 before we merge. As you can see there is too many changes as part of this PR right now. |
Quality Gate passedIssues Measures |
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.
I'm happy now :-)
WHOOP WHOOP 🎉 |
Just so I am clear, this is for V15 only @nielslyngsoe ? |
Description
Adds two new methods to extensionRegistry to allow developers to append new conditions to an existing extension.
Types of changes
Motivation and context
Its not possible to update an extension such as Workspace Entity Action with a new condition. The current approach requires you to overwrite the extension. Which involves setting the same manifest meta properties and reimplementing an API to perform the same action as the core implementation of the button.
Scenario:
I want to show/hide the Save and Publish button based on a new condition and keep the existing functionality of the button without overhead of trying to overwrite the extension and keeping it in sync with the core implemetation.
How to test?
Usage
Checklist