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

Tasks select and map/validate views #2035

Merged
merged 1 commit into from
Dec 13, 2019
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
5 changes: 4 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ListTeams, CreateTeam, EditTeam } from './views/teams';
import { ListCampaigns, CreateCampaign, EditCampaign } from './views/campaigns';
import { NotFound } from './views/notFound';
import { SelectTask } from './views/taskSelection';
import { MapTask, ValidateTask } from './views/taskAction';
import { EmailVerification } from './views/verifyEmail';
import { ProjectEdit } from './views/projectEdit';

Expand Down Expand Up @@ -63,7 +64,9 @@ function App() {
<ProjectEdit path="manage/projects/:id" />
<ManageProjectsPage path="manage/projects/" />
<ManageProjectsPage path="projects/" />
<SelectTask path="projects/:id/map" />
<SelectTask path="projects/:id/tasks" />
<MapTask path="projects/:id/map" />
<ValidateTask path="projects/:id/validate" />
<ProjectDetailPage path="projects/:id" />
<Redirect from="project/:id" to="projects/:id" noThrow />
<NotFound default />
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/assets/styles/_extra.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
.vh-minus-200-ns {
height: calc(100vh - 200px);
}
.vh-minus-122-ns {
height: calc(100vh - 122px);
}
}

@media screen and (min-width: 66rem) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/button.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';

export function Button({ onClick, children, className }: Object) {
export function Button({ onClick, children, className, disabled }: Object) {
return (
<button
onClick={onClick}
aria-pressed="false"
focusindex="0"
className={`${className || ''} br1 f5 bn pointer`}
className={`${className || ''} br1 f5 bn ${disabled ? 'o-50' : 'pointer'}`}
style={{ padding: '.75rem 1.5rem' }}
>
{children}
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ const socialNetworks = [
];

export function Footer({ location }: Object) {
if (
location.pathname.endsWith('/map') ||
location.pathname.endsWith('/map/') ||
location.pathname.endsWith('/validate') ||
location.pathname.endsWith('/validate/') ||
location.pathname.endsWith('/new') ||
location.pathname.endsWith('/new/')
) {
const noFooterViews = [
'tasks',
'map',
'validate',
'new'
];
const activeView = location.pathname.split('/').filter(i => i !== "").splice(-1)[0];
if (noFooterViews.includes(activeView)) {
return <></>;
} else {
return (
Expand Down
13 changes: 3 additions & 10 deletions frontend/src/components/projectDetail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import DueDateBox from '../projectcard/dueDateBox';
import { MappingLevelMessage } from '../mappingLevel';

import { TasksMap } from '../taskSelection/map.js';
import { HeaderLine } from '../taskSelection';
import { HeaderLine, TagLine } from '../taskSelection';
import { MappingTypes } from '../mappingTypes';
import { Imagery } from '../taskSelection/imagery';

import { htmlFromMarkdown } from './htmlFromMarkdown';
import { htmlFromMarkdown } from '../../utils/htmlFromMarkdown';
import { NewMapperFlow } from './newMapperFlow';
import { ShowReadMoreButton } from './showReadMoreButton';
import { ProjectDetailFooter } from './projectDetailFooter';
Expand Down Expand Up @@ -81,7 +81,6 @@ const ProjectDetailMap = props => {
taskBordersMap={taskBordersGeoJSON}
taskCentroidMap={centroidGeoJSON}
taskBordersOnly={taskBordersOnly}
projectId={props.project.projectId}
disableScrollZoom={true}
navigate={props.navigate}
type={props.type}
Expand Down Expand Up @@ -138,13 +137,7 @@ export const ProjectDetailLeft = props => {
<h3 className="f2 fw6 mt2 mb3 ttu barlow-condensed blue-dark">
{props.project.projectInfo && props.project.projectInfo.name}
</h3>
<span className="blue-light">{props.project.campaignTag}</span>
{props.project.countryTag && (
<span className="blue-light">
<span className="ph2">&#183;</span>
{props.project.countryTag.map(country => country).join(', ')}
</span>
)}
< TagLine campaigns={props.project.campaigns} countries={props.project.countryTag} />
</div>
<section className={`lh-copy h5 overflow-x-scroll`}>
<div className="pr2" dangerouslySetInnerHTML={htmlShortDescription} />
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/projectDetail/newMapperFlow.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { TaskSelectionIcon, AreaIcon, SubmitWorkIcon } from '../svgIcons';
import messages from './messages';
import { FormattedMessage } from 'react-intl';

import messages from './messages';
import { TaskSelectionIcon, AreaIcon, SubmitWorkIcon } from '../svgIcons';

function MappingCard({ image, title, description }: Object) {
return (
<div className="db ph2-l pb3 w-100">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ProjectDetailFooter = props => {
<AddToFavorites projectId={props.projectId} />
</div>
<div className="dib w-40 tr fr">
<Link to={`./map`} className="">
<Link to={`./tasks`} className="">
<Button className="white bg-red h3 w-100">
<FormattedMessage {...messages.contribute} />
</Button>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/projectcard/dueDateBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import humanizeDuration from 'humanize-duration';
import { ClockIcon } from '../svgIcons';
import messages from './messages';

export function DueDateBox({ intl, dueDate }: Object) {
function DueDateBox({ intl, dueDate, align="right" }: Object) {
if (dueDate === undefined) {
return null;
} else if (new Date(dueDate) === undefined) {
Expand All @@ -16,7 +16,7 @@ export function DueDateBox({ intl, dueDate }: Object) {

if (milliDifference > 0) {
return (
<span className="fr relative w-40 lh-solid f7 tr br1 link ph1 pv2 bg-grey-light blue-grey truncate mw4">
<span className={`relative w-40 lh-solid f7 tr br1 link ph1 pv2 bg-grey-light blue-grey truncate mw4 ${align === 'right' ? 'fr' : 'fl'}`}>
<span>
<ClockIcon className="absolute pl1 top-0 pt1 left-0" />
</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/projectcard/projectCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function ProjectCard({
<FormattedMessage {...messages.editProject} />
</Link>
<Link
to={`/projects/${projectId}/map`}
to={`/projects/${projectId}/tasks`}
className={`fr f6 di w-50 tc bg-red white bn ${linkCombo}`}
>
<FormattedMessage {...messages.projectTasks} />
Expand Down
Loading