Skip to content
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
1 change: 1 addition & 0 deletions frontend/src/components/partners/currentProjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export function CurrentProjects({ currentProjects }) {
projectId={project.id}
priority={project.projectPriority}
organisation={project.organisationName}
showPriority={!project.sandbox}
/>
<div>
<h3
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/projectCard/projectCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function ProjectCard({
const showBottomButtonsHovered = showBottomButtons === true ? isHovered : false;
const bottomButtonSpacer = showBottomButtons ? 'pt3 pb4' : 'pv3';
const bottomButtonMargin = showBottomButtons ? 'project-card-with-btn' : 'project-card';
const showPriorityIndicator = !sandbox && !['DRAFT', 'ARCHIVED'].includes(status);

const bottomButtons = (
<div className="absolute bottom-0 w-100">
Expand Down Expand Up @@ -107,7 +108,7 @@ export function ProjectCard({
/>
</div>
<div className="">
{['DRAFT', 'ARCHIVED'].includes(status) ? (
{!showPriorityIndicator ? (
<ProjectStatusBox status={status} className={'pv1 ph1 dib'} />
) : (
<PriorityBox
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/projectDetail/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ import { ProjectStatusBox } from './statusBox';
import { EditButton } from '../button';
import { useEditProjectAllowed } from '../../hooks/UsePermissions';

export function HeaderLine({ author, projectId, priority, showEditLink, organisation }: Object) {
export function HeaderLine({
author,
projectId,
priority,
showEditLink,
organisation,
showPriority = true,
}: Object) {
const projectIdLink = (
<Link to={`/projects/${projectId}`} className="no-underline pointer">
<span className="blue-light">#{projectId}</span>
Expand All @@ -28,7 +35,7 @@ export function HeaderLine({ author, projectId, priority, showEditLink, organisa
<FormattedMessage {...messages.editProject} />
</EditButton>
)}
{priority && (
{priority && showPriority && (
<div className="mw4 dib">
<PriorityBox priority={priority} extraClasses={'pv2 ph3 ml2 f8'} showIcon />
</div>
Expand All @@ -50,6 +57,7 @@ export const ProjectHeader = ({ project, showEditLink }: Object) => {
priority={project.projectPriority}
organisation={project.organisationName}
showEditLink={showEditLink && userCanEditProject}
showPriority={!project.sandbox}
/>
<div>
<h3
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/components/projectEdit/descriptionForm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useContext } from 'react';
import { Tooltip } from 'react-tooltip';

import DatePicker from 'react-datepicker';
import 'react-datepicker/dist/react-datepicker.css';
import { FormattedMessage } from 'react-intl';
Expand Down Expand Up @@ -87,7 +89,11 @@ export const DescriptionForm = ({ languages }) => {
<FormattedMessage {...messages.priority} />
</label>
{projectPriorityOptions.map((option) => (
<label className="dib pr5" key={option.value}>
<label
className="dib pr5"
key={option.value}
data-tooltip-id={projectInfo.sandbox ? 'priority-disabled-tooltip' : ''}
>
<input
value={option.value}
checked={projectInfo.projectPriority === option.value}
Expand All @@ -97,12 +103,18 @@ export const DescriptionForm = ({ languages }) => {
projectPriority: option.value,
})
}
disabled={projectInfo.sandbox}
type="radio"
className={`radio-input input-reset pointer v-mid dib h2 w2 mr2 br-100 ba b--blue-light`}
/>
<FormattedMessage {...messages[`projectPriority${option.label}`]} />
</label>
))}
{projectInfo.sandbox && (
<Tooltip id="priority-disabled-tooltip" place="top">
<FormattedMessage {...messages.disabledSandboxPriority} />
</Tooltip>
)}
</div>
<div className={styleClasses.divClass}>
<InputLocale languages={languages} name="name" type="text" preview={false} maxLength={130}>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/projectEdit/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,4 +763,8 @@ export default defineMessages({
id: 'management.projects.create.review.database.sandbox',
defaultMessage: 'Sandbox',
},
disabledSandboxPriority: {
id: 'projects.formInputs.priority.disabled_sandbox',
defaultMessage: 'Priority cannot be changed for sandbox projects.',
},
});
1 change: 1 addition & 0 deletions frontend/src/components/taskSelection/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ export function TaskMapAction({ project, tasks, activeTasks, getTasks, action, e
author={project.author}
projectId={project.projectId}
organisation={project.organisationName}
showPriority={!project.sandbox}
/>
<div className="cf pb3">
<h3
Expand Down
Loading