enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
201 stars 34 forks source link

IssueListDialog - 'Open' tab should open when an issue was opened #5413

Closed sgauruseu closed 6 years ago

sgauruseu commented 7 years ago
  1. create an issue
  2. click on the issue and open IssueDetails dialog
  3. close the issue , and go to IssueList dialog - 'Closed' tab is active(OK)
  4. click on the issue again and open it . Expected: Open-tab should be activated Actual: 'Closed' -tab is opend

tabs

pmi commented 6 years ago

Here's the abstract responsible for choosing tab

private getTabToOpen(issues?: Issue[]): IssuesPanel {
        if (!issues) {
            return this.getFirstNonEmptyTab();
        }

        if (issues[0].getModifier()) {
            if (this.isIssueModifiedByCurrentUser(issues[0])) {
                if (issues[0].getIssueStatus() === IssueStatus.CLOSED) {
                    return this.closedIssuesPanel;
                }
            }

            return <IssuesPanel>this.dockedPanel.getDeck().getPanelShown();
        }

        if (this.isIssueCreatedByCurrentUser(issues[0])) {
            return this.openIssuesPanel;
        }

        return <IssuesPanel>this.dockedPanel.getDeck().getPanelShown();
    }

It currently opens closed issues tab if an issue was closed by the current user. @ase, should we switch to open issues if the last issue in the list was reopened ?

pmi commented 6 years ago

Issue moved to enonic/xp-apps #412 via ZenHub