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

fix: Teams and owner fields are not being passed in the policy API call. #17880

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

Sachin-chaurasiya
Copy link
Member

@Sachin-chaurasiya Sachin-chaurasiya commented Sep 17, 2024

Describe your changes:

The issue lies in the way the fields are being passed to the getPolicyByName function. The expression inside the template literal is using the comma operator, which only evaluates the last operand. Therefore, only TabSpecificField.ROLES is being passed.
Was introduced in #17013

const data = await getPolicyByName( fqn, ${ (TabSpecificField.OWNERS, TabSpecificField.LOCATION, TabSpecificField.TEAMS, TabSpecificField.ROLES) } );

To fix the issue now we are passing fields like this

const data = await getPolicyByName(
        fqn,
        `${TabSpecificField.OWNERS},${TabSpecificField.LOCATION},${TabSpecificField.TEAMS},${TabSpecificField.ROLES}`
      );
Screen.Recording.2024-09-17.at.1.15.11.PM.mov

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • I have added a test that covers the exact scenario we are fixing.

Copy link
Contributor

github-actions bot commented Sep 17, 2024

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
64.29% (37343/58083) 40.94% (14778/36098) 43.03% (4505/10469)

Copy link

@chirag-madlani chirag-madlani merged commit a72d502 into main Sep 17, 2024
15 of 16 checks passed
@chirag-madlani chirag-madlani deleted the minor-policies-fields branch September 17, 2024 20:21
Sachin-chaurasiya added a commit that referenced this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs UI UI specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants