generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: solve issues found when testing use cases (#17)
* refactor: add course id to the courses list * refactor: sort the courses list alphabetically * refactor: show user in each validation process event * refactor: show reason field only when the is a reason * refactor: improve some labels, messages & remove properties unused * refactor: sort past events according to the date of creation * refactor: remove reason column from main table * fix: receive only the courses current user is staff * fix: show course author properly in the validation process * refactor: change category field value to number * fix: add custom option to allow using form fields * refactor: add subtitle to clarify the table source * refactor: clarify some messages * feat: update validation bodies according with course id * fix: styles in course selector and fix a typo * refactor: show username if user have no name * feat: update validation bodies according with course id --------- Co-authored-by: Diana Catalina Olarte <diana.olarte@edunext.co>
- Loading branch information
Showing
16 changed files
with
185 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,42 @@ | ||
import PropTypes from 'prop-types'; | ||
import RecordItem from './RecordItem'; | ||
|
||
const Timeline = ({ pastProcessEvents, validationBody }) => ( | ||
const Timeline = ({ pastProcessEvents, validationBody, availableReasons }) => ( | ||
<ul className="px-2"> | ||
{pastProcessEvents.map((processEvent, index) => ( | ||
<RecordItem | ||
key={`validationEvent-${processEvent.createdAt}-${processEvent.user}`} | ||
{...processEvent} | ||
validationBody={validationBody} | ||
first={index === 0} | ||
last={index === pastProcessEvents.length - 1} | ||
/> | ||
))} | ||
{pastProcessEvents.map((processEvent, index) => { | ||
const processEventWithReasonName = { | ||
...processEvent, | ||
reason: availableReasons?.find((reason) => reason.id === processEvent?.reason)?.name, | ||
}; | ||
return ( | ||
<RecordItem | ||
key={`validationEvent-${processEvent.createdAt}-${processEvent.user}`} | ||
{...processEventWithReasonName} | ||
validationBody={validationBody} | ||
first={index === 0} | ||
last={index === pastProcessEvents.length - 1} | ||
/> | ||
); | ||
})} | ||
</ul> | ||
); | ||
|
||
Timeline.propTypes = { | ||
pastProcessEvents: PropTypes.arrayOf(Object), | ||
validationBody: PropTypes.string.isRequired, | ||
availableReasons: PropTypes.arrayOf( | ||
PropTypes.shape( | ||
{ | ||
name: PropTypes.string, | ||
id: PropTypes.number, | ||
}, | ||
), | ||
), | ||
}; | ||
|
||
Timeline.defaultProps = { | ||
pastProcessEvents: [], | ||
availableReasons: [], | ||
}; | ||
|
||
export default Timeline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.