Skip to content

Commit

Permalink
Merge develop (#36)
Browse files Browse the repository at this point in the history
* [EP-2124] Search and sidebar refactoring

* fix: [EP-1993] hide widget footer when no data available

* [EP-1591] Firefox/Safari - [Front end] - "Remove" location button si too close to the search input boarder

* [EP-1792] Firefox - [Admin] - Edit {resource} page title is displayed on two rows

* [EP-1791] Firefox - [Admin] - The hight of the org option boxes is too big

* [EP-1590] Firefox - [Front end] - The title of the "Layers" modal is displayed on two rows

* bump uikit version

* UNBL skin

* [EP-2124] Continued refactoring of search component

* [EP-2124] Moved back to location click on the container to increase the surface area

* feat: [EP-1881] add organization list

* [EP-2124] Restore location name on back

* tree loss & evi

* tree loss & evi

* [EP-2124] Changes after code review

* layer migration

* [EP-2124] Updated grays for search components

* [EP-2124] Fixed results rendering on homepage

* fire layer

* [EP-2124] Code cleanup

* feat: [EP-1908] add organization detail

* fix: typo

* [EP-2096] Added type label to results and created reusable <ListItem />

* [EP-2096] Used scss variable for hover background

* [EP-2096] Added padding bottom to lists

* [EP-2098] Add organization and type on location page

* feat: [EP-1882] add organization update

* [EP-2098] Removed custom class in favour of generic one

* [EP-2124] Fixed loading state for infinite scroll on results

* refactor: update organization method

* Render widgets only when they are in the viewport

* working popup

* removed layers

* cleanup

* feat: [EP-2095] add map search term bold

* refactor: review

* refactor: review #2

* [EP-2093] Last viewed place functionality

* admin layer manager migration

* fix layer bounds config

* refactor: update $searchHint type \& bold class

* reafctor: $font-weight-bold to $font-weight-medium

* fix: default text value

* [EP-2093] Changes after code review

* [EP-2093] Updated <ListItem slug/> to prevent duplicate warning

* [EP-1593] Firefox/IE Edge - [Front End] - Year picker drop-down from layers is not properly displayed

* fix: search bold location selected

* [EP-2262] Display 404 page on wrong location url

* docs: [EP-1807] license to source files

* fix: [EP-1993] hide button when no layer

* [EP-1612] IE 11 - [Front End] - The left panel cannot be opened - react-spring update

* [EP-1593] Firefox/IE Edge - [Front End] - Year picker drop-down from layers is not properly displayed

* removed hardcoded layes

* changed polyfills

* changed polyfills

* [EP-2164] Clear filters button

* [EP-2259] [Marapp/Unbl] Firefox- App crashes when fire layer is added to the map

* test

* test

* test

* test

* feat: [EP-1906] owner support

* worky

* worky

* [EP-2266] Update <ListItem /> style

* [EP-2266] Changes after code review

* worky

* worky

* worky

* worky

* worky

* prettier

* cleanup

* cleanup

* cleanup

* cleanup

* license

* cleanup packages

* changed from pr

* revert

* revert yarn.lock

* revert PR

* revert PR

* fixed index

* [EP-2384] [UNBL] Search results are duplicated when a new resource is clicked while in resource details page
[EP-2385] [UNBL] Add new widget button is missing

* [EP-2384] [UNBL] Search results are duplicated when a new resource is clicked while in resource details page

* [EP-2383] [UNBL] - "-end" is displayed at the end of the list for Users and Organizations

* changes from design review

* spinny globe assets

Co-authored-by: ancashoria <horia.ancas@gmail.com>
Co-authored-by: Bogdan Bruma <bogdan.bruma@qcatalyst.com>
Co-authored-by: dan-qc <62541139+dan-qc@users.noreply.github.com>
  • Loading branch information
4 people committed Jul 31, 2020
1 parent 5d446aa commit 45d8048
Show file tree
Hide file tree
Showing 581 changed files with 13,556 additions and 1,790 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100
}
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
},
"dependencies": {
"@loadable/component": "^5.6.1",
"@natgeosociety/marapp-uikit": "^1.0.6",
"@natgeosociety/marapp-uikit": "^1.0.7",
"assert": "^2.0.0",
"axios": "^0.18.0",
"axios-cache-adapter": "^2.3.0",
"basic-auth": "^2.0.1",
"classnames": "^2.2.6",
"d3-ease": "^1.0.5",
"d3-geo": "^1.11.3",
"deck.gl": "7.1.11",
"deck.gl": "7.3.6",
"delay": "^4.1.0",
"iframe-resizer": "^3.6.6",
"jsona": "^1.4.0",
"layer-manager": "^2.0.9",
"layer-manager": "^3.0.6",
"localforage": "^1.7.3",
"localforage-memoryStorageDriver": "^0.9.2",
"lodash": "^4.17.11",
"luma.gl": "7.2.0",
"luma.gl": "7.3.2",
"moment": "^2.24.0",
"node-sass": "^4.11.0",
"photo-sphere-viewer": "3.5.1",
Expand All @@ -51,7 +51,7 @@
"react-responsive": "^6.1.1",
"react-router-dom": "^5.0.0",
"react-slick": "^0.23.2",
"react-spring": "^7.2.10",
"react-spring": "8.0.4",
"recharts": "^1.5.0",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.7",
Expand All @@ -68,7 +68,8 @@
"vega-lib": "^4.4.0",
"vizzuality-components": "^3.0.1",
"vizzuality-redux-tools": "^4.0.2",
"wri-json-api-serializer": "^1.0.1"
"wri-json-api-serializer": "^1.0.1",
"viewport-mercator-project": "6.1.1"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
Expand All @@ -81,6 +82,7 @@
"babel-jest": "^24.8.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"core-js": "^3.6.5",
"dotenv-cli": "^3.1.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.11.2",
Expand Down
19 changes: 19 additions & 0 deletions packages/earth-admin/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import React from 'react';
import { Auth0Provider } from './src/auth/auth0';
import config from './src/auth/config';
Expand Down
19 changes: 19 additions & 0 deletions packages/earth-admin/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

const path = require('path');

const GATSBY_ACTIVE_ENV = process.env.GATSBY_ACTIVE_ENV || '.env'
Expand Down
19 changes: 19 additions & 0 deletions packages/earth-admin/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === 'build-html') {
actions.setWebpackConfig({
Expand Down
2 changes: 1 addition & 1 deletion packages/earth-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@auth0/auth0-spa-js": "^1.6.5",
"@ckeditor/ckeditor5-build-classic": "^16.0.0",
"@ckeditor/ckeditor5-react": "^2.1.0",
"@marapp/earth-components": "*",
"@loadable/component": "^5.10.3",
"@marapp/earth-components": "*",
"@types/loadable__component": "^5.10.0",
"@types/lodash": "^4.14.146",
"@types/node": "^12.12.6",
Expand Down
29 changes: 28 additions & 1 deletion packages/earth-admin/src/auth/auth0.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import React, { useState, useEffect, useContext, useCallback } from 'react';
import createAuth0Client from '@auth0/auth0-spa-js';
import Auth0Client from '@auth0/auth0-spa-js/dist/typings/Auth0Client';
Expand Down Expand Up @@ -50,7 +69,7 @@ export const Auth0Provider = ({
const [isAuthorized, setIsAuthorized] = useState(false);
const [isAppBootstrapped, setIsAppBootstrapped] = useState(false);
const [isLoading, setIsLoading] = useState(true);

const [userData, setUserData] = useState({});

const [groups, setGroups] = useState([]);
const [roles, setRoles] = useState({});
Expand Down Expand Up @@ -96,8 +115,15 @@ export const Auth0Provider = ({
setRoles(mapAuthzScopes(roles));

const permissions = get(idToken, `${NAMESPACE}/permissions`, []);

setPermissions(mapAuthzScopes(permissions));

const email = get(idToken, 'email', '');
const userName = get(idToken, 'name', '');
const userPicture = get(idToken, 'picture', '');

setUserData({ name: userName, picture: userPicture, allGroups: nonNestedGroups });

const authorized = !!roles.length;
setIsAuthorized(authorized);

Expand Down Expand Up @@ -148,6 +174,7 @@ export const Auth0Provider = ({
selectedGroup,
login,
logout,
userData,
getUser,
getToken,
setIsLoading,
Expand Down
19 changes: 19 additions & 0 deletions packages/earth-admin/src/auth/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import urljoin from 'url-join';
import {
GATSBY_APP_AUTH0_DOMAIN,
Expand Down
19 changes: 19 additions & 0 deletions packages/earth-admin/src/auth/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import axios from 'axios';
import { routeToPage } from '../utils';

Expand Down
26 changes: 26 additions & 0 deletions packages/earth-admin/src/auth/model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

export interface Auth0 {
isAuthenticated?: boolean;
isAuthorized?: boolean;
Expand All @@ -6,6 +25,7 @@ export interface Auth0 {
roles?: { [key: string]: any };
permissions?: { [key: string]: any };
selectedGroup?: string;
userData?: User;
logout?(o?: LogoutOptions): void;
login?(o?: BaseLoginOptions): void;
getUser?(o?: GetUserOptions): void;
Expand All @@ -14,3 +34,9 @@ export interface Auth0 {
setIsLoading(boolean): void;
getPermissions?(type: string[]): boolean;
}

export interface User {
name?: string;
picture?: string;
allGroups?: string[];
}
25 changes: 25 additions & 0 deletions packages/earth-admin/src/auth/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

export enum ScopesEnum {
ReadAll = 'read:*',
WriteAll = 'write:*',
Expand Down Expand Up @@ -76,4 +95,10 @@ export const AuthzGuards = {
[ScopesEnum.WriteUsers],
[ScopesEnum.WriteAll],
],
accessOrganizationsGuard: [
[ScopesEnum.ReadUsers],
[ScopesEnum.ReadAll],
[ScopesEnum.WriteUsers],
[ScopesEnum.WriteAll],
],
};
19 changes: 0 additions & 19 deletions packages/earth-admin/src/components/LinkWithOrg/LinkWithOrg.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/earth-admin/src/components/LinkWithOrg/index.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions packages/earth-admin/src/components/NotFound/NotFound.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/earth-admin/src/components/NotFound/index.tsx

This file was deleted.

This file was deleted.

19 changes: 19 additions & 0 deletions packages/earth-admin/src/components/action-modal/ActionModal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2018-2020 National Geographic Society
Use of this software does not constitute endorsement by National Geographic
Society (NGS). The NGS name and NGS logo may not be used for any purpose without
written permission from NGS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import * as React from 'react';

import { navigate } from 'gatsby';
Expand Down
Loading

0 comments on commit 45d8048

Please sign in to comment.