Skip to content
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

IBX-7030: [UDW] Inactive edit button in grid view #1175

Merged
merged 3 commits into from
Mar 18, 2024
Merged

Conversation

GrabowskiM
Copy link
Contributor

@GrabowskiM GrabowskiM commented Feb 15, 2024

Question Answer
JIRA issue https://issues.ibexa.co/browse/IBX-7030
Type bug
Target version v4.6
BC breaks no
Doc needed no

For whole UDW markedLocationId is used as both item that is detailed in sidebar and parent of last/active branch.
It changes however in grid view, where markedLocationId keeps data about details in sidebar, but it's not necessary parent of visible items, therefore I've added extra state variable gridActiveLocationId that is used only in grid view and keeps info about parent of visible subitems.

At first I wanted to keep it only in GridView component, but I had to move it to the top, as entering CotF destroyes everything except top layer, so state for activeLocationId was lost as well and we need this info after closing CotF.

Checklist:

  • Tested the solution manually.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Asked for a review (ping @ibexa/engineering).

Copy link
Contributor

@katarzynazawada katarzynazawada left a comment

Choose a reason for hiding this comment

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

  1. In grid view click Edit button.
  2. Cancel.
  3. Select any content.

Result: UDW closes and error in console.
Screenshot 2024-03-07 at 11 41 29

import { getTranslator } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/context.helper';

const getLoadedLocationsLimitedMap = (loadedLocationsFullMap, activeLocationId) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it placed outside of the component? 🤔

const getLoadedLocationsLimitedMap = (loadedLocationsFullMap, activeLocationId) => {
const itemIndex = loadedLocationsFullMap.findIndex(({ parentLocationId }) => parentLocationId === activeLocationId);

return loadedLocationsFullMap.slice(0, itemIndex + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we check whether itemIndex is different from -1?

@GrabowskiM GrabowskiM changed the base branch from main to 4.6 March 15, 2024 16:41
Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dew326 dew326 merged commit 09b2510 into 4.6 Mar 18, 2024
22 checks passed
@dew326 dew326 deleted the IBX-7030-udw-grid-view branch March 18, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants