From 05e7bc8977a5d7dcb8fd97694e49826929f15d99 Mon Sep 17 00:00:00 2001
From: Adam Kendis
Date: Mon, 17 Feb 2020 12:08:11 -0800
Subject: [PATCH 01/12] Added REQUEST_TYPES (type, abbrev, color) to CONSTANTS.
---
src/components/common/CONSTANTS.js | 63 ++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/src/components/common/CONSTANTS.js b/src/components/common/CONSTANTS.js
index f96f3c2fc..089adb80e 100644
--- a/src/components/common/CONSTANTS.js
+++ b/src/components/common/CONSTANTS.js
@@ -23,6 +23,69 @@ export const MONTHS = [
'December',
];
+export const REQUEST_TYPES = [
+ {
+ type: 'Bulky Items',
+ abbrev: 'BLK',
+ color: '#FF0000',
+ },
+ {
+ type: 'Dead Animal',
+ abbrev: 'DAN',
+ color: '#4FEFEF',
+ },
+ {
+ type: 'E-Waste',
+ abbrev: 'EWT',
+ color: '#DDEC9F',
+ },
+ {
+ type: 'Graffiti',
+ abbrev: 'GFT',
+ color: '#2368D0',
+ },
+ {
+ type: 'Homeless Encampment',
+ abbrev: 'HLE',
+ color: '#ECB800',
+ },
+ {
+ type: 'Illegal Dumping',
+ abbrev: 'ILD',
+ color: '#6A8011',
+ },
+ {
+ type: 'Metal/Household Appliances',
+ abbrev: 'MHA',
+ color: '#B8D0FF',
+ },
+ {
+ type: 'Single Streetlight',
+ abbrev: 'SSL',
+ color: '#AD7B56',
+ },
+ {
+ type: 'Multiple Streetlight',
+ abbrev: 'MSL',
+ color: '#F7ADAD',
+ },
+ {
+ type: 'Feedback',
+ abbrev: 'FBK',
+ color: '#FFE6B7',
+ },
+ {
+ type: 'Other',
+ abbrev: 'OTH',
+ color: '#6D7C93',
+ },
+
+ /*
+ * Is 'Report Water Waste' still a valid request type?
+ * If so, we're missing it on the front end mockups.
+ */
+];
+
export const REQUESTS = [
'Bulky Items',
'Dead Animal Removal',
From 113da701c7c9472c8e4f3637f96c9b79acfa8280 Mon Sep 17 00:00:00 2001
From: Adam Kendis
Date: Mon, 17 Feb 2020 15:09:33 -0800
Subject: [PATCH 02/12] Changed default color prop in Icon to undefined.
---
src/components/common/Icon.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/common/Icon.jsx b/src/components/common/Icon.jsx
index 4633d1bfd..9ee4ea8a9 100644
--- a/src/components/common/Icon.jsx
+++ b/src/components/common/Icon.jsx
@@ -91,7 +91,7 @@ Icon.propTypes = {
Icon.defaultProps = {
label: null,
handleClick: () => null,
- color: 'black',
+ color: undefined,
size: undefined,
icon: 'home',
iconSize: undefined,
From 62526b909e44ee527272efef7ae2105d0efd279c Mon Sep 17 00:00:00 2001
From: Adam Kendis
Date: Mon, 17 Feb 2020 23:31:15 -0800
Subject: [PATCH 03/12] Re-ordered REQUEST_TYPES.
---
src/components/common/CONSTANTS.js | 50 +++++++++++++++---------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/components/common/CONSTANTS.js b/src/components/common/CONSTANTS.js
index 089adb80e..16e0e631b 100644
--- a/src/components/common/CONSTANTS.js
+++ b/src/components/common/CONSTANTS.js
@@ -24,41 +24,16 @@ export const MONTHS = [
];
export const REQUEST_TYPES = [
- {
- type: 'Bulky Items',
- abbrev: 'BLK',
- color: '#FF0000',
- },
{
type: 'Dead Animal',
abbrev: 'DAN',
color: '#4FEFEF',
},
- {
- type: 'E-Waste',
- abbrev: 'EWT',
- color: '#DDEC9F',
- },
- {
- type: 'Graffiti',
- abbrev: 'GFT',
- color: '#2368D0',
- },
{
type: 'Homeless Encampment',
abbrev: 'HLE',
color: '#ECB800',
},
- {
- type: 'Illegal Dumping',
- abbrev: 'ILD',
- color: '#6A8011',
- },
- {
- type: 'Metal/Household Appliances',
- abbrev: 'MHA',
- color: '#B8D0FF',
- },
{
type: 'Single Streetlight',
abbrev: 'SSL',
@@ -74,6 +49,31 @@ export const REQUEST_TYPES = [
abbrev: 'FBK',
color: '#FFE6B7',
},
+ {
+ type: 'Bulky Items',
+ abbrev: 'BLK',
+ color: '#FF0000',
+ },
+ {
+ type: 'E-Waste',
+ abbrev: 'EWT',
+ color: '#DDEC9F',
+ },
+ {
+ type: 'Metal/Household Appliances',
+ abbrev: 'MHA',
+ color: '#B8D0FF',
+ },
+ {
+ type: 'Graffiti',
+ abbrev: 'GFT',
+ color: '#2368D0',
+ },
+ {
+ type: 'Illegal Dumping',
+ abbrev: 'ILD',
+ color: '#6A8011',
+ },
{
type: 'Other',
abbrev: 'OTH',
From d0e456685f435c01585fa109d1cad7a79be0b10e Mon Sep 17 00:00:00 2001
From: Adam Kendis
Date: Mon, 17 Feb 2020 23:31:43 -0800
Subject: [PATCH 04/12] Added style prop to Checkbox.
---
src/components/common/Checkbox.jsx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/components/common/Checkbox.jsx b/src/components/common/Checkbox.jsx
index 92785a8f0..8a20b676f 100644
--- a/src/components/common/Checkbox.jsx
+++ b/src/components/common/Checkbox.jsx
@@ -10,6 +10,7 @@ const Checkbox = ({
name,
value,
checked,
+ style,
/*
* Props below correspond with Bulma modifiers.
* wikiki.github.io/form/checkradio/
@@ -48,7 +49,7 @@ const Checkbox = ({
checked={checked}
disabled={disabled}
/>
-
+
+
From fd42ea524da5f033db44b70ea64355d140dea748 Mon Sep 17 00:00:00 2001
From: Adam Kendis
Date: Tue, 18 Feb 2020 01:56:01 -0800
Subject: [PATCH 12/12] Moved column arrays outside of RequestTypeSelector
function body.
---
.../main/menu/RequestTypeSelector.jsx | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/components/main/menu/RequestTypeSelector.jsx b/src/components/main/menu/RequestTypeSelector.jsx
index 46b6cfde4..e0e221c67 100644
--- a/src/components/main/menu/RequestTypeSelector.jsx
+++ b/src/components/main/menu/RequestTypeSelector.jsx
@@ -24,6 +24,16 @@ const checkboxStyle = {
paddingLeft: '3px',
};
+const midIndex = ((list) => {
+ if (list.length / 2 === 0) {
+ return (list.length / 2);
+ }
+ return Math.floor(list.length / 2);
+})(REQUEST_TYPES);
+
+const leftColumnItems = REQUEST_TYPES.slice(0, midIndex);
+const rightColumnItems = REQUEST_TYPES.slice(midIndex);
+
const RequestItem = ({
type,
abbrev,
@@ -66,16 +76,6 @@ const RequestTypeSelector = ({
selectAll,
deselectAll,
}) => {
- const midIndex = ((list) => {
- if (list.length / 2 === 0) {
- return (list.length / 2);
- }
- return Math.floor(list.length / 2);
- })(REQUEST_TYPES);
-
- const leftColumnItems = REQUEST_TYPES.slice(0, midIndex);
- const rightColumnItems = REQUEST_TYPES.slice(midIndex);
-
const handleItemClick = (e) => {
const type = e.target.value;
selectType(type);