-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
1646 visibility and status #1815
Conversation
@@ -1,27 +1,54 @@ | |||
import React from "react"; | |||
import PropTypes from "prop-types"; | |||
import "react-datepicker/dist/react-datepicker.css"; | |||
import { MdFilterAlt } from "react-icons/md"; | |||
import { MdFilterList } from "react-icons/md"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably got the idea for this icon from the prototype, but, the prototype is several months old, and the design team has changed the icons they want to use in the design guide See https://docs.google.com/presentation/d/1I4q35NL2WW2RpksIyawhHCd8qJnrjme1ZDNIBxu24hQ/edit#slide=id.g2e77662f2ce_0_10 page 17. The upshot is that you need to change the icon back to MdFilterAlt.
criteria, | ||
setCriteria, | ||
order, | ||
orderBy, | ||
setSort, | ||
setCheckedProjectIds, | ||
setSelectAllChecked | ||
setSelectAllChecked, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want any of these five new props. You should be getting and setting criteria via the criteria and setCriteria props.
@@ -4,6 +4,7 @@ import Button from "../../Button/Button"; | |||
import RadioButton from "../../UI/RadioButton"; | |||
import "react-datepicker/dist/react-datepicker.css"; | |||
import { MdClose } from "react-icons/md"; | |||
import UniversalSelect from "../../UI/UniversalSelect"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just figured out a day or two ago that the UniversalSelect control is not working. If it is used as a controlled input, it does not not track the existing controlled value when it is first rendered. We need to either fix it, or go back to using a standard react control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was what resulted in me going out of scope for this task. I discovered that when I attempted to change the sorting option, it would reset the filter option. I believe that the issue was that the StatusPopup component was being rendered each time, and so the existing controlled value was lost. I decided the best approach to fixing this was to save that value in state of the Project page.
@@ -4,6 +4,7 @@ import Button from "../../Button/Button"; | |||
import RadioButton from "../../UI/RadioButton"; | |||
import "react-datepicker/dist/react-datepicker.css"; | |||
import { MdClose } from "react-icons/md"; | |||
import UniversalSelect from "../../UI/UniversalSelect"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prototype calls for using a set of Radio Buttons, so you don't need a select drop-down. As we discussed last week, the search box in the prototype does not make sense and should be dropped.
@@ -41,6 +49,9 @@ const VisibilityPopup = ({ | |||
close(); | |||
}; | |||
|
|||
const handleChangeVisibility = visibilityValue => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want to apply the change to the filter when the user picks a choice from the list - need to wait until they click on the Apply button.
<span style={{ color: "red" }}>-Deleted</span> | ||
</span> | ||
); | ||
return <span>{formatDate(project.dateTrashed)}</span>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why you moved the deleted indicator to the visibility column. Maybe you misunderstood our conversation last week where I pointed out that the Date Modified column is where you would see that the deleted date is displayed if the project is deleted, per Emily's request, but we don't want to move it to the Status column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this one, I refered to the figma and checklist of action items.
Link to prototype:
@@ -733,16 +746,29 @@ const ProjectsPage = ({ contentContainerRef }) => { | |||
<tr className={classes.tr}> | |||
{headerData.map(header => { | |||
return ( | |||
<td key={header.id}> | |||
<td |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess what you are trying to do here is change the header appearance while it's corresponding popup is open. This is outside the scope of this issue, and will be addressed by a separate issue, but if we wanted to do this, you don't need any new props at all. The reactjs-popup has a feature that allows you to change the trigger (i.e. Column Header appearance, depending on whether the popup is open or not - See the Trigger section on the page https://react-popup.elazizi.com/component-api
@@ -72,7 +118,10 @@ const StatusPopup = ({ | |||
/> | |||
<hr style={{ width: "100%" }} /> | |||
</div> | |||
<div>(Under Construction)</div> | |||
<UniversalSelect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need two controls on this popup. One controls criteria.type, which should have possible values ["draft", "snapshot", or "all"]. This should probably be a set of radio buttons, with the labels ["Draft", "Snapshot", "Draft and Snapshot"]. It could also be done as a drop-down list, but my preference would be radio buttons, since there are only three choices, and a choice can be made with a single click.
The second controls criteria.status, which should have possible values of ["active", "deleted" or "all"], which I would prefer to see as another set of Radio Buttons, but to be somewhat consistent with the prototype, we can make it a checkbox, where unchecked sets criteria.status to "all" and checked sets the criteria.type to "active". Note that it is not possible to set the criteria.status to "deleted" to see only deleted projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is a lot more complicated than the issue calls for, and tries to implement changes outside the scope of the issue. I'd like you to try again. This time:
- Do not make changes to any components except VisibilityPopup and StatusPopup. For this issue, you should not need to add any props to either component.
- Make sure that filter and sorting criteria are not applied until the user clicks the Apply button.
- The Visibility Popup should use a set of three radio buttons to do specify the filtering as in the prototype, but you should omit the superfluous textbox found in the prototype.
- The Status Popup should be different from the prototype and use a set of three radio buttons to choose "Draft", "Snapshot or "Draft and Snapshot". There should be a checkbox like the prototype that is labelled "Deleted Projects". If it is checked, then show both active and deleted projects, if it unchecked, only show active projects.
Fixes #1646
What changes did you make?
-Edited CSS for table header.
-Edited color change for header when a filter dropdown is selected
-Implemented filter functionality for Visibility Column
-Implemented filter functionality for Status Column
-Removed "deleted" from modified date
-Moved "delete" test to status column and changed the background for deleted rows.
Why did you make the changes (we will use this info to test)?
Part of the revamp for the filtering.
Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)