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

fix(core/projects): Fix duplicate Projects appearing in recent history (on search screen) #8806

Conversation

christopherthielen
Copy link
Contributor

@christopherthielen christopherthielen commented Dec 17, 2020

The recent history service uses the state's .data field to configure recent history behavior.

    $rootScope.$on('$stateChangeSuccess', (_event: IAngularEvent, toState: Ng1StateDeclaration, toParams: any) => {
      if (toState.data && toState.data.history) {
        const params = omit(toParams || {}, ['debug', 'vis', 'trace']);
        RecentHistoryService.addItem(toState.data.history.type, toState.name, params, toState.data.history.keyParams);
      }
    });

It uses .data.history.keyParams to check if a recent entry is already recorded. It compares the configured router params with the stored values.

  private static getExisting(items: IRecentHistoryEntry[], params: any, keyParams: string[]): IRecentHistoryEntry {
    if (!keyParams || !keyParams.length) {
      return find(items, { params: omitBy(params, isUndefined) });
    }
    return items.find((item) => keyParams.every((p) => item.params[p] === params[p]));
  }

@christopherthielen christopherthielen added the ready to merge Reviewed and ready for merge label Dec 17, 2020
@mergify mergify bot merged commit 8f291c0 into spinnaker:master Dec 17, 2020
@christopherthielen christopherthielen deleted the fix-duplicate-projects-in-recent-history branch December 17, 2020 20:35
vigneshm added a commit that referenced this pull request Jan 13, 2021
95eacfb refactor(core/deployment): Update redblack fields without force updating (#8840)
a027d62 fix(gitlab): fix help text for gitlab artifacts
8858746 feat(md): waiting status (#8836)
c7eb9f4 feat(kubernetes): Raw resources UI MVP (#8800)
ef87a9e fix(core/executions): Update migrated status to match API (#8831)
3a51af2 fix(core/deploymentStrategy): do not show highlander preview in deploy stage config (only show in clone dialog)
8be06a0 feat(core/deploymentStrategy): Add a preview for Highlander deploys
c32c91a fix(serverGroup): Increase the timeout for api request (#8812)
29a85a0 feat(core/executions): Render newly migrated execution groups  (#8807)
8f291c0 fix(core/projects): Fix duplicate Projects appearing in recent history (on search screen) (#8806)
mergify bot pushed a commit that referenced this pull request Jan 13, 2021
95eacfb refactor(core/deployment): Update redblack fields without force updating (#8840)
a027d62 fix(gitlab): fix help text for gitlab artifacts
8858746 feat(md): waiting status (#8836)
c7eb9f4 feat(kubernetes): Raw resources UI MVP (#8800)
ef87a9e fix(core/executions): Update migrated status to match API (#8831)
3a51af2 fix(core/deploymentStrategy): do not show highlander preview in deploy stage config (only show in clone dialog)
8be06a0 feat(core/deploymentStrategy): Add a preview for Highlander deploys
c32c91a fix(serverGroup): Increase the timeout for api request (#8812)
29a85a0 feat(core/executions): Render newly migrated execution groups  (#8807)
8f291c0 fix(core/projects): Fix duplicate Projects appearing in recent history (on search screen) (#8806)
paragbhingre pushed a commit to paragbhingre/deck that referenced this pull request Jan 21, 2021
95eacfb refactor(core/deployment): Update redblack fields without force updating (spinnaker#8840)
a027d62 fix(gitlab): fix help text for gitlab artifacts
8858746 feat(md): waiting status (spinnaker#8836)
c7eb9f4 feat(kubernetes): Raw resources UI MVP (spinnaker#8800)
ef87a9e fix(core/executions): Update migrated status to match API (spinnaker#8831)
3a51af2 fix(core/deploymentStrategy): do not show highlander preview in deploy stage config (only show in clone dialog)
8be06a0 feat(core/deploymentStrategy): Add a preview for Highlander deploys
c32c91a fix(serverGroup): Increase the timeout for api request (spinnaker#8812)
29a85a0 feat(core/executions): Render newly migrated execution groups  (spinnaker#8807)
8f291c0 fix(core/projects): Fix duplicate Projects appearing in recent history (on search screen) (spinnaker#8806)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Reviewed and ready for merge target-release/1.25
Projects
None yet
3 participants