Skip to content

GDB-14372 add link limit to URL#2884

Open
plamen-yordanov wants to merge 2 commits intomasterfrom
GDB-14372-add-link-limit-to-url
Open

GDB-14372 add link limit to URL#2884
plamen-yordanov wants to merge 2 commits intomasterfrom
GDB-14372-add-link-limit-to-url

Conversation

@plamen-yordanov
Copy link
Copy Markdown
Contributor

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

Screenshots

Screenshot from 2026-04-15 10-26-22

Checklist

  • Branch name
  • Target branch
  • Commit messages
  • Squash commits
  • MR name
  • MR Description
  • Tests
  • Browser support verified

@plamen-yordanov plamen-yordanov force-pushed the GDB-14372-add-link-limit-to-url branch 2 times, most recently from b863784 to 2f4eca1 Compare April 15, 2026 11:09
## 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
@plamen-yordanov plamen-yordanov force-pushed the GDB-14372-add-link-limit-to-url branch from 2f4eca1 to 325f808 Compare April 17, 2026 12:40
@svilenvelikov
Copy link
Copy Markdown
Collaborator

Put more space between the buttons and the input filed as in the mockup
image

@svilenvelikov
Copy link
Copy Markdown
Collaborator

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', () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only

// 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this comment as it's not needed here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is. There is a chained wait, in the command, which is explained in the next comment.

linksLimit = 1;
}
if (linksLimit > 1000) {
linksLimit = 1000;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants