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

Nested folders: Add folder actions to other tabs #68673

Merged
merged 7 commits into from
May 24, 2023

Conversation

ashharrison90
Copy link
Contributor

What is this feature?

  • adds folder actions to the Alerting and Panels tabs
  • creates new page components for these tabs. this is for a couple of reasons:
    • so they can use the rtk query method to get the folder information (same as Dashboards tab)
    • so they can build the navModel in a programmatic way (same as Dashboards tab)
  • implements move/delete in the folder actions

Why do we need this feature?

  • better UX

Who is this feature for?

  • anyone using nested folders!

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@ashharrison90 ashharrison90 added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes area/manage-dashboards labels May 18, 2023
@ashharrison90 ashharrison90 added this to the 10.1.x milestone May 18, 2023
@ashharrison90 ashharrison90 requested a review from joshhunt May 18, 2023 08:24
@ashharrison90 ashharrison90 self-assigned this May 18, 2023
@ashharrison90 ashharrison90 requested a review from a team as a code owner May 18, 2023 08:24
@ashharrison90 ashharrison90 requested review from tskarhed and removed request for a team May 18, 2023 08:24
Copy link
Contributor

@joshhunt joshhunt left a comment

Choose a reason for hiding this comment

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

Good with code, and gave it a spin and works well with nested folders enabled. I want to test as well when disabling the feature flag before giving it my ✔️

Comment on lines +15 to +19
export function BrowseFolderAlertingPage({ match }: OwnProps) {
const { uid: folderUID } = match.params;
const { data: folderDTO, isLoading } = useGetFolderQuery(folderUID);
const folder = useSelector((state) => state.folder);

Copy link
Contributor

Choose a reason for hiding this comment

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

Can I be a pain and ask if we can write tests for this?

Something like

describe("BrowseFolderAlertingPage", () => {
    it("renders correct breadcrumbs"); 
    it("renders folder name");
    it("renders alerts for folder");
    it("shows the alerting tab as selected")
});

Likewise for the other one? 🥺

const mockFolderUid = '12345';
const mockAlertRuleName = 'myAlertRule';

const mockRulerRulesResponse: RulerRulesConfigDTO = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to discuss this with the wider frontend group - is there a better home where these fixtures can live? Maybe we could put a TODO on this to find a better home for it?

Personally, I would like to extend this fixtures pattern we/I started in browse-dashboards to the rest of the codebase...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have moved these into separate fixtures files, still in the browse-dashboards folder for now. should make it very easy to move them later (e.g. if we want to move the libraryElements fixtures to the libraryPanels folder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend area/manage-dashboards no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants