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

feat: add query parameter for activeTab for artifacts and steps #469

Closed
wants to merge 1 commit into from

Conversation

adong
Copy link
Member

@adong adong commented Jul 26, 2019

Context

Users want to share which active tab they are actively viewing.

Objective

This PR adds a query parameter to preserve what tab is currently active, so that users can share links

Steps: http://localhost:4200/pipelines/1/builds/2

image

Or
Artifacts: http://localhost:4200/pipelines/1/builds/2?tab=artifacts

image

References

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@tkyi
Copy link
Member

tkyi commented Jul 26, 2019

Will it be possible to deep link to a specific open artifact? like we deep link to specific steps in build logs

@@ -20,6 +20,12 @@ export default Controller.extend({
stepList: mapBy('build.steps', 'name'),
isShowingModal: false,
errorMessage: '',
activeTab: 'steps',
Copy link
Member

Choose a reason for hiding this comment

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

I think I remember during design discussions that we wanted the activeTab to be "artifacts" if the build had run successfully

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh. I see, that requires some other changes.

Copy link
Member

@jithine jithine left a comment

Choose a reason for hiding this comment

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

This has to be a path parameter, not query param. So url will be http://localhost:4200/pipelines/1/builds/2/artifacts

@adong
Copy link
Member Author

adong commented Jul 26, 2019

Technical References:

I thought I could setup a query parameter in Controller queryParams, then use setupController in its routers to have a pre-defined default value.

Ran into issues like

  1. setting a controller property in setupController does not update the query param emberjs/ember.js#5465
  2. https://discuss.emberjs.com/t/how-to-programatically-setup-default-query-params-after-model/13666/7

No success.

Then used Ember.run.next inside Route's setupController, that worked. After read from emberjs/ember.js#14606 (comment)

image

So I ended up not fighting against the ember framework. Set a query parameter default value in controller, i.e. steps, knowing that default parameter wont show up in the url.

@adong
Copy link
Member Author

adong commented Jul 29, 2019

Closed in favor of path parameter in #470

@adong adong closed this Jul 29, 2019
@adong adong deleted the adong/artifacts-query-param branch October 28, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants