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

6648 share compare #6678

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#### next release (8.2.24)

- Fix `Key Share URL use case broken: share URL for Compare datasets forgets 2nd date`
Copy link
Member

Choose a reason for hiding this comment

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

It's better to note the bug that was fixed rather than a specific case of it (although it can be good list some specific use cases in a sub-list under the main bug fix entry). Sorry, I don't have a suggestion of a better changelog entry until I've understood the code change in SplitItemReference.ts.

- [The next improvement]

#### 8.2.23 - 2023-01-06
Expand Down
7 changes: 6 additions & 1 deletion lib/Models/Catalog/CatalogReferences/SplitItemReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ export default class SplitItemReference extends ReferenceMixin(
}

try {
// Ensure the target we create is a concrete item
// Ensure the target we create is a concrete item and check if we can return previousTarget
if (
previousTarget !== undefined &&
sourceItem.uniqueId === this.splitSourceItemId
Comment on lines +56 to +57
Copy link
Member

Choose a reason for hiding this comment

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

What does this check guarantee?

Also, it's probably not a standard use-case of SplitItemReference, but if this.splitSourceItemId changes between calls to loadReference this change will return the old model.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is needed to prevent the second item (dragged from first to second in workbench) from stripping out the required dereferenced details, which is the cause of the bug. i.e. if there is a previousTarget passed in and the id's match return the previousTarget

)
return previousTarget;
sourceItem = getDereferencedIfExists(sourceItem);
return sourceItem.duplicateModel(this.uniqueId, this);
} catch (e) {
Expand Down