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

TM-6053-Pub-Pos-Edit-UI #2987

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions src/Components/PostPage/PostPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Route, Switch } from 'react-router-dom';
import PropTypes from 'prop-types';
import PublishablePositions from 'Components/PublishablePositions/PublishablePositions';
import AvailableBidderContainer from 'Components/AvailableBidder/AvailableBidderContainer';
import PositionManager from '../BureauPage/PositionManager';
import PositionManagerDetails from '../BureauPage/PositionManagerDetails';
Expand All @@ -19,6 +20,7 @@ const PostPage = props => {
<Route path="/profile/post/availablebidders" render={() => <AvailableBidderContainer isCDO={false} isPost />} />
<Route path="/profile/post/biddingtool/:id" render={() => <BiddingTool />} />
<Route path="/profile/post/biddingtool/" render={() => <BiddingTool />} />
<Route path="/profile/post/publishablepositions" render={() => <PublishablePositions viewType="post" />} />
</Switch>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ exports[`ProfileMenuExpandedComponent matches snapshot when isGlossaryEditor is
search=""
title="Position Management"
/>
<withRouter(NavLink)
hidden={true}
iconName=" fa-newspaper-o"
key="Publishable Positions"
link="/profile/post/publishablepositions"
search=""
title="Publishable Positions"
/>
</withRouter(NavLink)>
<withRouter(NavLink)
expandedSection={
Expand Down Expand Up @@ -914,6 +922,14 @@ exports[`ProfileMenuExpandedComponent matches snapshot when user is bidcycle_adm
search=""
title="Position Management"
/>
<withRouter(NavLink)
hidden={true}
iconName=" fa-newspaper-o"
key="Publishable Positions"
link="/profile/post/publishablepositions"
search=""
title="Publishable Positions"
/>
</withRouter(NavLink)>
<withRouter(NavLink)
expandedSection={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const onRestore = (e) => {
};

const PublishablePositionCard = ({
data, onEditModeSearch, onSubmit, disableEdit,
data, onEditModeSearch, onSubmit, disableEdit, disableEditDetails,
additionalCallsLoading, onShowMorePP }) => {
// =============== Overview: View Mode ===============

Expand Down Expand Up @@ -154,6 +154,7 @@ const PublishablePositionCard = ({
<div className="position-form--input">
<label htmlFor="publishable-position-statuses">Publishable Status</label>
<select
disabled={disableEditDetails}
Copy link
Collaborator

Choose a reason for hiding this comment

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

so, the disabled checkbox for the Exclude button has a little no sign show on mouse hover + the disabled discoloration

image vs image

but, the publishable status looks the same if its disabled or not (this is in dark mode - light mode has a slight grey to the arrow.

image vs image

def not in the A/C's - but, it might be reasonable to make this distinction somewhat clear to the end user.

className="publishable-position-inputs"
id="publishable-position-statuses"
Comment on lines 158 to 159
Copy link
Collaborator

Choose a reason for hiding this comment

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

more of a comment - but, why do these have classes & ID's if there isn't any corresponding CSS for them?

defaultValue={status}
Expand Down Expand Up @@ -187,6 +188,7 @@ const PublishablePositionCard = ({
id="exclude-checkbox"
label="Exclude Position from Bid Audit"
value={exclude}
disabled={disableEditDetails}
onCheckBoxClick={e => setExclude(e)}
/>
{DETO_RWA_FLAG() &&
Expand Down Expand Up @@ -333,6 +335,7 @@ PublishablePositionCard.propTypes = {
cycles: BID_CYCLES.isRequired,
onEditModeSearch: PropTypes.func,
onSubmit: PropTypes.func,
disableEditDetails: PropTypes.bool,
disableEdit: PropTypes.bool,
additionalCallsLoading: PropTypes.bool,
filters: PropTypes.shape({
Expand All @@ -344,6 +347,7 @@ PublishablePositionCard.propTypes = {
PublishablePositionCard.defaultProps = {
onEditModeSearch: EMPTY_FUNCTION,
onSubmit: EMPTY_FUNCTION,
disableEditDetails: false,
disableEdit: false,
additionalCallsLoading: false,
onShowMorePP: EMPTY_FUNCTION,
Expand Down
3 changes: 2 additions & 1 deletion src/Components/PublishablePositions/PublishablePositions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ const PublishablePositions = ({ viewType }) => {
additionalCallsLoading={additionalDataIsLoading}
onEditModeSearch={editState =>
setEditMode(editState)}
disableEdit={editMode || (viewType === 'ao')}
disableEdit={editMode}
disableEditDetails={(viewType === 'bureau') || (viewType === 'post')}
onSubmit={editData => submitEdit(editData)}
filters={filters}
onShowMorePP={callAdditionalData}
Expand Down
9 changes: 9 additions & 0 deletions src/Constants/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,15 @@ export const GET_PROFILE_MENU = () => MenuConfig([
'post_user',
],
},
{
text: 'Publishable Positions',
route: '/profile/post/publishablepositions',
icon: ' fa-newspaper-o',
roles: [
'superuser',
'post_user',
],
},
checkFlag('flags.bidding_tool') ?
{
text: 'Bidding Tool',
Expand Down
4 changes: 4 additions & 0 deletions src/sass/_positionContent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@
}
}

.publishable-position-inputs:disabled {
cursor: not-allowed;
}

.position-form {
.position-form--heading {
display: flex;
Expand Down
Loading