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

PKI Role's model and List view #17134

Merged
merged 4 commits into from
Sep 14, 2022
Merged

PKI Role's model and List view #17134

merged 4 commits into from
Sep 14, 2022

Conversation

Monkeychip
Copy link
Contributor

@Monkeychip Monkeychip commented Sep 14, 2022

This PR starts the setup for the PKI roles model and gets the Roles List View setup.

The Roles model will undergo some tweaks, but the connection and openAPI are setup here. I can't finalize the model until I work through some questions with the backend and design. The model will be finalized when I work on the Roles Create view.

Below is a video of the changes. I start by showing the empty state, routing, and then the model with all of the OpenAPI params at the end. (The video makes it look like I'm missing some border styling, it's just the video quality).

pki-roles-list.mov

@@ -0,0 +1,3 @@
import PkiRoleAdapter from './pki-role';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

extending the current PKI adapter. This allows us to take advantage of PKI adapter work that is already functional, while also allowing us to add more network requests in this file that are not used in the current PKI engine. When we complete this work, we can think about refactoring the current PKI adapter, but we determined that was outside the scope of this project's initial phase (just getting the work done and functional). The PKI adapter is dependent on other adapters and kind of a maze to work through. It's not an easy task to refactor at this point. This will come up when we remove the old PKI work.


export default class BlogPostController extends Controller {
get mountPoint() {
return getOwner(this).mountPoint;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need the mountPoint because this is an engine and for the LinkedBlock component to work it needs to know where in the App it is. This is passed through as a param called linkPrefix.

@Monkeychip Monkeychip added this to the 1.12 milestone Sep 14, 2022

async model() {
// the pathHelp service is needed for adding openAPI to the model
await this.pathHelp.getNewModel('pki/pki-role-engine', 'pki');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You normally don't see this method being called in other secret engines because it's done automatically when visiting the backend.list-root route, however we're not visiting that route because of the mounting of where this engine is. Therefor we have to move some functionality the list-route gives us to this model.

Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

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

LGTM nice work!

name;

// must be a getter so it can be added to the prototype needed in the pathHelp service on the line here: if (newModel.merged || modelProto.useOpenAPI !== true) {
get useOpenAPI() {
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@Monkeychip Monkeychip merged commit b0a1f64 into main Sep 14, 2022
@Monkeychip Monkeychip deleted the ui/VAULT-6522/pki-roles-list branch September 14, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants