Skip to content

Commit 2bc325d

Browse files
authored
Merge pull request #877 from mapswipe/fix/bug-fixes
Validation fix
2 parents 0db8a56 + 4922ad4 commit 2bc325d

File tree

11 files changed

+446
-90
lines changed

11 files changed

+446
-90
lines changed

manager-dashboard/app/components/AlertBanner/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,36 @@ import React from 'react';
22
import { IoAlertCircleOutline } from 'react-icons/io5';
33
import { _cs } from '@togglecorp/fujs';
44

5+
import Heading from '#components/Heading';
6+
57
import styles from './styles.css';
68

79
interface Props {
810
className?: string;
11+
title?: React.ReactNode;
912
children: React.ReactNode;
1013
}
1114

1215
function AlertBanner(props: Props) {
1316
const {
1417
className,
1518
children,
19+
title,
1620
} = props;
1721

1822
return (
1923
<div className={_cs(styles.banner, className)}>
2024
<div className={styles.bannerIcon}>
2125
<IoAlertCircleOutline />
2226
</div>
23-
{children}
27+
<div className={styles.container}>
28+
{title && (
29+
<Heading>
30+
{title}
31+
</Heading>
32+
)}
33+
{children}
34+
</div>
2435
</div>
2536
);
2637
}

manager-dashboard/app/components/AlertBanner/styles.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@
88
.banner-icon {
99
font-size: var(--font-size-super-large);
1010
}
11-
}
11+
12+
.container {
13+
display: flex;
14+
flex-direction: column;
15+
gap: var(--spacing-small);
16+
}
17+
}

manager-dashboard/app/components/GeoJsonPreview/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ function GeoJsonPreview(props: Props) {
8989
const layer = new Layer(
9090
finalUrl,
9191
{
92+
// NOTE: we have a limit of 22
93+
maxZoom: 22,
9294
// attribution: '',
9395
// subdomains: ['a', 'b', 'c'],
9496
},
4.2 KB
Loading

manager-dashboard/app/utils/common.tsx

Lines changed: 68 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import twoTapIcon from '#resources/icons/2_Tap_Black.png';
3535
import threeTapIcon from '#resources/icons/3_Tap_Black.png';
3636
import tapIcon from '#resources/icons/tap_icon.png';
3737
import angularTapIcon from '#resources/icons/tap_icon_angular.png';
38+
import swipeIcon from '#resources/icons/swipeleft_icon_black.png';
3839

3940
export function valueSelector<T>(item: { value: T }) {
4041
return item.value;
@@ -76,37 +77,38 @@ export const projectTypeLabelMap: {
7677
[PROJECT_TYPE_COMPLETENESS]: 'Completeness',
7778
};
7879

79-
export type IconKey = 'addOutline'
80-
| 'alertOutline'
81-
| 'banOutline'
82-
| 'checkmarkOutline'
83-
| 'closeOutline'
84-
| 'eggOutline'
85-
| 'ellipseOutline'
86-
| 'flagOutline'
87-
| 'handLeftOutline'
88-
| 'handRightOutline'
89-
| 'happyOutline'
90-
| 'heartOutline'
91-
| 'helpOutline'
92-
| 'informationOutline'
93-
| 'prismOutline'
94-
| 'refreshOutline'
95-
| 'removeOutline'
96-
| 'sadOutline'
97-
| 'searchOutline'
98-
| 'shapesOutline'
99-
| 'squareOutline'
100-
| 'starOutline'
101-
| 'thumbsDownOutline'
102-
| 'thumbsUpOutline'
103-
| 'triangleOutline'
104-
| 'warningOutline'
105-
| 'generalTap'
80+
export type IconKey = 'add-outline'
81+
| 'alert-outline'
82+
| 'ban-outline'
83+
| 'check'
84+
| 'close-outline'
85+
| 'egg-outline'
86+
| 'ellipse-outline'
87+
| 'flag-outline'
88+
| 'hand-left-outline'
89+
| 'hand-right-outline'
90+
| 'happy-outline'
91+
| 'heart-outline'
92+
| 'help-outline'
93+
| 'information-outline'
94+
| 'prism-outline'
95+
| 'refresh-outline'
96+
| 'remove-outline'
97+
| 'sad-outline'
98+
| 'search-outline'
99+
| 'shapes-outline'
100+
| 'square-outline'
101+
| 'star-outline'
102+
| 'thumbs-down-outline'
103+
| 'thumbs-up-outline'
104+
| 'triangle-outline'
105+
| 'warning-outline'
106+
| 'general-tap'
106107
| 'tap'
107-
| 'oneTap'
108-
| 'twoTap'
109-
| 'threeTap';
108+
| 'tap-1'
109+
| 'tap-2'
110+
| 'tap-3'
111+
| 'swipe-left';
110112

111113
export interface IconItem {
112114
key: IconKey;
@@ -132,137 +134,137 @@ function getPngIcon(src: string, alt: string) {
132134

133135
export const iconList: IconItem[] = [
134136
{
135-
key: 'addOutline',
137+
key: 'add-outline',
136138
label: 'Add',
137139
component: IoAddOutline,
138140
},
139141
{
140-
key: 'alertOutline',
142+
key: 'alert-outline',
141143
label: 'Alert',
142144
component: IoAlertOutline,
143145
},
144146
{
145-
key: 'banOutline',
147+
key: 'ban-outline',
146148
label: 'Ban',
147149
component: IoBanOutline,
148150
},
149151
{
150-
key: 'checkmarkOutline',
151-
label: 'Checkmark',
152+
key: 'check',
153+
label: 'Check',
152154
component: IoCheckmarkOutline,
153155
},
154156
{
155-
key: 'closeOutline',
157+
key: 'close-outline',
156158
label: 'Close',
157159
component: IoCloseOutline,
158160
},
159161
{
160-
key: 'eggOutline',
162+
key: 'egg-outline',
161163
label: 'Egg',
162164
component: IoEggOutline,
163165
},
164166
{
165-
key: 'ellipseOutline',
167+
key: 'ellipse-outline',
166168
label: 'Ellipse',
167169
component: IoEllipseOutline,
168170
},
169171
{
170-
key: 'flagOutline',
172+
key: 'flag-outline',
171173
label: 'Flag',
172174
component: IoFlagOutline,
173175
},
174176
{
175-
key: 'handLeftOutline',
177+
key: 'hand-left-outline',
176178
label: 'Hand Left',
177179
component: IoHandLeftOutline,
178180
},
179181
{
180-
key: 'handRightOutline',
182+
key: 'hand-right-outline',
181183
label: 'Hand Right',
182184
component: IoHandRightOutline,
183185
},
184186
{
185-
key: 'happyOutline',
187+
key: 'happy-outline',
186188
label: 'Happy',
187189
component: IoHappyOutline,
188190
},
189191
{
190-
key: 'heartOutline',
192+
key: 'heart-outline',
191193
label: 'Heart',
192194
component: IoHeartOutline,
193195
},
194196
{
195-
key: 'helpOutline',
197+
key: 'help-outline',
196198
label: 'Help',
197199
component: IoHelpOutline,
198200
},
199201
{
200-
key: 'informationOutline',
202+
key: 'information-outline',
201203
label: 'Information',
202204
component: IoInformationOutline,
203205
},
204206
{
205-
key: 'prismOutline',
207+
key: 'prism-outline',
206208
label: 'Prism',
207209
component: IoPrismOutline,
208210
},
209211
{
210-
key: 'refreshOutline',
212+
key: 'refresh-outline',
211213
label: 'Refresh',
212214
component: IoRefreshOutline,
213215
},
214216
{
215-
key: 'removeOutline',
217+
key: 'remove-outline',
216218
label: 'Remove',
217219
component: IoRemoveOutline,
218220
},
219221
{
220-
key: 'sadOutline',
222+
key: 'sad-outline',
221223
label: 'Sad',
222224
component: IoSadOutline,
223225
},
224226
{
225-
key: 'searchOutline',
227+
key: 'search-outline',
226228
label: 'Search',
227229
component: IoSearchOutline,
228230
},
229231
{
230-
key: 'shapesOutline',
232+
key: 'shapes-outline',
231233
label: 'Shapes',
232234
component: IoShapesOutline,
233235
},
234236
{
235-
key: 'squareOutline',
237+
key: 'square-outline',
236238
label: 'Square',
237239
component: IoSquareOutline,
238240
},
239241
{
240-
key: 'starOutline',
242+
key: 'star-outline',
241243
label: 'Star',
242244
component: IoStarOutline,
243245
},
244246
{
245-
key: 'thumbsDownOutline',
247+
key: 'thumbs-down-outline',
246248
label: 'Thumbs Down',
247249
component: IoThumbsDownOutline,
248250
},
249251
{
250-
key: 'thumbsUpOutline',
252+
key: 'thumbs-up-outline',
251253
label: 'Thumbs Up',
252254
component: IoThumbsUpOutline,
253255
},
254256
{
255-
key: 'triangleOutline',
257+
key: 'triangle-outline',
256258
label: 'Triangle',
257259
component: IoTriangleOutline,
258260
},
259261
{
260-
key: 'warningOutline',
262+
key: 'warning-outline',
261263
label: 'Warning',
262264
component: IoWarningOutline,
263265
},
264266
{
265-
key: 'generalTap',
267+
key: 'general-tap',
266268
label: 'General Tap',
267269
component: getPngIcon(tapIcon, 'general tap'),
268270
},
@@ -272,20 +274,25 @@ export const iconList: IconItem[] = [
272274
component: getPngIcon(angularTapIcon, 'tap'),
273275
},
274276
{
275-
key: 'oneTap',
277+
key: 'tap-1',
276278
label: '1-Tap',
277279
component: getPngIcon(oneTapIcon, 'one tap'),
278280
},
279281
{
280-
key: 'twoTap',
282+
key: 'tap-2',
281283
label: '2-Tap',
282284
component: getPngIcon(twoTapIcon, 'two tap'),
283285
},
284286
{
285-
key: 'threeTap',
287+
key: 'tap-3',
286288
label: '3-Tap',
287289
component: getPngIcon(threeTapIcon, 'three tap'),
288290
},
291+
{
292+
key: 'swipe-left',
293+
label: 'Swipe Left',
294+
component: getPngIcon(swipeIcon, 'swipe left'),
295+
},
289296
];
290297

291298
export const iconMap = listToMap(

manager-dashboard/app/views/NewTutorial/CustomOptionInput/CustomOptionPreview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function CustomOptionPreview(props: Props) {
3030
{value?.map((option, index) => {
3131
const Icon = option.icon
3232
? iconMap[option.icon]
33-
: iconMap.flagOutline;
33+
: iconMap['flag-outline'];
3434

3535
const previewText = [
3636
option.title || `{option ${index + 1}}`,

manager-dashboard/app/views/NewTutorial/CustomOptionInput/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default function CustomOptionInput(props: Props) {
146146
{/* FIXME: use accordion open by default */}
147147
<div className={styles.subOptions}>
148148
<Heading level={5}>
149-
Sub Options
149+
Sub-options
150150
</Heading>
151151
<NonFieldError
152152
error={subOptionsError}
@@ -164,7 +164,7 @@ export default function CustomOptionInput(props: Props) {
164164
/>
165165
))}
166166
{!value.subOptions?.length && (
167-
<div>No sub options</div>
167+
<div>No sub-options</div>
168168
)}
169169
{!readOnly && (
170170
<Button
@@ -175,7 +175,7 @@ export default function CustomOptionInput(props: Props) {
175175
// FIXME: use constant from utils
176176
disabled={disabled || (value.subOptions && value.subOptions.length >= 6)}
177177
>
178-
Add Sub Option
178+
Add Sub-option
179179
</Button>
180180
)}
181181
</div>

manager-dashboard/app/views/NewTutorial/ScenarioPageInput/FootprintGeoJsonPreview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function FootprintGeoJsonPreview(props: Props) {
6969
{customOptions?.map((option) => {
7070
const Icon = option.icon
7171
? iconMap[option.icon]
72-
: iconMap.flagOutline;
72+
: iconMap['flag-outline'];
7373
return (
7474
<div
7575
key={option.optionId}

0 commit comments

Comments
 (0)