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

Implement Import/export button on frontend #81

Merged
merged 13 commits into from
Feb 26, 2022

Conversation

196Ikuchil
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #28

Special notes for your reviewer:

/label tide/merge-method-squash
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. labels Jan 16, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @196Ikuchil. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 16, 2022
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 16, 2022
@sanposhiho
Copy link
Member

/assign

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 3, 2022
@196Ikuchil
Copy link
Contributor Author

Since #64 had merged, I have been rebased this branch.
I'm still working on it.
(this error also still exists)
#81 (comment)

@196Ikuchil
Copy link
Contributor Author

I fixed the above errors.

web/components/ImportButton.vue Outdated Show resolved Hide resolved
web/components/ImportButton.vue Outdated Show resolved Hide resolved
@@ -0,0 +1,42 @@
<template>
Copy link
Member

Choose a reason for hiding this comment

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

Let's rename this component because Export/Import features are not related to scheduler config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't find a good name of it.
So, I renamed it to TopBar.
I think this component will have more components in the future. e.g.) ResetButton etc..

@sanposhiho
Copy link
Member

/ok-to-test

@196Ikuchil
Copy link
Contributor Author

196Ikuchil commented Feb 14, 2022

@sanposhiho
I've reorganized the directory, so please re-review.

@196Ikuchil
Copy link
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 14, 2022
@sanposhiho
Copy link
Member

/retitle Implement Import/export button on frontend

@k8s-ci-robot k8s-ci-robot changed the title [WIP]Implement Import/export button on frontend Implement Import/export button on frontend Feb 14, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 14, 2022
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Thanks. Left some comments.

web/components/TopBar/ImportButton.vue Outdated Show resolved Hide resolved
web/components/TopBar/ExportButton.vue Outdated Show resolved Hide resolved
web/components/TopBar/ImportButton.vue Outdated Show resolved Hide resolved
web/components/TopBar/ExportButton.vue Outdated Show resolved Hide resolved

export default defineComponent({
setup() {
const data = reactive({
Copy link
Member

Choose a reason for hiding this comment

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

Add watch func and reset SelectedItem is data.dialog is changed.

You can see how to use watch func in ResourceBar component
https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/master/web/components/ResourceBar/ResourceBar.vue#L210

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed that problem.
But this was caused by that file data being left in the input tag of the HTML.
So, I initialize and solve it by used to v-if when the dialog is closed.

f80e7f2#diff-55b111ca13380e4133d565d2e89a7e59ba9dba0361de293248d0d05192a8236fR16

@196Ikuchil
Copy link
Contributor Author

196Ikuchil commented Feb 20, 2022

@sanposhiho
Fixed it.

Btw, the button will remain pressed after the dialog is closed.
(No effect on operation.)
スクリーンショット 2022-02-20 14 06 17

スクリーンショット 2022-02-20 14 06 27

@196Ikuchil
Copy link
Contributor Author

Btw, the button will remain pressed after the dialog is closed.

This is intended as it is how it works in MD2 spec which is the basis of vuetify 2.0
vuetifyjs/vuetify#8436

It has already been added as a prop called retain-focus-on-click to resolve it.
But it doesn't work.
vuetifyjs/vuetify#9972

There is another method to resolve. But I think I'll keep it the current way if it is the basic.

@sanposhiho
Copy link
Member

/retest

@sanposhiho
Copy link
Member

@196Ikuchil
Thanks for investigating this. Understood. This is not a critical issue, so I think we can ignore it here as you said.

Could you add retain-focus-on-click even if it currently has no effect so that it can be solved in the future when Vuetify fixes this problem?

@196Ikuchil
Copy link
Contributor Author

@sanposhiho
ok! I have added the retain-focus-on-click attribute to the v-btn of Export/Import.

web/components/TopBar/ImportButton.vue Outdated Show resolved Hide resolved
Comment on lines 28 to 35
const buttonName = ["SchedulerConfiguration"];
const onClick = (bn: string) => {
switch (bn) {
case "SchedulerConfiguration":
schedulerconfigurationstore.fetchSelected();
break;
}
};
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this kinda abstraction is needed.
Let's make it simpler like before:

    const onClick = () => {
      schedulerconfigurationstore.fetchSelected();
    };

@196Ikuchil
Copy link
Contributor Author

@sanposhiho

I don't think this kinda abstraction is needed.
Let's make it simpler like before:

Thanks, I forgot to fix it. (At the beginning of this work, I had an another design of that.)

In addition, I refactored to split the button to another component.

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Nice work!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 26, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 196Ikuchil, sanposhiho

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2022
@k8s-ci-robot k8s-ci-robot merged commit ca3dc0d into kubernetes-sigs:master Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add feature to export/import current resources
3 participants