From a5c3863372af3e2b0e8eac25d86ea6b29ede462b Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Sun, 8 May 2022 23:24:20 -0400 Subject: [PATCH 1/7] Wayfarer Colors - Change all the colors - Cleanup update checking fn - Fix category checker --- public/base-locales/en.json | 10 +++++++++- server/src/configs/default.json | 14 ++++++++++++-- server/src/services/checkForUpdates.js | 6 +++--- server/src/services/ui/clientOptions.js | 10 ++++++++++ src/components/Map.jsx | 2 +- src/components/layout/dialogs/UserOptions.jsx | 2 +- src/components/markers/placementCell.js | 6 +++--- src/components/markers/typeCell.js | 14 ++++++-------- src/components/tiles/Weather.jsx | 7 ++++--- src/components/tiles/submissionCells/Placement.jsx | 5 +++-- src/components/tiles/submissionCells/Ring.jsx | 5 ++--- .../tiles/submissionCells/SubmissionCell.jsx | 5 ++++- src/components/tiles/submissionCells/Type.jsx | 5 +++-- 13 files changed, 61 insertions(+), 30 deletions(-) diff --git a/public/base-locales/en.json b/public/base-locales/en.json index b07c3119c..5fa6c9d19 100644 --- a/public/base-locales/en.json +++ b/public/base-locales/en.json @@ -535,5 +535,13 @@ "day": "Day", "days": "Days", "react_error": "Something Went Wrong", - "clickable_icon": "Icon is Clickable" + "clickable_icon": "Icon is Clickable", + "twoStopsTillNext": "2 stops until next", + "oneStopTillNext": "1 stop until next", + "noMoreGyms": "No more gyms", + "lightMapBorder": "Light Map Border", + "darkMapBorder": "Dark Map Border", + "cellBlocked": "Cell Blocked", + "cellUnblocked": "Cell Free", + "poiColor": "POI Color" } diff --git a/server/src/configs/default.json b/server/src/configs/default.json index f7e4e6005..f000c1468 100644 --- a/server/src/configs/default.json +++ b/server/src/configs/default.json @@ -260,10 +260,20 @@ "wayfarer": { "clustering": true, "oldPortals": "#0000ff", - "newPortals": "#16b819" + "newPortals": "#16b819", + "twoStopsTillNext": "#ffa500", + "oneStopTillNext": "#ff0000", + "noMoreGyms": "#000000", + "lightMapBorder": "#000000", + "darkMapBorder": "#ff0000", + "cellBlocked": "#000000", + "cellFree": "#00FF00", + "poiColor": "#03ffff" }, "weather": { - "clickableIcon": false + "clickableIcon": false, + "darkMapBorder": "#ff0000", + "lightMapBorder": "#246377" } }, "defaultFilters": { diff --git a/server/src/services/checkForUpdates.js b/server/src/services/checkForUpdates.js index 4d9783e2d..a3799d71b 100644 --- a/server/src/services/checkForUpdates.js +++ b/server/src/services/checkForUpdates.js @@ -6,7 +6,7 @@ const fs = require('fs') let isDocker = false try { - exec('git branch --show-current', async (err, stdout) => { + exec('git branch --show-current', (err, stdout) => { try { const gitRef = fs.readFileSync(path.resolve(`${__dirname}/../../../.gitref`), 'utf8') @@ -20,12 +20,12 @@ try { ? gitRef.split('/')[2].trim() : stdout.trim() - exec('git rev-parse HEAD', async (err2, stdout2) => { + exec('git rev-parse HEAD', (err2, stdout2) => { try { const gitSha = fs.readFileSync(path.resolve(`${__dirname}/../../../.gitsha`), 'utf8') if (!gitSha && (err2 || typeof stdout2 !== 'string' || !stdout2.trim())) { - throw new Error('Unable to get current sha', err) + throw new Error('Unable to get current sha', err2) } const sha = typeof gitSha === 'string' && gitSha.trim() ? gitSha.trim() diff --git a/server/src/services/ui/clientOptions.js b/server/src/services/ui/clientOptions.js index 0dc12e8f8..63e8f4f64 100644 --- a/server/src/services/ui/clientOptions.js +++ b/server/src/services/ui/clientOptions.js @@ -43,9 +43,19 @@ module.exports = function clientOptions(perms) { clustering: { type: 'bool', perm: ['portals'] }, oldPortals: { type: 'color', perm: ['portals'] }, newPortals: { type: 'color', perm: ['portals'] }, + oneStopTillNext: { type: 'color', perm: ['submissionCells'] }, + twoStopsTillNext: { type: 'color', perm: ['submissionCells'] }, + noMoreGyms: { type: 'color', perm: ['submissionCells'] }, + lightMapBorder: { type: 'color', perm: ['submissionCells'] }, + darkMapBorder: { type: 'color', perm: ['submissionCells'] }, + cellBlocked: { type: 'color', perm: ['submissionCells'] }, + cellFree: { type: 'color', perm: ['submissionCells'] }, + poiColor: { type: 'color', perm: ['submissionCells'] }, }, weather: { clickableIcon: { type: 'bool', perm: ['weather'] }, + lightMapBorder: { type: 'color', perm: ['weather'] }, + darkMapBorder: { type: 'color', perm: ['weather'] }, }, } diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 1aa65cf36..114259bc0 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -179,7 +179,7 @@ export default function Map({ serverSettings: Utility.analytics('Data', `${category} being fetched`, category, true) return ( x ? x.size : 'md').join(',') : 'md'} bounds={Utility.getQueryArgs(map)} setExcludeList={setExcludeList} diff --git a/src/components/layout/dialogs/UserOptions.jsx b/src/components/layout/dialogs/UserOptions.jsx index 295da34a8..55b9df4b0 100644 --- a/src/components/layout/dialogs/UserOptions.jsx +++ b/src/components/layout/dialogs/UserOptions.jsx @@ -101,7 +101,7 @@ export default function UserOptions({ category, toggleDialog, isMobile }) { action={toggleDialog(false, category, 'options')} /> - {category === 'pokemon' && ( + {tabPages.length > 1 && ( = 20) { return { - fillColor: 'black', color, opacity: 0.75, fillOpacity: 0.25, weight: 0.8, + fillColor: userSettings.noMoreGyms, color, opacity: 0.75, fillOpacity: 0.25, weight: 0.8, } } - return { - fillColor: 'blue', color, opacity: 0.75, fillOpacity: 0.0, weight: 0.8, - } + return { color, opacity: 0.75, fillOpacity: 0.0, weight: 0.8 } } diff --git a/src/components/tiles/Weather.jsx b/src/components/tiles/Weather.jsx index 63efe15fd..21d9671f3 100644 --- a/src/components/tiles/Weather.jsx +++ b/src/components/tiles/Weather.jsx @@ -4,7 +4,7 @@ import { Popup, Polyline, Marker } from 'react-leaflet' import weatherMarker from '../markers/weather' import PopupContent from '../popups/Weather' -const WeatherTile = ({ item, ts, Icons, isNight, tileStyle }) => { +const WeatherTile = ({ item, ts, Icons, isNight, tileStyle, userSettings }) => { const [popup, setPopup] = useState(false) const markerRef = useRef(null) @@ -18,10 +18,10 @@ const WeatherTile = ({ item, ts, Icons, isNight, tileStyle }) => { { const areEqual = (prev, next) => ( prev.item.gameplay_condition === next.item.gameplay_condition && prev.item.updated === next.item.updated + && prev.tileStyle === next.tileStyle ) export default memo(WeatherTile, areEqual) diff --git a/src/components/tiles/submissionCells/Placement.jsx b/src/components/tiles/submissionCells/Placement.jsx index 124dc836c..193757745 100644 --- a/src/components/tiles/submissionCells/Placement.jsx +++ b/src/components/tiles/submissionCells/Placement.jsx @@ -3,10 +3,10 @@ import { Polygon } from 'react-leaflet' import placementStyle from '../../markers/placementCell' -const PlacementTile = ({ cell, tileStyle }) => ( +const PlacementTile = ({ cell, tileStyle, userSettings }) => ( ) @@ -14,6 +14,7 @@ const PlacementTile = ({ cell, tileStyle }) => ( const areEqual = (prev, next) => ( prev.cell.id === next.cell.id && prev.zoom === next.zoom + && prev.tileStyle === next.tileStyle ) export default memo(PlacementTile, areEqual) diff --git a/src/components/tiles/submissionCells/Ring.jsx b/src/components/tiles/submissionCells/Ring.jsx index f2be9932e..b19f3a9d9 100644 --- a/src/components/tiles/submissionCells/Ring.jsx +++ b/src/components/tiles/submissionCells/Ring.jsx @@ -1,18 +1,17 @@ import React, { memo } from 'react' import { Circle } from 'react-leaflet' -const RingTile = ({ ring }) => ( +const RingTile = ({ ring, userSettings }) => ( ) const areEqual = (prev, next) => ( prev.ring.id === next.ring.id - && prev.ring.lat === next.ring.lat - && prev.ring.lon === next.ring.lon && prev.zoom === next.zoom ) diff --git a/src/components/tiles/submissionCells/SubmissionCell.jsx b/src/components/tiles/submissionCells/SubmissionCell.jsx index fafff6046..8fa31f1cc 100644 --- a/src/components/tiles/submissionCells/SubmissionCell.jsx +++ b/src/components/tiles/submissionCells/SubmissionCell.jsx @@ -4,7 +4,7 @@ import PlacementTile from './Placement' import RingTile from './Ring' export default function SubmissionCellTile({ - item, tileStyle, config, zoom, + item, tileStyle, config, zoom, userSettings, }) { const zoomLimit = zoom >= config.submissionZoom return zoom >= (config.submissionZoom - 1) && ( @@ -15,6 +15,7 @@ export default function SubmissionCellTile({ key={ring.id} ring={ring} zoom={zoomLimit} + userSettings={userSettings} /> ))} {(item?.placementCells?.cells && zoomLimit) @@ -24,6 +25,7 @@ export default function SubmissionCellTile({ cell={cell} tileStyle={tileStyle} zoom={zoomLimit} + userSettings={userSettings} /> ))} {item?.typeCells && item.typeCells.map(cell => ( @@ -32,6 +34,7 @@ export default function SubmissionCellTile({ cell={cell} tileStyle={tileStyle} zoom={zoom >= (config.submissionZoom - 1)} + userSettings={userSettings} /> ))} diff --git a/src/components/tiles/submissionCells/Type.jsx b/src/components/tiles/submissionCells/Type.jsx index 1a19c3ac8..3a2ed2012 100644 --- a/src/components/tiles/submissionCells/Type.jsx +++ b/src/components/tiles/submissionCells/Type.jsx @@ -4,10 +4,10 @@ import { Polygon, Popup, Tooltip } from 'react-leaflet' import PopupContent from '../../popups/SubmissionCell' import typeStyle from '../../markers/typeCell' -const TypeTile = ({ cell, tileStyle }) => ( +const TypeTile = ({ cell, tileStyle, userSettings }) => ( ( prev.cell.id === next.cell.id && prev.cell.count === next.cell.count && prev.zoom === next.zoom + && prev.tileStyle === next.tileStyle ) export default memo(TypeTile, areEqual) From e261b4248490432c89a5cf3542a996a5affed62c Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Mon, 9 May 2022 19:02:45 -0400 Subject: [PATCH 2/7] Remove unnecessary --- public/base-locales/en.json | 1 - server/src/configs/default.json | 1 - server/src/services/ui/clientOptions.js | 1 - src/components/markers/placementCell.js | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/public/base-locales/en.json b/public/base-locales/en.json index 5fa6c9d19..cc5ad3354 100644 --- a/public/base-locales/en.json +++ b/public/base-locales/en.json @@ -542,6 +542,5 @@ "lightMapBorder": "Light Map Border", "darkMapBorder": "Dark Map Border", "cellBlocked": "Cell Blocked", - "cellUnblocked": "Cell Free", "poiColor": "POI Color" } diff --git a/server/src/configs/default.json b/server/src/configs/default.json index f000c1468..b29635eeb 100644 --- a/server/src/configs/default.json +++ b/server/src/configs/default.json @@ -267,7 +267,6 @@ "lightMapBorder": "#000000", "darkMapBorder": "#ff0000", "cellBlocked": "#000000", - "cellFree": "#00FF00", "poiColor": "#03ffff" }, "weather": { diff --git a/server/src/services/ui/clientOptions.js b/server/src/services/ui/clientOptions.js index 63e8f4f64..7ffc9f5b5 100644 --- a/server/src/services/ui/clientOptions.js +++ b/server/src/services/ui/clientOptions.js @@ -49,7 +49,6 @@ module.exports = function clientOptions(perms) { lightMapBorder: { type: 'color', perm: ['submissionCells'] }, darkMapBorder: { type: 'color', perm: ['submissionCells'] }, cellBlocked: { type: 'color', perm: ['submissionCells'] }, - cellFree: { type: 'color', perm: ['submissionCells'] }, poiColor: { type: 'color', perm: ['submissionCells'] }, }, weather: { diff --git a/src/components/markers/placementCell.js b/src/components/markers/placementCell.js index f62054e9a..fae8ce6a9 100644 --- a/src/components/markers/placementCell.js +++ b/src/components/markers/placementCell.js @@ -1,6 +1,6 @@ export default function placementStyle(cellBlocked, tileStyle, userSettings) { return { - fillColor: cellBlocked ? userSettings.cellBlocked : userSettings.cellFree, + fillColor: userSettings.cellBlocked, color: tileStyle === 'dark' ? userSettings.darkMapBorder : userSettings.lightMapBorder, opacity: 0.75, fillOpacity: cellBlocked ? 0.25 : 0, From 6c6c6e63d4e1d16bfdd4fc44ef8553645c2c51b3 Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Mon, 9 May 2022 22:06:06 -0400 Subject: [PATCH 3/7] Add env generating workflow --- .github/workflows/env-vars.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/env-vars.yml diff --git a/.github/workflows/env-vars.yml b/.github/workflows/env-vars.yml new file mode 100644 index 000000000..6510182cb --- /dev/null +++ b/.github/workflows/env-vars.yml @@ -0,0 +1,24 @@ +name: Sync Env Vars +on: [push, pull_request] + +jobs: + change-and-push: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: "yarn" + - name: Generate latest env vars + run: | + yarn gen-env-config + - name: Commit and push changes + uses: devops-infra/action-commit-push@v0.9.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + commit_message: Synced docker env vars with latest config From 1e0001f105755789a5b555ded6317a2866e39b67 Mon Sep 17 00:00:00 2001 From: TurtIeSocks Date: Tue, 10 May 2022 02:06:31 +0000 Subject: [PATCH 4/7] Synced docker env vars with latest config Files changed:\nM server/src/configs/custom-environment-variables.json --- .../src/configs/custom-environment-variables.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/src/configs/custom-environment-variables.json b/server/src/configs/custom-environment-variables.json index 763dbb187..16097fcc6 100644 --- a/server/src/configs/custom-environment-variables.json +++ b/server/src/configs/custom-environment-variables.json @@ -581,13 +581,22 @@ "__format": "boolean" }, "oldPortals": "CLIENT_SIDE_OPTIONS_WAYFARER_OLD_PORTALS", - "newPortals": "CLIENT_SIDE_OPTIONS_WAYFARER_NEW_PORTALS" + "newPortals": "CLIENT_SIDE_OPTIONS_WAYFARER_NEW_PORTALS", + "twoStopsTillNext": "CLIENT_SIDE_OPTIONS_WAYFARER_TWO_STOPS_TILL_NEXT", + "oneStopTillNext": "CLIENT_SIDE_OPTIONS_WAYFARER_ONE_STOP_TILL_NEXT", + "noMoreGyms": "CLIENT_SIDE_OPTIONS_WAYFARER_NO_MORE_GYMS", + "lightMapBorder": "CLIENT_SIDE_OPTIONS_WAYFARER_LIGHT_MAP_BORDER", + "darkMapBorder": "CLIENT_SIDE_OPTIONS_WAYFARER_DARK_MAP_BORDER", + "cellBlocked": "CLIENT_SIDE_OPTIONS_WAYFARER_CELL_BLOCKED", + "poiColor": "CLIENT_SIDE_OPTIONS_WAYFARER_POI_COLOR" }, "weather": { "clickableIcon": { "__name": "CLIENT_SIDE_OPTIONS_WEATHER_CLICKABLE_ICON", "__format": "boolean" - } + }, + "darkMapBorder": "CLIENT_SIDE_OPTIONS_WEATHER_DARK_MAP_BORDER", + "lightMapBorder": "CLIENT_SIDE_OPTIONS_WEATHER_LIGHT_MAP_BORDER" } }, "defaultFilters": { From 157f3aa4d9da185d23dad1740a80ae372050ee57 Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Mon, 9 May 2022 22:10:04 -0400 Subject: [PATCH 5/7] Test --- .github/workflows/docker.yml | 1 + .github/workflows/lint.yml | 1 + .github/workflows/{env-vars.yml => sync.yml} | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) rename .github/workflows/{env-vars.yml => sync.yml} (97%) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1a6a9d146..7e1b27f08 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,6 +7,7 @@ env: jobs: Docker: + needs: sync runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index be25c98ee..768607315 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,6 +3,7 @@ on: [push, pull_request] jobs: Lint: + needs: sync runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/env-vars.yml b/.github/workflows/sync.yml similarity index 97% rename from .github/workflows/env-vars.yml rename to .github/workflows/sync.yml index 6510182cb..1cbfda7d5 100644 --- a/.github/workflows/env-vars.yml +++ b/.github/workflows/sync.yml @@ -2,7 +2,7 @@ name: Sync Env Vars on: [push, pull_request] jobs: - change-and-push: + sync: runs-on: ubuntu-latest steps: - name: Check out code From e36d90f0cc4e48dd1a87163a062cc91d5049aeb6 Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Mon, 9 May 2022 22:12:48 -0400 Subject: [PATCH 6/7] Test2 --- .github/workflows/docker.yml | 24 ++++++++++++++++++++++-- .github/workflows/lint.yml | 1 - .github/workflows/sync.yml | 24 ------------------------ 3 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7e1b27f08..c6dca5b7c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,11 +6,31 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + Sync: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: "yarn" + - name: Generate latest env vars + run: | + yarn gen-env-config + - name: Commit and push changes + uses: devops-infra/action-commit-push@v0.9.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + commit_message: Synced docker env vars with latest config Docker: - needs: sync + needs: Sync runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set .gitsha if: github.event_name == 'push' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 768607315..be25c98ee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,6 @@ on: [push, pull_request] jobs: Lint: - needs: sync runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml deleted file mode 100644 index 1cbfda7d5..000000000 --- a/.github/workflows/sync.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Sync Env Vars -on: [push, pull_request] - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: "yarn" - - name: Generate latest env vars - run: | - yarn gen-env-config - - name: Commit and push changes - uses: devops-infra/action-commit-push@v0.9.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - commit_message: Synced docker env vars with latest config From 4c6a51dfc89f78251d231e945413a8dee559b3f6 Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Mon, 9 May 2022 22:31:17 -0400 Subject: [PATCH 7/7] Update en.json --- public/base-locales/en.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/base-locales/en.json b/public/base-locales/en.json index cc5ad3354..80ffee9ea 100644 --- a/public/base-locales/en.json +++ b/public/base-locales/en.json @@ -536,11 +536,11 @@ "days": "Days", "react_error": "Something Went Wrong", "clickable_icon": "Icon is Clickable", - "twoStopsTillNext": "2 stops until next", - "oneStopTillNext": "1 stop until next", - "noMoreGyms": "No more gyms", - "lightMapBorder": "Light Map Border", - "darkMapBorder": "Dark Map Border", - "cellBlocked": "Cell Blocked", - "poiColor": "POI Color" + "two_stops_till_next": "2 stops until next", + "one_stop_till_next": "1 stop until next", + "no_more_gyms": "No more gyms", + "light_map_border": "Light Map Border", + "dark_map_border": "Dark Map Border", + "cell_blocked": "Cell Blocked", + "poi_color": "POI Color" }