Skip to content

Commit e05be8b

Browse files
authored
Merge pull request #1008 from mapswipe/dev
Release - 2025 March
2 parents b188ab9 + 1c0e540 commit e05be8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3248
-52
lines changed

.github/workflows/actions.yml

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
POSTGRES_DB: postgres
8181
OSMCHA_API_KEY: ${{ secrets.OSMCHA_API_KEY }}
8282
DJANGO_SECRET_KEY: test-django-secret-key
83+
MAPILLARY_API_KEY: ${{ secrets.MAPILLARY_API_KEY }}
8384
COMPOSE_FILE: ../docker-compose.yaml:../docker-compose-ci.yaml
8485
run: |
8586
docker compose run --rm mapswipe_workers_creation python -m unittest discover --verbose --start-directory tests/unittests/

django/apps/existing_database/models.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class Type(models.IntegerChoices):
6666
FOOTPRINT = 2, "Validate"
6767
CHANGE_DETECTION = 3, "Compare"
6868
COMPLETENESS = 4, "Completeness"
69+
MEDIA = 5, "Media"
70+
DIGITIZATION = 6, "Digitization"
71+
STREET = 7, "Street"
6972

7073
project_id = models.CharField(primary_key=True, max_length=999)
7174
created = models.DateTimeField(blank=True, null=True)
@@ -127,7 +130,7 @@ class Task(Model):
127130
project = models.ForeignKey(Project, models.DO_NOTHING, related_name="+")
128131
group_id = models.CharField(max_length=999)
129132
task_id = models.CharField(max_length=999)
130-
geom = gis_models.MultiPolygonField(blank=True, null=True)
133+
geom = gis_models.GeometryField(blank=True, null=True)
131134
# Database uses JSON instead of JSONB (not supported by django)
132135
project_type_specifics = models.TextField(blank=True, null=True)
133136

django/schema.graphql

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ enum ProjectTypeEnum {
9797
FOOTPRINT
9898
CHANGE_DETECTION
9999
COMPLETENESS
100+
MEDIA
101+
DIGITIZATION
102+
STREET
100103
}
101104

102105
type ProjectTypeSwipeStatsType {

docker-compose.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ x-mapswipe-workers: &base_mapswipe_workers
7676
SLACK_CHANNEL: '${SLACK_CHANNEL}'
7777
SENTRY_DSN: '${SENTRY_DSN}'
7878
OSMCHA_API_KEY: '${OSMCHA_API_KEY}'
79+
MAPILLARY_API_KEY: '${MAPILLARY_API_KEY}'
7980
depends_on:
8081
- postgres
8182
volumes:

example.env

+3
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,6 @@ COMMUNITY_DASHBOARD_GRAPHQL_ENDPOINT=https://api.example.com/graphql/
7575
COMMUNITY_DASHBOARD_SENTRY_DSN=
7676
COMMUNITY_DASHBOARD_SENTRY_TRACES_SAMPLE_RATE=
7777
COMMUNITY_DASHBOARD_MAPSWIPE_WEBSITE=https://mapswipe.org
78+
79+
# Mapillary
80+
MAPILLARY_API_KEY=

manager-dashboard/app/Base/configs/projectTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
PROJECT_TYPE_BUILD_AREA,
44
PROJECT_TYPE_FOOTPRINT,
55
PROJECT_TYPE_CHANGE_DETECTION,
6+
PROJECT_TYPE_STREET,
67
PROJECT_TYPE_COMPLETENESS,
78
} from '#utils/common';
89

@@ -15,6 +16,7 @@ const mapswipeProjectTypeOptions: {
1516
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Find' },
1617
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Validate' },
1718
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Compare' },
19+
{ value: PROJECT_TYPE_STREET, label: 'Street' },
1820
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
1921
];
2022

manager-dashboard/app/Base/styles.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,14 @@ p {
122122
--line-height-relaxed: 1.625;
123123
--line-height-loose: 2;
124124

125-
126125
--shadow-card: 0 2px 4px -2px var(--color-shadow);
127126

128127
--duration-transition-medium: .2s;
129128

129+
--color-background-hover-light: rgba(0, 0, 0, .04);
130+
--width-calendar-date: 2.4rem;
131+
132+
--opacity-watermark: 0.3;
133+
--color-text-disabled: rgba(0, 0, 0, .3);
134+
130135
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import React from 'react';
2+
import { _cs } from '@togglecorp/fujs';
3+
4+
import RawButton, { Props as RawButtonProps } from '../../RawButton';
5+
import { ymdToDateString, typedMemo } from '../../../utils/common.tsx';
6+
7+
import styles from './styles.css';
8+
9+
export interface Props {
10+
className?: string;
11+
year: number;
12+
month: number;
13+
date: number;
14+
currentYear: number;
15+
currentMonth: number;
16+
activeDate?: string;
17+
currentDate: number;
18+
onClick?: (year: number, month: number, date: number) => void;
19+
elementRef?: RawButtonProps<undefined>['elementRef'];
20+
ghost?: boolean;
21+
}
22+
23+
function CalendarDate(props: Props) {
24+
const {
25+
className,
26+
year,
27+
month,
28+
date,
29+
currentYear,
30+
currentMonth,
31+
currentDate,
32+
onClick,
33+
elementRef,
34+
activeDate,
35+
ghost,
36+
} = props;
37+
38+
const handleClick = React.useCallback(() => {
39+
if (onClick) {
40+
onClick(year, month, date);
41+
}
42+
}, [year, month, date, onClick]);
43+
44+
const dateString = ymdToDateString(year, month, date);
45+
46+
return (
47+
<RawButton
48+
elementRef={elementRef}
49+
name={date}
50+
className={_cs(
51+
styles.date,
52+
year === currentYear
53+
&& month === currentMonth
54+
&& currentDate === date
55+
&& styles.today,
56+
dateString === activeDate && styles.active,
57+
ghost && styles.ghost,
58+
className,
59+
)}
60+
onClick={handleClick}
61+
>
62+
{date}
63+
</RawButton>
64+
65+
);
66+
}
67+
68+
export default typedMemo(CalendarDate);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.date {
2+
border-radius: 50%;
3+
width: var(--width-calendar-date);
4+
height: var(--width-calendar-date);
5+
6+
&.today {
7+
color: var(--color-accent);
8+
font-weight: var(--font-weight-bold);
9+
}
10+
11+
&:hover {
12+
background-color: var(--color-background-hover-light);
13+
}
14+
15+
&.active {
16+
background-color: var(--color-accent);
17+
color: var(--color-text-on-dark);
18+
pointer-events: none;
19+
}
20+
21+
&.ghost {
22+
opacity: 0.5;
23+
}
24+
}
25+

0 commit comments

Comments
 (0)