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

Portal Dashboards, PF5 #504

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mshriver
Copy link
Contributor

@mshriver mshriver commented Jun 17, 2024

The intent of this PR is to introduce a new frontend for dashboards that does not require project access for users.

The test artifacts, runs, and results will not be directly available through this dashboard, only the widgets aggregating data.

I also intend to introduce static URLs for these portals, and their dashboards, so that people can generate permalinks to them.

Status

Backend, ready for review

Backend updates for the models, DB upgrade, a new controller for portals and portal admin, updates to impacted controllers, new unit tests, and updates to existing unit tests for consistency are in the current commit.

I'd like a review on this backend commit separate from the frontend implementation.

DB v5 to v6 upgrade tested with local postgres, table updates are as expected. I'll be testing this on our Red Hat stage instance internally as well.

Frontend, MOSTLY ready for review

Frontend changes for the admin portal, profile, and project pages are working and can be reviewed.

Frontend changes for project dashboards, runs, results are ready for review, but I'm expecting to find bugs.

Frontend static routing for admin, profile, projects, dashboards, runs, results are ready for review. You should be able to navigate via URL and the resulting frontend has the correct project and dashboard selected!

@mshriver mshriver added enhancement New feature or request frontend backend python Pull requests that update Python code javascript Pull requests that update Javascript code labels Jun 17, 2024
@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch 2 times, most recently from e7eba77 to 742173e Compare June 17, 2024 15:42
@mshriver mshriver mentioned this pull request Jun 17, 2024
@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch 8 times, most recently from bef493c to 8e2d792 Compare June 19, 2024 01:31
@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch 12 times, most recently from 1e822d1 to 7f09233 Compare June 27, 2024 19:55
@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch 9 times, most recently from 77f0255 to 4db3840 Compare July 17, 2024 12:55
@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch from 81334a0 to 4ab7d4f Compare July 23, 2024 13:19
Copy link
Collaborator

@ColeHiggins2 ColeHiggins2 left a comment

Choose a reason for hiding this comment

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

Looks good so far! These are no pending comments. Just trying to learn!


:rtype: Portal
"""
if not is_uuid(id_):
Copy link
Collaborator

@ColeHiggins2 ColeHiggins2 Jul 23, 2024

Choose a reason for hiding this comment

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

Is there a reason as to why this logic of checking for name or id is different than when an admin user tries to get a single portal? i.e admin_get_portal?

looks like as an admin user, we try to get the portal by ID and then by name. Where here we check for name and then if that fails we try to get by ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will double check, at this point I was repeating a lot of the patterns from the project controller because the entities should have the same CRUD behaviors and permissions.

"totalPages": total_pages,
},
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Non admin users will not be able to delete portals?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, it's like deleting a project.

MOCK_USER = MockUser.from_dict(**{"id": MOCK_USER_ID})


class TestPortalController(BaseTestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add tests for deleting portals here? or is that an admin only action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes and yes!

The tests for admin controllers are lacking ... I'll try to add them in this scope.

@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch 7 times, most recently from 6a74663 to 3c6836f Compare July 30, 2024 13:40
@mshriver
Copy link
Contributor Author

mshriver commented Jul 30, 2024

Thanks all for first round reviews - I've re-requested reviews as I've made significant frontend updates that should be ready for local testing and review.

I'd really appreciate your help in running this locally and finding any weird behaviors! I'll be doing that myself this week, as well as preparing to deploy the stage instance in GPC.

Note - before final review and merge I'll be auditing the diff and removing any console.log messages that got left behind from my debugging.

Frontend updates for admin portal-edit and portal-list are working

React context used to track active dashboard and project, instead of
browser local storage. Dashboard, IbutsuHeader, IbutsuPage rewritten for
using the context.

Static routes set for project dashboard/runs/results/reportbuilder using
UUID. Page component state needs to be updated in some areas when
navigation orginates from the URL with params set and not component
selection.

Project selection and dashboard selection are hooked up to the routing
with ugly event handler prop passing. Moving these to functional
components will allow using useEffect with dependencies instead to
control interaction between these components

In progress:

sidebar moved into new functional component, project views need to be
accounted for in component state or in the context itself.

Now when a project is not selected, there is no page rendered (no
sidebar). This will need an empty state page to look good, something
easy just saying to select a project or portal.

Class component callbacks on setState don't pick up modified context, so
I'm having to hack a function parameter into the callback functions

Split Admin and Profile pages into separate component for sane routing
Both now use Page instead of IbutsuPage, keeping IbutsuHeader

Use an outlet in the admin and profile pages for easy routing

run and result updates for routing change

path relative links for react-router so that runs and results are nested
under `/project/:id`

Page refreshes now set both the project and dashboard selection from
URL params!

DRAFT remove utility functions, update Links

use path relative links from components where the route relative paths
don't compose correctly.

Update widget-config-controller to allow view type widgets to not have
any project set

needs testing
Copy link

@vcwild vcwild left a comment

Choose a reason for hiding this comment

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

I audited all console statements from your PR, I hope it helps to chose which ones to keep 😉

Portal does not have relationship to runs, results, etc. only
dashboards.

DB upgrade_6, dashboard and widget_config alterations

New controller for portal and portal admin

Updates to widget_config controller and dashboard controller

Update openapi spec and add unit test

Restructure test_widget_config_controller
Increase coverage with subtests

Define common headers and http response assertion failure message for
tests
@mshriver mshriver force-pushed the satellite-dashboard-PF5 branch from 3c6836f to 9083385 Compare August 5, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request frontend javascript Pull requests that update Javascript code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants