Skip to content

Commit

Permalink
cgra-slider - RSuite Slider
Browse files Browse the repository at this point in the history
  • Loading branch information
BugsBunny338 committed Nov 3, 2021
1 parent c33ba4b commit 4e77f8c
Show file tree
Hide file tree
Showing 8 changed files with 6,008 additions and 75 deletions.
5 changes: 4 additions & 1 deletion cgra-slider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react-router-dom": "^5.0.1",
"react-router-use-location-state": "^2.3.1",
"react-scripts": "4.0.3",
"rsuite": "^5.1.0",
"use-location-state": "^2.3.1",
"yup": "^0.32.9"
},
Expand All @@ -32,7 +33,9 @@
"testcafe-backend": "rm -R ./build & yarn build & serve -l 5000 build",
"testcafe": "cross-env TEST_BACKEND=http://localhost:5000 ./scripts/run-testcafe.js",
"testcafe-visual": "cross-env TEST_MODE=visual ./scripts/run-testcafe.js",
"refresh-md": "node ./scripts/refresh-md.js"
"refresh-md": "node ./scripts/refresh-md.js",
"buildgd": "cross-env PUBLIC_URL=/cgra-slider yarn build",
"syncgd": "s3cmd --config .s3cfg sync --delete-removed ./build/ s3://gooddata-demo/cgra-slider/"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
4 changes: 2 additions & 2 deletions cgra-slider/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ export const appName = "cgra-slider";

// The URL of analytical GoodData backend with workspaces, insights, metrics, attributes, datasets, and users
// that will be available to the application.
export const backend = "https://developer.na.gooddata.com";
export const backend = "https://live-examples-proxy.herokuapp.com/";

// The ID of workspace that is selected by default in the optional workspace picker component (located in the web
// application header). It is also a default setting for script that refreshes MD data used by the application.
// MD script shows list of available workspaces on backend in the case when the value is not set to any ID.
export const workspace = "";
export const workspace = "xms7ga4tf3g3nzucd8380o2bev8oeknp";

// RegExp used by optional workspace picker component (located in the web application header) to filter out
// workspaces that should not be rendered to the application user. Only the workspaces with title that match
Expand Down
16 changes: 6 additions & 10 deletions cgra-slider/src/contexts/Auth/backend.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import bearFactory, {
FixedLoginAndPasswordAuthProvider,
ContextDeferredAuthProvider,
AnonymousAuthProvider,
} from "@gooddata/sdk-backend-bear";

import { backend as hostname } from "../../constants";
import { backend } from "../../constants";

const backendConfig = process.env.REACT_APP_SET_HOSTNAME ? { hostname } : {};
export const createBackend = () =>
bearFactory({ hostname: backend }).withAuthentication(new AnonymousAuthProvider());

export const createBackend = () => {
return bearFactory(backendConfig).withAuthentication(new ContextDeferredAuthProvider());
};

export const backendWithCredentials = (backend, username, password) => {
return backend.withAuthentication(new FixedLoginAndPasswordAuthProvider(username, password));
};
export const backendWithCredentials = (backend, username, password) =>
backend.withAuthentication(new FixedLoginAndPasswordAuthProvider(username, password));
Loading

0 comments on commit 4e77f8c

Please sign in to comment.