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

feat: adding new description for instructions and remove features #30

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Change Log
Unreleased
**********

0.6.1 - 2023-11-28
**********************************************

Added
=====

* Update description and remove features for the instructions

0.6.0 - 2023-11-28
**********************************************

Expand Down
2 changes: 1 addition & 1 deletion filesmanager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Init for the FilesManagerXBlock package.
"""

__version__ = '0.6.0'
__version__ = '0.6.1'
2 changes: 1 addition & 1 deletion filesmanager/static/html/bundle.js

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions react-app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import Collapse from '@components/Collapse';
import xBlockContext from '@constants/xBlockContext';

import {
basicFeatures,
basicDescriptionInstructions,
advancedDescriptionInstructions,
basicShortCuts,
basicNotes,
advancedFeatures,
advancedShortCuts,
advancedNotes
} from './constants';
Expand All @@ -30,9 +30,9 @@ const App = () => {
const directoryTree = contentHasId ? convertTreeToNewFileMapFormat(contents, true) : {};
const rootFolderId = contentHasId ? contents.id : null;
const errorHandlerDirectoriesMessage = gettext('There was an error while processing the directories tree');
const featuresList = isEditView ? addIdToItems(advancedFeatures) : addIdToItems(basicFeatures);
const shortCutsList = isEditView ? addIdToItems(advancedShortCuts) : addIdToItems(basicShortCuts);
const notesList = isEditView ? addIdToItems(advancedNotes) : addIdToItems(basicNotes);
const descriptionInstructions = isEditView ? advancedDescriptionInstructions : basicDescriptionInstructions;

if (error) return <ErrorMessage message={errorHandlerDirectoriesMessage} />;
if (isLoading) return <Spinner />;
Expand All @@ -41,16 +41,8 @@ const App = () => {
<div className="filesmanager__app">
<Collapse title={gettext('Instructions')}>
<p className="instructions-description">
{gettext(
"Through this XBlock, you'll be able to see a tree structure of folders and files where you can perform the following actions:"
)}
{gettext(descriptionInstructions)}
</p>
<h4 className="instructions-title">{gettext('Features')}</h4>
<ul className="instructions-list">
{featuresList.map(({ id, name }) => (
<li key={id}>{gettext(name)}</li>
))}
</ul>
<h4 className="instructions-title">{gettext('Shortcuts')}</h4>
<ul className="instructions-list">
{shortCutsList.map(({ id, name }) => (
Expand Down
15 changes: 3 additions & 12 deletions react-app/constants.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
export const basicFeatures = ['View a list of folders and files', 'Navigate through folders', 'Download files', 'Preview files', 'Search files by name', 'Select files and/or folders'];
export const basicDescriptionInstructions = 'Use this component to upload and organize files that students can access directly in the unit.';
export const advancedDescriptionInstructions = `${basicDescriptionInstructions} Any files you upload will be added to the "File and uploads" section. Extracting files from the "unpublished" folder leaves them visible to students, returning them to the folder hides them.`;

export const basicShortCuts = ['Open a file (Ctrl + O)', 'Select multiple files or folders (Ctrl + click)'];
export const basicNotes = ['Preview is only allowed for image files (JPEG/JPG, PNG, SVG) and PDFs'];

export const advancedFeatures = [
...basicFeatures,
'Select files and/or folders',
'Upload files',
'Create folders',
'Rename folders',
'Delete folders',
'Delete files',
'Move files between folders',
'Move folders'
];

export const advancedShortCuts = [
...basicShortCuts,
Expand Down