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

ui: delete pki key functionality #18146

Merged
merged 10 commits into from
Dec 1, 2022
Merged

ui: delete pki key functionality #18146

merged 10 commits into from
Dec 1, 2022

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Nov 29, 2022

delete-key

constructor() {
super(...arguments);
this.formFields = expandAttributeMeta(this, ['keyId', 'keyName', 'keyType', 'keyBits']);
get backend() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it bad for this to be a getter? In other situations we've added it as an attribute in the adapter - but I felt it sometimes got lost there.

Happy to move it there instead!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooh I love this! I wonder if we can standardize everywhere else 👀

Copy link
Collaborator

Choose a reason for hiding this comment

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

Another option is to use alias on the service's currentPath but I think it's potato potato

@@ -1,27 +0,0 @@
import { action } from '@ember/object';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not deleted, just moved into the page/ folder

Copy link
Collaborator

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Great work! A couple small items to follow up on. Love to see it! 👏


@withFormFields(['keyId', 'keyName', 'keyType', 'keyBits'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

✨ 🤩

constructor() {
super(...arguments);
this.formFields = expandAttributeMeta(this, ['keyId', 'keyName', 'keyType', 'keyBits']);
get backend() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooh I love this! I wonder if we can standardize everywhere else 👀

constructor() {
super(...arguments);
this.formFields = expandAttributeMeta(this, ['keyId', 'keyName', 'keyType', 'keyBits']);
get backend() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another option is to use alias on the service's currentPath but I think it's potato potato

}

export default class PkiKeyDetails extends Component<Args> {
@service declare router: { transitionTo: (route: string) => void };
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would love to see the types here moved to either a typescript declare module, or imported directly from some stub types folder. Cloud-UI also has a pattern of doing @service declare readonly myService but I'm not finding any luck with why. Couldn't hurt though!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay! I wasn't sure how to do the module way. I had noticed the other way for this was:

import RouterService from '@ember/routing/router-service';
 
export default class PkiKeyDetails extends Component<Args> {
  @service declare readonly router: RouterService;
...

what do you think?

});
});

test('it renders the page component', async function (assert) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add a test that confirms the delete action works?

Copy link
Collaborator

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Beautiful! Thank you! 🙌

@hellobontempo hellobontempo enabled auto-merge (squash) December 1, 2022 00:30
@hellobontempo hellobontempo merged commit 12d4576 into main Dec 1, 2022
@hellobontempo hellobontempo deleted the ui/VAULT-9354/delete-key branch December 1, 2022 18:10
AnPucel pushed a commit that referenced this pull request Jan 14, 2023
* add deletekey

* fix types

* move page components into folder

* finish tests

* make linting changes

* declare flashmessages ts service

* restructure pki test files

* add delete test

* add more folders
jayant07-yb pushed a commit to jayant07-yb/hashicorp-vault-integrations that referenced this pull request Mar 15, 2023
* add deletekey

* fix types

* move page components into folder

* finish tests

* make linting changes

* declare flashmessages ts service

* restructure pki test files

* add delete test

* add more folders
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