Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 521104 - [aird editor] Page ordering issue when combining PositionKind.REPLACE and PositionKind.AFTER
Summary: [aird editor] Page ordering issue when combining PositionKind.REPLACE and Pos...
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 5.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.1.0   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-18 05:08 EDT by Pierre-Charles David CLA
Modified: 2017-11-08 03:37 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2017-08-18 05:08:15 EDT
I have a PageProvider which provides:

* A single overview page O, which is configured to REPLACE the default page:

    @Override
    public Optional<String> getLocationId() {
        return Optional.of(DefaultSessionEditorPage.PAGE_ID);
    }

    @Override
    public Optional<PositioningKind> getPositioning() {
        return Optional.of(PositioningKind.REPLACE);
    }

* Multiple additional pages P1 to Pn, each with a unique id, but which are all configured to be AFTER "O", with no specific constraint on their own relative ordering. In other words, all of P1 to Pn have:

    @Override
    public Optional<String> getLocationId() {
        return Optional.of(OVERVIEW_ID);
    }

    @Override
    public Optional<PositioningKind> getPositioning() {
        return Optional.of(PositioningKind.AFTER);
    }

Expected result: an editor with the Overview page in first position, and then all of P1 to Pn after, in no particular order.

Actual result: I get the Overview page, which correctly replaces the default one, but then only one of P1 to Pn is visible.

If I change the overview page to be PositioningKind.AFTER the default one instead of replacing it, the result is correct. Looking at the code, the problem seems to be in oes.ui.editor.internal.pages.PageOrderer.linkAllPageRoot(List<PagePositioning>, Set<PagePositioning>). Before it is called from getOrderedPages, pagePositioningElements correctly references all the pages (default, O, P1 to Pn), but after the call, the resulting newPageOrdered only contains O and one of the Px pages.
Comment 1 Eclipse Genie CLA 2017-08-22 09:34:13 EDT
New Gerrit change created: https://git.eclipse.org/r/103458
Comment 2 Laurent Fasani CLA 2017-08-28 08:49:05 EDT
Is it possible that you attach a plug-in that provides the pages?
Ideally it is required for homologation and it would be better that we do not rely only on a future junit test to ensure the fix is working.
Comment 4 Pierre-Charles David CLA 2017-08-31 08:07:04 EDT
Fixed by 9bcbb696c78837ddc6ed9516e05b2781630298b6.
Comment 5 Julien Dupont CLA 2017-09-20 06:01:16 EDT
Can not be verified: missing or incomplete reproduction information.
Comment 6 Pierre-Charles David CLA 2017-09-25 09:48:14 EDT
Verified using Sirius 5.1.0rc1 on the original code where I detected the bug. The code in question concerns the integration of Amalgam's Activity Explorer pages into the aird editor, but it's too complex to extract as simple steps to reproduce.
Comment 7 Pierre-Charles David CLA 2017-11-08 03:37:48 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.