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

Update the looks of My Projects route and add advanced filtering and configuration #4219

Merged
merged 45 commits into from
Mar 8, 2023

Conversation

magicznyleszek
Copy link
Member

@magicznyleszek magicznyleszek commented Jan 18, 2023

Description

Updated the My Projects route with the looks introduced with Project Views functionality. New UI allows advanced filtering, column hiding and ordering of the projects. All the settings are being remembered between sessions.

Code Review notes

This includes quite a lot of changes:

  • removes all code related to old /#forms route
  • extends functions from api.ts to also work with full urls (currently only paths are allowed)
  • created new utils file assetQuickActions:
    • it is a place for actions that modifies the asset
    • I moved some code from mixins.tsx here
    • I moved some code from assetUtils.ts here
    • I tried not to modify the code I moved, but there are some minor changes
  • modified some assetUtils.ts methods to allow both AssetResponse and ProjectViewAsset (the asset object that we receive from Project Views endpoint; it has less amount of data than big AssetResponse)
  • remove whole lot of code related to old /#forms
  • I removed mixins.clickAsset and am using assetQuickActions instead
  • simplified the placement handling of KoboDropdown (previously you had to import KoboDropdownPlacements enum and then use one of the values - now you have to simply match the type)
  • improved userCan method, so it works with ProjectViewAsset assets (they don't have permissions list, only effective_permissions, so I had to take this into account)
  • customViewStore has some changes:
    • it now works with different fetch url locations (we assume that any API endpoint given to the store will behave similarly), so we can use it both with Project Views and My Projects (different endpoints)
    • it reacts to the changes of assets done with ProjectQuickActions
  • new component ProjectQuickActions that displays a bunch of buttons for modifying a single asset
  • for My Projects the /#forms route is no longer being used - now it redirects to new route #/projects/home
  • for fields definitions in projects/projectViews/constants.ts the fact if they are orderable thorugh API is being set on per route basis (the endpoint used by My Projects doesn't have identical functionality for ordering as Project Views)
  • new SCSS mixin mixins.floatingRoundedBox; that adds rounded corners, shadow and white background
  • ProjectsTable component now has a column with checkboxes that allows selecting rows (projects) - for now only single selection allows to do things (via ProjectQuickActions), in near future we will also have BulkQuikcActions for handling multiple selected rows
  • modified back-end code to add missing asset_type and downloads fields to ProjectViewAsset

Related issues

Fixes #4209
Fixes #4058
Fixes #4237

@magicznyleszek magicznyleszek linked an issue Jan 19, 2023 that may be closed by this pull request
Base automatically changed from custom-views-integrate-endpoints-into-front-end to feature/regional_projects January 19, 2023 13:46
Base automatically changed from feature/regional_projects to beta January 26, 2023 03:39
@magicznyleszek magicznyleszek changed the base branch from beta to feature/my-projects February 1, 2023 10:30
# Conflicts:
#	jsapp/js/components/assetrow.es6
#	jsapp/js/components/assetsTable/assetActionButtons.tsx
#	jsapp/js/components/header.es6
#	jsapp/js/mixins.tsx
@magicznyleszek magicznyleszek marked this pull request as ready for review February 9, 2023 15:47
@magicznyleszek magicznyleszek changed the title Update My Projects route to use new shiny components Update the looks of My Projects route and add advanced filtering and configuration Feb 9, 2023
@magicznyleszek magicznyleszek linked an issue Feb 22, 2023 that may be closed by this pull request
magicznyleszek and others added 2 commits February 22, 2023 02:21
… especially since the quick actions menu is triggered by checkbox

- Wider, taller checkbox click target, extends to the beginning of the 
  next cell
- Visually indicate if a click would trigger navigation (soft underline
  the project name on row hover)
jsapp/js/api.ts Show resolved Hide resolved
jsapp/js/router/allRoutes.es6 Show resolved Hide resolved
jsapp/js/assetQuickActions.ts Outdated Show resolved Hide resolved
jsapp/js/components/header.es6 Show resolved Hide resolved
jsapp/js/projects/customViewRoute.tsx Show resolved Hide resolved
jsapp/js/projects/projectViews/constants.ts Show resolved Hide resolved
@p2edwards p2edwards merged commit 9fd02d2 into feature/my-projects Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment