-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e943e2b
commit fc7bf1e
Showing
16 changed files
with
4,428 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.s3cfg | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v12.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,46 @@ | ||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
|
||
## Available Scripts | ||
|
||
In the project directory, you can run: | ||
|
||
### `yarn start` | ||
|
||
Runs the app in the development mode.<br /> | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
|
||
The page will reload if you make edits.<br /> | ||
You will also see any lint errors in the console. | ||
|
||
### `yarn test` | ||
|
||
Launches the test runner in the interactive watch mode.<br /> | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
# GoodData.UI@v8 Boilerplate App | ||
|
||
### `yarn build` | ||
This app follows steps from https://sdk.gooddata.com/gooddata-ui/docs/next/ht_create_your_first_visualization.html: | ||
|
||
Builds the app for production to the `build` folder.<br /> | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
* It initializes create-react-app | ||
* It configures GoodData proxy | ||
* It adds GoodData.UI dependencies | ||
|
||
The build is minified and the filenames include the hashes.<br /> | ||
Your app is ready to be deployed! | ||
This app also shows: | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
* Use of `<AttributeFilter>` component | ||
* Use of `<Kpi>` component | ||
|
||
### `yarn eject` | ||
And finally this app demonstrates 3 approaches how to render visualizations: | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
* By referencing `<InsightView>` created in Analytical Designer | ||
* By specifying buckets (measures, viewBy, stackBy) with `<ColumnChart>` component | ||
* By creating custom column chart using `<Execute>` component and [Highcharts](https://www.highcharts.com/) library | ||
|
||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
## Live demo | ||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | ||
This app is deployed at https://gooddata-demo.s3.amazonaws.com/gd-ui-boilerplate-v8/index.html. For access, you can register at https://gooddata-examples.herokuapp.com/. | ||
|
||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | ||
## How to run locally | ||
|
||
## Learn More | ||
* `git clone --depth 1 https://github.com/gooddata/ui-sdk-examples.git` | ||
* `cd ui-sdk-examples/gd-ui-boilerplate-v8/` | ||
* `yarn install` | ||
* `yarn start` | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
## How to build for deployment | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
* `yarn build` when deploying to root folder | ||
* `PUBLIC_URL=/gd-ui-boilerplate-v8 yarn build` when deploying to `/gd-ui-boilerplate-v8` folder | ||
|
||
### Code Splitting | ||
## Backend/proxy info | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting | ||
This app is configured to run against https://developer.na.gooddata.com/. For access, you can register at https://gooddata-examples.herokuapp.com/. | ||
|
||
### Analyzing the Bundle Size | ||
## Screnshots | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size | ||
![homepage](https://raw.githubusercontent.com/gooddata/ui-sdk-examples/master/gd-ui-boilerplate-v8/public/screen1.png "Homepage") | ||
|
||
### Making a Progressive Web App | ||
--- | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app | ||
|
||
### Advanced Configuration | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration | ||
|
||
### Deployment | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment | ||
|
||
### `yarn build` fails to minify | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify | ||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
SCRIPTDIR=`dirname $0` | ||
ROOTDIR="${SCRIPTDIR}/.." | ||
EXPORTER="${ROOTDIR}/node_modules/.bin/gdc-catalog-export" | ||
OUTPUT="${ROOTDIR}/src/ldm/full.js" | ||
PROJECTID="xms7ga4tf3g3nzucd8380o2bev8oeknp" | ||
|
||
$EXPORTER \ | ||
--hostname "https://developer.na.gooddata.com" \ | ||
--output "${OUTPUT}" \ | ||
--project-id "${PROJECTID}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,3 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (C) 2007-2020, GoodData(R) Corporation. All rights reserved. | ||
import bearFactory, { | ||
ContextDeferredAuthProvider | ||
// FixedLoginAndPasswordAuthProvider | ||
} from "@gooddata/sdk-backend-bear"; | ||
|
||
const config = { | ||
hostname: "" | ||
}; | ||
|
||
if (process.env.NODE_ENV === "production") { | ||
const gdUrl = process.env.GD_URL; | ||
config.hostname = gdUrl | ||
? `https://${gdUrl}` | ||
: "https://developer.na.gooddata.com"; | ||
} | ||
|
||
const backend = bearFactory(config).withAuthentication( | ||
new ContextDeferredAuthProvider() | ||
); | ||
|
||
window.gooddata = backend; | ||
|
||
export default backend; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (C) 2007-2020, GoodData(R) Corporation. All rights reserved. | ||
import React from "react"; | ||
import ReactHighcharts from "react-highcharts"; | ||
import * as Ldm from "../ldm/full"; | ||
|
||
const CustomBarChart = ({ error, isLoading, result }) => { | ||
if (isLoading) { | ||
return <span>Loading…</span>; | ||
} | ||
|
||
if (error) { | ||
return <span>Something went wrong :-(</span>; | ||
} | ||
|
||
if (result) { | ||
const config = { | ||
chart: { | ||
type: "column" | ||
}, | ||
title: { | ||
text: "🎉🍾🙌 My First Custom Chart 🙌🍾🎉" | ||
}, | ||
series: result | ||
.data() | ||
.series() | ||
.firstForMeasure(Ldm.NrChecks) | ||
.dataPoints() | ||
.map((row, i) => ({ data: [parseFloat(row.rawValue)] })) | ||
}; | ||
|
||
return <ReactHighcharts config={config} />; | ||
} | ||
|
||
return "🧟♂️ UGLY INIT"; | ||
}; | ||
|
||
export default CustomBarChart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.