Skip to content

feat: add files and uploads page - #541

Merged
KristinAoki merged 23 commits into
masterfrom
KristinAoki/add-files-and-uploads
Aug 4, 2023
Merged

feat: add files and uploads page#541
KristinAoki merged 23 commits into
masterfrom
KristinAoki/add-files-and-uploads

Conversation

@KristinAoki

Copy link
Copy Markdown
Contributor

JIRA Ticket: TNL-10908
Figma

Setup for tests:

  1. npm install
  2. npm run build (necessary to load new environment variable values)
  3. npm start

Test:

  1. Switching between grid and list view
  2. Bulk delete files
  3. Bulk download files
  4. Bulk add files
  5. Menu delete
  6. Menu download
  7. Menu lock/unlock file
  8. Empty asset state has dropzone and no table action buttons
  9. Dropzone add single file
  10. Asset info modal lock/unlock

@codecov

codecov Bot commented Jul 31, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 91.27% and project coverage change: +2.57% 🎉

Comparison is base (8bfc3f2) 78.20% compared to head (921e7d4) 80.77%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #541      +/-   ##
==========================================
+ Coverage   78.20%   80.77%   +2.57%     
==========================================
  Files         145      168      +23     
  Lines        2698     3106     +408     
  Branches      632      706      +74     
==========================================
+ Hits         2110     2509     +399     
- Misses        558      565       +7     
- Partials       30       32       +2     
Files Changed Coverage Δ
src/store.js 100.00% <ø> (ø)
src/files-and-uploads/FileThumbnail.jsx 45.45% <45.45%> (ø)
src/files-and-uploads/FileMenu.jsx 66.66% <66.66%> (ø)
src/files-and-uploads/ApiStatusToast.jsx 71.42% <71.42%> (ø)
...rc/files-and-uploads/table-components/ListCard.jsx 80.00% <80.00%> (ø)
src/files-and-uploads/FileInfo.jsx 81.81% <81.81%> (ø)
...iles-and-uploads/table-components/TableActions.jsx 83.33% <83.33%> (ø)
src/files-and-uploads/FilesAndUploads.jsx 84.61% <84.61%> (ø)
src/CourseAuthoringRoutes.jsx 100.00% <100.00%> (ø)
src/files-and-uploads/FileInput.jsx 100.00% <100.00%> (ø)
... and 9 more

... and 17 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/files-and-uploads/ApiStatusToast.jsx Outdated
Comment thread src/files-and-uploads/FileInput.jsx Outdated
Comment thread src/files-and-uploads/FileMenu.jsx
@connorhaugh

Copy link
Copy Markdown
Contributor

Looks like you still need to add tests for redux and tablecomponents.

@KristinAoki
KristinAoki requested a review from connorhaugh August 3, 2023 14:29
Comment thread src/files-and-uploads/FilesAndUploads.jsx Outdated
link.target = '_blank';
link.download = true;
link.href = externalUrl;
link.click();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This opens a bunch of blank tabs which may be disturbing to the user ux wise but i agree its the solution until we can implement zip files.

Looks like the biggest library for this (jszip) hasn't been contributed to in a year, so either is is perfect or dead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah that is the library i have been looking into. I plan to work on the zipping after everything is done for the first pass.


const headerActions = ({ selectedFlatRows }) => {
if (_.isEmpty(assets)) {
return [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we returning a list or a react component here? I know JS isn't type safe, but that seems risky.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch! The parameter that is calling the function expects an array of components or a functional component. But the returned empty array is no longer needed because of how I control the view of the table control bar.

setTotalCount: (state, { payload }) => {
state.totalCount = payload.totalCount;
},
updateLoadingStatus: (state, { payload }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you think at all about bringing the request states framework from FLCC over to course authoring for this kind of stuff? If yes, why did you go with this approach?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am using the patterns that already existed in this repo.

@connorhaugh

Copy link
Copy Markdown
Contributor

Added some more js-level feedback. Code seems to be working properly but just trying to be thorough.

KristinAoki and others added 3 commits August 4, 2023 09:13
Co-authored-by: connorhaugh <49422820+connorhaugh@users.noreply.github.com>

@connorhaugh connorhaugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work!

@KristinAoki
KristinAoki merged commit b9feb50 into master Aug 4, 2023
@KristinAoki
KristinAoki deleted the KristinAoki/add-files-and-uploads branch August 4, 2023 15:57
peterkulko pushed a commit to raccoongang/frontend-app-course-authoring that referenced this pull request Aug 21, 2023
wowkalucky pushed a commit to raccoongang/frontend-app-course-authoring that referenced this pull request Aug 22, 2023
* feat: configuration for xpert unit summaries (openedx#540)

Adds setting modal for Xpert unit summaries

Includes hiding the config section for xpert summary - 
this is done based on a flag from edx/ai-aside@3d113d2

* fix: load up-to-date config on studio fetch (openedx#548)

* refactor: added PropTypes declarations

* feat: add files and uploads page (openedx#541)

* fix: remove env variable for files and uploads (openedx#549)

* Update verbiage for Xpert Settings (openedx#550)

* chore: Update verbiage for Xpert configuration screen

* fix: Change "generate" to "display" in xpert modal text

* fix: Updated learn more link

* fix: Change link and add targets

* test: added test cases for hide discussion tab (openedx#552)

Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>

* feat: upgrade frontend-lib-content-components (openedx#554)

* feat: bump frontend-lib-content-components (openedx#559)

* fix: Change wording to not crowd xpert tile in preferences page (openedx#560)

* fix: width and height of asset preview (openedx#558)

* feat: flcc to 1.168.0 (openedx#561)

* feat: bump frontend-lib-content-components (openedx#562)

* fix: overflow-y scroll behavior (openedx#565)

* test: added test cases of discussion restriction (openedx#556)

* test: added test cases of discussion restriction

* refactor: added null default value for dataTestId

---------

Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>

* fix: Add enabled badge to xpert settings tile  (openedx#566)

* feat: Add "Enabled" badge to xpert settings tile

* fix: Update model with state instead of non-existent prop from response

* feat: bump frontend-lib-content-components (openedx#569)

* feat: Added Schedule and Details MFE page (openedx#547)

* refactor: some refactoring

---------

Co-authored-by: David Nuon <davidnuongm@gmail.com>
Co-authored-by: Zachary Hancock <zhancock@edx.org>
Co-authored-by: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com>
Co-authored-by: sundasnoreen12 <72802712+sundasnoreen12@users.noreply.github.com>
Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>
Co-authored-by: Raymond Zhou <56318341+rayzhou-bit@users.noreply.github.com>
Co-authored-by: ruzniaievdm <ruzniaievdm@gmail.com>
wowkalucky pushed a commit to raccoongang/frontend-app-course-authoring that referenced this pull request Aug 23, 2023
* feat: moving new commits from upstream repository (#62)

* feat: configuration for xpert unit summaries (openedx#540)

Adds setting modal for Xpert unit summaries

Includes hiding the config section for xpert summary - 
this is done based on a flag from edx/ai-aside@3d113d2

* fix: load up-to-date config on studio fetch (openedx#548)

* refactor: added PropTypes declarations

* feat: add files and uploads page (openedx#541)

* fix: remove env variable for files and uploads (openedx#549)

* Update verbiage for Xpert Settings (openedx#550)

* chore: Update verbiage for Xpert configuration screen

* fix: Change "generate" to "display" in xpert modal text

* fix: Updated learn more link

* fix: Change link and add targets

* test: added test cases for hide discussion tab (openedx#552)

Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>

* feat: upgrade frontend-lib-content-components (openedx#554)

* feat: bump frontend-lib-content-components (openedx#559)

* fix: Change wording to not crowd xpert tile in preferences page (openedx#560)

* fix: width and height of asset preview (openedx#558)

* feat: flcc to 1.168.0 (openedx#561)

* feat: bump frontend-lib-content-components (openedx#562)

* fix: overflow-y scroll behavior (openedx#565)

* test: added test cases of discussion restriction (openedx#556)

* test: added test cases of discussion restriction

* refactor: added null default value for dataTestId

---------

Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>

* fix: Add enabled badge to xpert settings tile  (openedx#566)

* feat: Add "Enabled" badge to xpert settings tile

* fix: Update model with state instead of non-existent prop from response

* feat: bump frontend-lib-content-components (openedx#569)

* feat: Added Schedule and Details MFE page (openedx#547)

* refactor: some refactoring

---------

Co-authored-by: David Nuon <davidnuongm@gmail.com>
Co-authored-by: Zachary Hancock <zhancock@edx.org>
Co-authored-by: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com>
Co-authored-by: sundasnoreen12 <72802712+sundasnoreen12@users.noreply.github.com>
Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>
Co-authored-by: Raymond Zhou <56318341+rayzhou-bit@users.noreply.github.com>
Co-authored-by: ruzniaievdm <ruzniaievdm@gmail.com>

* fix: Course updates - wrong datepicker value (#65)

* fix: [2u-631] fixed date checking

* fix: [2u-631] fixed validation schema

* fix: [2u-631] fixed indents

* feat: Course outline - Section highlights (#60)

* feat: [2u-336] add tests

* feat: [2u-271] fix button

* feat: [2u-336] add component, refactor header

* feat: [2u-342] add modal

* fix: [2u-342] fix translates and indents

* feat: [2u-342] add modal

* feat: [2u-342] add api

* feat: [2u-342] add tests and translates

* feat: [2u-342] fix indents

* fix: [2u-342] fix indents, variant and utils

* feat: [2u-342] fixed slice, thunks, hooks

* fix: [2u-342] fix translates

* fix: [2u-342] fix api

---------

Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>

* feat: create organization filter on home page

---------

Co-authored-by: Peter Kulko <93188219+PKulkoRaccoonGang@users.noreply.github.com>
Co-authored-by: David Nuon <davidnuongm@gmail.com>
Co-authored-by: Zachary Hancock <zhancock@edx.org>
Co-authored-by: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com>
Co-authored-by: sundasnoreen12 <72802712+sundasnoreen12@users.noreply.github.com>
Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>
Co-authored-by: Raymond Zhou <56318341+rayzhou-bit@users.noreply.github.com>
Co-authored-by: vladislavkeblysh <138868841+vladislavkeblysh@users.noreply.github.com>
Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>
snglth pushed a commit to Abstract-Tech/community-theme-course-authoring that referenced this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants