Skip to content

Commit

Permalink
refactor: rename 'config' folder to 'store'
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVelarde authored Feb 11, 2021
1 parent c4b6f28 commit 4ca9a2d
Show file tree
Hide file tree
Showing 24 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Add cypress e2e tests in CI [#194](https://github.com/CartoDB/carto-react-template/pull/194)
- Fix layer hygen unable to identify proper sources [#198](https://github.com/CartoDB/carto-react-template/pull/198)
- Fix cross browser geocoder marker display [#199](https://github.com/CartoDB/carto-react-template/pull/199)
- Change the 'config' folder name to 'store' [#201](https://github.com/CartoDB/carto-react-template/pull/201)

## 1.0.0-beta12 (2021-02-08)
- Refactor on basic JSX & JS stuff [#170](https://github.com/CartoDB/carto-react-template/pull/170)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ Main files:

* **routes.js**: the file where views and routes are matched.
* **views/Main.js**: the general component that defines the layout of the application.
* **config/initialStateSlice.js**: the file that define the configuration of CARTO as default values for the slices. Set your CARTO account, apiKeys, basemap, OAuth apps, etc...
* **config/appSlice.js**: general slice of the app to include/extend with custom app functionality.
* **store/initialStateSlice.js**: the file that define the configuration of CARTO as default values for the slices. Set your CARTO account, apiKeys, basemap, OAuth apps, etc...
* **store/appSlice.js**: general slice of the app to include/extend with custom app functionality.

## UI components

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/01_connect_your_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

As a first step you need to connect your CARTO account.

Edit `src/config/initialStateSlice.js` file and add your own credentials.
Edit `src/store/initialStateSlice.js` file and add your own credentials.

```javascript
...
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/03_basemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It is quite easy to change the basemap for the application. By default, the appl

<br/>

You need to edit the `src/config/initialStateSlice.js` file. At the beginning of this file we are importing the basemap from the `@carto/react` package.
You need to edit the `src/store/initialStateSlice.js` file. At the beginning of this file we are importing the basemap from the `@carto/react` package.

If you want to use the Google road basemap, you need to import it like this:

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/04_permissions_user_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The workflow is:

The first thing you need to do is go to your CARTO dashboard and create a new OAuth app as described in the [documentation](https://carto.com/developers/fundamentals/authorization/#oauth-apps), in order to get the clientID for your application.

Then, edit the `src/config/initialStateSlice.js` file and modify the clientId property in the `oauthInitialState` object. You can also modify the `scopes` property to specify what permissions you want to give the application.
Then, edit the `src/store/initialStateSlice.js` file and modify the clientId property in the `oauthInitialState` object. You can also modify the `scopes` property to specify what permissions you want to give the application.

When you want the users to authenticate and give access to their CARTO account (it can be when loading the application or when you are using a restricted feature), you need to use the OAuthLogin component. This will display a popup with the implicit OAuth flow.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { useDispatch, useSelector } from 'react-redux';
import { getIsochrone, MODES, RANGES } from 'data/models/isochroneModel';
import { addLayer, removeLayer, selectOAuthCredentials } from '@carto/react/redux';
import { setError, setIsolineResult } from 'config/appSlice';
import { setError, setIsolineResult } from 'store/appSlice';
import { ISOCHRONE_LAYER_ID } from 'components/layers/IsochroneLayer';

const useStyles = makeStyles((theme) => ({
Expand Down
2 changes: 1 addition & 1 deletion template-sample-app/template/src/components/views/Kpi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { setBottomSheetOpen, setError } from 'config/appSlice';
import { setBottomSheetOpen, setError } from 'store/appSlice';
import { Divider, Typography, makeStyles } from '@material-ui/core';
import {
addLayer,
Expand Down
2 changes: 1 addition & 1 deletion template-sample-app/template/src/components/views/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Map from 'components/common/Map';
import Legend from 'components/legends/Legend';
import ZoomControl from 'components/common/ZoomControl';
import { getLayers } from 'components/layers';
import { setBottomSheetOpen, setError } from 'config/appSlice';
import { setBottomSheetOpen, setError } from 'store/appSlice';
import cartoLogoMap from 'assets/img/carto-logo-map.svg';

const drawerWidth = 350;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { setBottomSheetOpen, setError } from 'config/appSlice';
import { setBottomSheetOpen, setError } from 'store/appSlice';
import { Divider, Grid, Typography, makeStyles } from '@material-ui/core';
import {
addLayer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ReactComponent as CartoIcon } from 'assets/img/icon-carto-symbol.svg';
import SvgIcon from '@material-ui/core/SvgIcon';
import { useOAuthLogin } from '@carto/react/oauth';
import { setTokenAndUserInfoAsync } from '@carto/react/redux';
import { setError } from 'config/appSlice';
import { setError } from 'store/appSlice';
import cartoLogoNegative from 'assets/img/carto-logo-negative.svg';

const useStyles = makeStyles((theme) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, Hidden, IconButton } from '@material-ui/core';
import AccountCircleOutlinedIcon from '@material-ui/icons/AccountCircleOutlined';
import { useOAuthLogin } from '@carto/react/oauth';
import { setTokenAndUserInfoAsync } from '@carto/react/redux';
import { setError } from 'config/appSlice';
import { setError } from 'store/appSlice';

/**
* Shows a login button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getStore, getRevenuePerMonth } from 'data/models/storeModel';
import { MONTHS_LABELS } from './constants';
import Isochrone from 'components/common/Isochrone';
import { currencyFormatter } from 'utils/formatter';
import { setBottomSheetOpen, setError } from 'config/appSlice';
import { setBottomSheetOpen, setError } from 'store/appSlice';
import storesSource from 'data/sources/storesSource';
import { STORES_LAYER_ID } from 'components/layers/StoresLayer';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { setBottomSheetOpen, setError } from 'config/appSlice';
import { setBottomSheetOpen, setError } from 'store/appSlice';
import { Divider, Grid, Typography, makeStyles } from '@material-ui/core';
import { AggregationTypes } from '@carto/react/widgets';
import { FormulaWidget, CategoryWidget, HistogramWidget } from '@carto/react/widgets';
Expand Down
4 changes: 2 additions & 2 deletions template-sample-app/template/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import App from './App';

import { initialState, oauthInitialState } from 'config/initialStateSlice';
import configureAppStore from './config/store';
import { initialState, oauthInitialState } from 'store/initialStateSlice';
import configureAppStore from './store/store';

import { createCartoSlice, createOauthCartoSlice } from '@carto/react/redux';

Expand Down
2 changes: 1 addition & 1 deletion template-skeleton/template/src/components/views/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { BASEMAPS } from '@carto/react/basemaps';
import Map from 'components/common/Map';
import ZoomControl from 'components/common/ZoomControl';
import { getLayers } from 'components/layers';
import { setBottomSheetOpen, setError } from 'config/appSlice';
import { setBottomSheetOpen, setError } from 'store/appSlice';
import cartoLogoMap from 'assets/img/carto-logo-map.svg';

const drawerWidth = 350;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ReactComponent as CartoIcon } from 'assets/img/icon-carto-symbol.svg';
import SvgIcon from '@material-ui/core/SvgIcon';
import { useOAuthLogin } from '@carto/react/oauth';
import { setTokenAndUserInfoAsync } from '@carto/react/redux';
import { setError } from 'config/appSlice';
import { setError } from 'store/appSlice';
import cartoLogoNegative from 'assets/img/carto-logo-negative.svg';

const useStyles = makeStyles((theme) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AccountCircleOutlinedIcon from '@material-ui/icons/AccountCircleOutlined'
import { useOAuthLogin } from '@carto/react/oauth';
import { setTokenAndUserInfoAsync } from '@carto/react/redux';

import { setError } from 'config/appSlice';
import { setError } from 'store/appSlice';

/**
* Shows a login button.
Expand Down
4 changes: 2 additions & 2 deletions template-skeleton/template/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import App from './App';

import { initialState, oauthInitialState } from 'config/initialStateSlice';
import configureAppStore from './config/store';
import { initialState, oauthInitialState } from 'store/initialStateSlice';
import configureAppStore from './store/store';

import { createCartoSlice, createOauthCartoSlice } from '@carto/react/redux';

Expand Down

1 comment on commit 4ca9a2d

@vercel
Copy link

@vercel vercel bot commented on 4ca9a2d Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.