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

mgr/dashboard: Fix for form inside form closing issue #43639

Merged
merged 1 commit into from Oct 26, 2021

Conversation

nizamial09
Copy link
Member

@nizamial09 nizamial09 commented Oct 25, 2021

After the angular 11 upgrade the form in form behavior got broken when
one tries to close that "embedded" form. This commit is to fix that
behavior. It fixes in the nfs form as well as the iscsi-target form.

Fixes: https://tracker.ceph.com/issues/53020
Signed-off-by: Nizamudeen A nia@redhat.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@nizamial09 nizamial09 added bug-fix needs-review dashboard skip-teuthology For PRs whose changes do not have an effect on QA runs/changes are not being tested in Teuthology labels Oct 25, 2021
@nizamial09 nizamial09 requested a review from a team as a code owner October 25, 2021 06:02
@nizamial09 nizamial09 added this to In progress in Dashboard via automation Oct 25, 2021
@@ -55,12 +55,15 @@ export class NfsFormClientComponent implements OnInit {
return $localize`-- Select what kind of user id squashing is performed --`;
}

get clientsFormArray() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this globally available maybe? Like this
get FormArray(param: string) { .... } ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are we using this anywhere else? @avanthakkar

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can make this globally available from cd-forms component or a similar one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
get clientsFormArray() {
private get clientsFormArray() {

The recommended practice is to make vars/methods private by default (unless you need more visibility). Check information hiding section of OOD.

Copy link
Member Author

Choose a reason for hiding this comment

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

If I make it private will I be able to access it from html? I tried yesterday but it was giving me errors so I thought it might be because of the private @alfonsomthd

@@ -55,12 +55,15 @@ export class NfsFormClientComponent implements OnInit {
return $localize`-- Select what kind of user id squashing is performed --`;
}

get clientsFormArray() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
get clientsFormArray() {
private get clientsFormArray() {

The recommended practice is to make vars/methods private by default (unless you need more visibility). Check information hiding section of OOD.

Dashboard automation moved this from In progress to Review in progress Oct 25, 2021
@alfonsomthd
Copy link
Contributor

@nizamial09 Can you add some unit test or maybe extend the existing should create a nfs-export with RGW backend e2e test by adding the client addition step?

@nizamial09
Copy link
Member Author

nizamial09 commented Oct 25, 2021

@nizamial09 Can you add some unit test or maybe extend the existing [should create a nfs-export with RGW backend]

@alfonsomthd I'll add the e2e there. I think e2e would be more understandable here. Thanks

After the angular 11 upgrade the form in form behaviour got broken when
one tries to close that "embedded" form. This commit is to fix that
behaviour.

Fixes: https://tracker.ceph.com/issues/53020
Signed-off-by: Nizamudeen A <nia@redhat.com>
Copy link
Contributor

@avanthakkar avanthakkar left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @nizamial09

Dashboard automation moved this from Review in progress to Reviewer approved Oct 26, 2021
@@ -28,6 +28,11 @@ export class NFSPageHelper extends PageHelper {
cy.get('button[name=add_client]').click({ force: true });
cy.get('input[name=addresses]').type(client['addresses']);

// Check if we can remove clients and add it again
cy.get('span[name=remove_client]').click({ force: true });
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be addressed in a follow-up refactoring PR: remember that the team agreement is to use either data-testid or aria-label (where it applies) for element selection.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I'll stick to either of those two in the future.

@nizamial09 nizamial09 moved this from Reviewer approved to Ready-to-merge in Dashboard Oct 26, 2021
@epuertat epuertat merged commit 5e1297c into ceph:master Oct 26, 2021
Dashboard automation moved this from Ready-to-merge to Done Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix dashboard needs-review pybind skip-teuthology For PRs whose changes do not have an effect on QA runs/changes are not being tested in Teuthology
Projects
Archived in project
Dashboard
  
Done
4 participants