Conversation
b863784 to
2f4eca1
Compare
## What Add link limit as URL parameter functionality to the visual graph. ## Why This way a link can be bookmarked or sent to someone, and it will open the same number of nodes. ## How - Moved the link limit input field from the settings to the main page. This is needed as sometimes the settings are not accessible due to rights. - Updated the controller to manage the link limit state and validate user input. - Implemented URL parameter handling to persist the link limit across sessions. - Updated plugins version, since the plugins needed to be updated due to this change ## Testing cypress
2f4eca1 to
325f808
Compare
|
Is Donka OK with the way this error is displayed? As well as the message? As it is now it doesn't look OK to me. |
| }); | ||
|
|
||
| it('Test remove child node', () => { | ||
| it.only('Test remove child node', () => { |
| // Verify that before given node is removed there are 4 of them | ||
| VisualGraphSteps.getNodes().and('have.length', 4); | ||
| // Click once on node different than parent one with the mouse | ||
| // eslint-disable-next-line cypress/no-unnecessary-waiting |
There was a problem hiding this comment.
remove this comment as it's not needed here
There was a problem hiding this comment.
it is. There is a chained wait, in the command, which is explained in the next comment.
| linksLimit = 1; | ||
| } | ||
| if (linksLimit > 1000) { | ||
| linksLimit = 1000; |
There was a problem hiding this comment.
Can you also extract this as a constant somewhere please
| ng-model="linksLimit" | ||
| min="0" max="1000" class="ng-pristine ng-valid ng-valid-number" | ||
| ng-change="updateLinksLimit()"> | ||
| <button type="button" class="btn btn-link px-0" ng-disabled="linksLimit > 999" |
There was a problem hiding this comment.
These bindings are not OK this way. Create a model containing the linksLimit and disabled properties, as well as min and max. Then calculate the disabled property in the model and bind to it instead of these linksLimit > 999 and linksLimit < 1, etc.
| <i class="ri-add-circle-line"></i> | ||
| </button> | ||
| </div> | ||
| <span style="margin-top: 5px" ng-if="invalidLimit" |
There was a problem hiding this comment.
Either use an utility class like mt-1 or style this in the stylesheet.
| </div> | ||
|
|
||
| <div class="toolbar-holder" ng-show="configLoaded && isLicenseValid() && getActiveRepository() && 'SYSTEM' !== getActiveRepository()"> | ||
| <label for="links-limit-input" gdb-tooltip="{{'sidepanel.limit.links.tooltip' | translate}}">{{'sidepanel.maximum.links' | |
There was a problem hiding this comment.
I'd have implemented this entire thing as a component (directive in this case). Leave it as is for now.
| translate}}</label> | ||
| <div class="link-limit-wrapper"> | ||
| <div class="link-limit-input-wrapper"> | ||
| <button type="button" class="btn btn-link px-0" ng-disabled="linksLimit < 1" |
There was a problem hiding this comment.
This should be < 2 or === 1
| id="links-limit-input" | ||
| guide-selector="graph-settings-links-limit" | ||
| ng-model="linksLimit" | ||
| min="0" max="1000" class="ng-pristine ng-valid ng-valid-number" |
There was a problem hiding this comment.
Here min is 0, but in the controller you can not go to 0
- refactored `linksLimit` to be an object, which holds min, max and disabled properties for increase/decrease buttons. - extracted magic numbers into constants - fixed some styling issues - removed `.only` in the test suite
|




What
Add link limit as URL parameter functionality to the visual graph.
Why
This way a link can be bookmarked or sent to someone, and it will open the same number of nodes.
How
Testing
cypress
Screenshots
Checklist