Skip to content

Commit

Permalink
test build
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanweiler92 committed Aug 15, 2023
1 parent 51bba12 commit dbcf3d3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
30 changes: 30 additions & 0 deletions web/js/mapUI/mapUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { REDUX_ACTION_DISPATCHED } from '../util/constants';
import { updateMapExtent } from '../modules/map/actions';
import { clearPreload, setPreload } from '../modules/date/actions';
import { DISPLAY_STATIC_MAP } from '../modules/ui/constants';
import { Button } from 'reactstrap';

Check failure on line 51 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

`reactstrap` import should occur before import of `./components/layers/addLayer`

Check failure on line 51 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

`reactstrap` import should occur before import of `./components/layers/addLayer`

Check failure on line 51 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

`reactstrap` import should occur before import of `./components/layers/addLayer`

const { events } = util;

Expand Down Expand Up @@ -344,8 +345,37 @@ function MapUI(props) {
}
}

const testFunction = () => {
let layersWithoutProjections = [];

Check failure on line 349 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

'layersWithoutProjections' is never reassigned. Use 'const' instead

Check failure on line 349 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

'layersWithoutProjections' is never reassigned. Use 'const' instead

Check failure on line 349 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

'layersWithoutProjections' is never reassigned. Use 'const' instead
const layers = config.layers;

Check failure on line 350 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

Use object destructuring

Check failure on line 350 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

Use object destructuring

Check failure on line 350 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

Use object destructuring

console.log(layers);

// Iterate over the object keys
for (let key in layers) {

Check failure on line 355 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array

Check failure on line 355 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

'key' is never reassigned. Use 'const' instead

Check failure on line 355 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array

Check failure on line 355 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

'key' is never reassigned. Use 'const' instead

Check failure on line 355 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array

Check failure on line 355 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

'key' is never reassigned. Use 'const' instead
if (layers.hasOwnProperty(key) && !layers[key].projections) {

Check failure on line 356 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

Do not access Object.prototype method 'hasOwnProperty' from target object

Check failure on line 356 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

Do not access Object.prototype method 'hasOwnProperty' from target object

Check failure on line 356 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

Do not access Object.prototype method 'hasOwnProperty' from target object
layersWithoutProjections.push(layers[key]);
}
}

let layerCount = layersWithoutProjections.length;

Check failure on line 361 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

'layerCount' is never reassigned. Use 'const' instead

Check failure on line 361 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

'layerCount' is never reassigned. Use 'const' instead

Check failure on line 361 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

'layerCount' is never reassigned. Use 'const' instead

console.log(layersWithoutProjections);
console.log(layerCount);
}

Check failure on line 365 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

Missing semicolon

Check failure on line 365 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

Missing semicolon

Check failure on line 365 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

Missing semicolon


const devButton = () => {

Check failure on line 368 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`

Check failure on line 368 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`

Check failure on line 368 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`
return (
<div id="dev-block" className="d-flex justify-content-center">
<Button onClick={testFunction} style={ { zIndex: "999" } } color="success">Dev Button</Button>

Check failure on line 371 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / macOS-latest, Node 18

There should be no space after '{'

Check failure on line 371 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / ubuntu-latest, Node 18

There should be no space after '{'

Check failure on line 371 in web/js/mapUI/mapUI.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 18

There should be no space after '{'
</div>
)
}

return (
<>
{devButton()}
<CreateMap
compareMapUi={compareMapUi}
isMapSet={isMapSet}
Expand Down
4 changes: 3 additions & 1 deletion web/js/modules/layers/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,12 @@ export const makeGetDescription = () => createSelector(
*
*/
export function hasMeasurementSetting(current, source, config, projId) {
console.log("source", source)
let hasSetting;
Object.values(source.settings).forEach((setting) => {
const layer = config.layers[setting];
if (layer) {
// ADDED ADDITIONAL CHECK FOR PROJECTIONS PROPERTY
if (layer && layer.projections) {
const proj = layer.projections;
if (layer.id === setting && Object.keys(proj).indexOf(projId) > -1) {
if (layer.layergroup === 'Orbital Track') {
Expand Down
4 changes: 3 additions & 1 deletion web/js/modules/product-picker/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ const getCategoryType = ({ productPicker }) => productPicker.categoryType;
export const getLayersForProjection = createSelector(
[getConfig, getProjection, getSelectedDate],
(config, projection, selectedDate) => {

const layersWithFacetProps = buildLayerFacetProps(config, selectedDate)
// Only use the layers for the active projection
.filter((layer) => layer.projections[projection])
// UPDATED THIS TO CHECK IF LAYER HAS PROJECTIONS PROPERTY
.filter((layer) => layer.projections && layer.projections[projection])
.map((layer) => {
// If there is metadata for the current projection, use that
const projectionMeta = layer.projections[projection];
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = {
},
static: path.join(__dirname, 'web'),
compress: true,
port: 3000,
port: 3001,
hot: true,
historyApiFallback: true
},
Expand Down

0 comments on commit dbcf3d3

Please sign in to comment.