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

Add deep linking to controls #348

Closed
rlakey opened this issue Jan 7, 2022 · 4 comments · Fixed by #546
Closed

Add deep linking to controls #348

rlakey opened this issue Jan 7, 2022 · 4 comments · Fixed by #546
Assignees
Labels
enhancement Pull requests that add a new feature feature request V3.0 vmw
Milestone

Comments

@rlakey
Copy link
Contributor

rlakey commented Jan 7, 2022

Feature request for the backlog

Links directly to controls for sending directly to users outside of Vulcan.

When on a control the URL is like this currently:

https://vulcan/components/5/controls

Looking for something like this to go directly to a control via the URL.

https://vulcan/components/5/controls/ESXI-70-000001

@aaronlippold aaronlippold added enhancement Pull requests that add a new feature feature request V3.0 labels Feb 24, 2022
@rlakey rlakey added the vmw label Apr 15, 2022
@rlakey rlakey moved this to Todo in Vulcan - Project Plan Apr 15, 2022
@rlakey rlakey added this to the v3.1 milestone Apr 15, 2022
@rlakey
Copy link
Contributor Author

rlakey commented Feb 22, 2023

Explore if it is possible to implement this without impacting the existing functionality of being able to view different controls, make changes that possibly aren't changed and to go back to those controls without losing what was changed.

What we don't want is to click on a control and to be redirected to a new page every time but at the same time be able to link to a specific control.

@rlakey rlakey assigned smarlaku820 and unassigned timwongj Feb 22, 2023
@vanessuniq
Copy link
Contributor

one option that comes in mind is to add a target attribute to the control to open the link in a new tab. But, I am not sure if I really understand the ask.

@vanessuniq
Copy link
Contributor

Also looking at the routes:

resources :components, only: %i[show create update destroy], shallow: true do
      post 'lock', to: 'reviews#lock_controls'
      resources :rules, only: %i[index show create update destroy], shallow: true do
        post 'revert', on: :member
        resources :comments, only: %i[create]
        resources :reviews, only: %i[create]
      end
end

We use the option shallow: true on component. When the shallow option is set to true, it means that only the parent resource will have a full set of RESTful routes (index, show, new, create, edit, update, and destroy), while the child resources will only have the routes necessary to create and edit them as nested resources under the parent. This is useful for reducing the number of routes generated, and improving the performance of your application.
If we want the route /components/:component_id/controls/:id, we can modify the code to the following:

resources :components, only: %i[show create update destroy], shallow: true do
      post 'lock', to: 'reviews#lock_controls'
      resources :rules, only: %i[index create update destroy], shallow: true do
        post 'revert', on: :member
        resources :comments, only: %i[create]
        resources :reviews, only: %i[create]
      end
end

# Separate route for rules#show
get '/components/:component_id/rules/:id', to: 'rules#show', as: 'component_control'

@rlakey
Copy link
Contributor Author

rlakey commented Feb 22, 2023

one option that comes in mind is to add a target attribute to the control to open the link in a new tab. But, I am not sure if I really understand the ask.

Couple uses cases. If i just want to have someone else look at a specific control I can't send them a direct link to it.

The second thing is for the notification system if we notify someone on an @ mention or a review request we should also be able to provide a link to the control/comment they were mentioned or the control they were asked to review.

@vanessuniq vanessuniq linked a pull request Mar 2, 2023 that will close this issue
@vanessuniq vanessuniq linked a pull request Mar 14, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from Todo to Merged in Vulcan - Project Plan Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests that add a new feature feature request V3.0 vmw
Projects
Status: Merged
Development

Successfully merging a pull request may close this issue.

5 participants