Skip to content

Commit

Permalink
Unfinished changes on 2.1. Commiting just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
saghatelian committed Jul 8, 2023
1 parent 9bab31a commit 3121a5f
Show file tree
Hide file tree
Showing 10 changed files with 78,051 additions and 65,362 deletions.
2 changes: 1 addition & 1 deletion docker-compose-non-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
x-superset-image: &superset-image apache/superset:${TAG:-latest-dev}
x-superset-image: &superset-image apache/superset:${TAG:-2.1.0}
x-superset-depends-on: &superset-depends-on
- db
- redis
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
x-superset-image: &superset-image apache/superset:${TAG:-latest-dev}
x-superset-image: &superset-image apache/superset:${TAG:-2.1.0}
x-superset-user: &superset-user root
x-superset-depends-on: &superset-depends-on
- db
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ esm/
lib/
tmp/
storybook-static/
plugins/funnel-chart-plugin/*
143,291 changes: 77,933 additions & 65,358 deletions superset-frontend/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@fontsource/inter": "^4.0.0",
"@nischalbharat/calendar-range-plugin": "^0.0.1",
"@superset-ui/chart-controls": "file:./packages/superset-ui-chart-controls",
"@superset-ui/core": "file:./packages/superset-ui-core",
"@superset-ui/legacy-plugin-chart-calendar": "file:./plugins/legacy-plugin-chart-calendar",
Expand Down Expand Up @@ -135,6 +136,7 @@
"fast-glob": "^3.2.7",
"fontsource-fira-code": "^4.0.0",
"fs-extra": "^10.0.0",
"funnel-chart-plugin": "^0.1.1",
"fuse.js": "^6.4.6",
"geolib": "^2.0.24",
"global-box": "^1.2.0",
Expand Down
40 changes: 40 additions & 0 deletions superset-frontend/plugins/funnel-chart-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# supersetx-funnel-chart-plugin

This is the Supersetx Funnel Chart Plugin Superset Chart Plugin.

### Usage

To build the plugin, run the following commands:

```
npm ci
npm run build
```

Alternatively, to run the plugin in development mode (=rebuilding whenever changes are made), start the dev server with the following command:

```
npm run dev
```

To add the package to Superset, go to the `superset-frontend` subdirectory in your Superset source folder (assuming both the `supersetx-funnel-chart-plugin` plugin and `superset` repos are in the same root directory) and run
```
npm i -S ../../supersetx-funnel-chart-plugin
```

After this edit the `superset-frontend/src/visualizations/presets/MainPreset.js` and make the following changes:

```js
import { SupersetxFunnelChartPlugin } from 'supersetx-funnel-chart-plugin';
```

to import the plugin and later add the following to the array that's passed to the `plugins` property:
```js
new SupersetxFunnelChartPlugin().configure({ key: 'supersetx-funnel-chart-plugin' }),
```

After that the plugin should show up when you run Superset, e.g. the development server:

```
npm run dev-server
```
64 changes: 64 additions & 0 deletions superset-frontend/plugins/funnel-chart-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "funnel-chart-plugin",
"version": "0.1.1",
"description": "Funnel Chart Plugin",
"sideEffects": false,
"main": "dist/lib.js",

"files": [
"dist"
],
"private": true,
"scripts": {
"build": "npm run build-cjs && npm run build-esm && npm run ts-types",
"build-cjs": "babel src --extensions \".ts,.tsx,.js,.jsx\" --copy-files --out-dir lib",
"build-clean": "npm run clean && npm run build",
"build-esm": "BABEL_OUTPUT=esm babel src --extensions \".ts,.tsx,.js,.jsx\" --copy-files --out-dir esm",
"dev": "BABEL_OUTPUT=esm babel src --extensions \".ts,.tsx,.js,.jsx\" --watch --copy-files --out-dir esm",
"prebuild": "rimraf {lib,esm,tsconfig.tsbuildinfo,dist}",
"postbuild": "npm run test",
"ts-types": "tsc --build",
"test": "jest"
},
"author": "Aldrin Rayen",
"license": "Apache-2.0",

"dependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-react": "^7.18.6",
"crypto-browserify": "^3.12.0",
"echarts": "^5.4.1",
"echarts-for-react": "^3.0.2",
"file-loader": "^6.2.0"
},
"peerDependencies": {
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*",
"react": "^16.13.1"
},
"devDependencies": {
"@airbnb/config-babel": "^2.0.1",
"@babel/cli": "^7.16.0",
"@babel/core": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@types/jest": "^26.0.4",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^9.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
"jest": "^26.6.3",
"rimraf": "^3.0.2",
"typescript": "^4.1.2",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-node-externals": "^3.0.0"
}
}
4 changes: 3 additions & 1 deletion superset-frontend/src/views/CRUD/welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
const isRecentActivityLoading =
!activityData?.[TableTab.Other] && !activityData?.[TableTab.Viewed];

window.location.replace('/superset/dashboard/home/');

return (
<WelcomeContainer>
{WelcomeMessageExtension && <WelcomeMessageExtension />}
Expand All @@ -342,7 +344,7 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
{(!WelcomeTopExtension || !WelcomeMainExtension) && (
<>
<WelcomeNav>
<h1 className="welcome-header">{t('Home')}</h1>
<h1 className="welcome-header">{t('Home (Customized by 10Web)')}</h1>

Check failure on line 347 in superset-frontend/src/views/CRUD/welcome/Welcome.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Replace `{t('Home·(Customized·by·10Web)')}` with `⏎··············{t('Home·(Customized·by·10Web)')}⏎············`
{isFeatureEnabled(FeatureFlag.THUMBNAILS) ? (
<div className="switch">
<AntdSwitch checked={checked} onChange={handleToggle} />
Expand Down
5 changes: 5 additions & 0 deletions superset-frontend/src/visualizations/presets/MainPreset.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ import {
TimeGrainFilterPlugin,
GroupByFilterPlugin,
} from 'src/filters/components';
import CalendarRangePlugin from '@nischalbharat/calendar-range-plugin';
import { SupersetxFunnelChartPlugin } from 'funnel-chart-plugin';

Check failure on line 82 in superset-frontend/src/visualizations/presets/MainPreset.js

View workflow job for this annotation

GitHub Actions / frontend-build

Unable to resolve path to module 'funnel-chart-plugin'

import { PivotTableChartPlugin as PivotTableChartPluginV2 } from '@superset-ui/plugin-chart-pivot-table';
import { HandlebarsChartPlugin } from '@superset-ui/plugin-chart-handlebars';
import FilterBoxChartPlugin from '../FilterBox/FilterBoxChartPlugin';
Expand Down Expand Up @@ -168,6 +171,8 @@ export default class MainPreset extends Preset {
new EchartsTreeChartPlugin().configure({ key: 'tree_chart' }),
new EchartsSunburstChartPlugin().configure({ key: 'sunburst_v2' }),
new HandlebarsChartPlugin().configure({ key: 'handlebars' }),
new CalendarRangePlugin().configure({ key: 'calendar_range' }),
new SupersetxFunnelChartPlugin().configure({ key: 'funnel_chart' }),
...experimentalplugins,
],
});
Expand Down
2 changes: 1 addition & 1 deletion superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,4 +678,4 @@ def enable_profiling(self) -> None:
class SupersetIndexView(IndexView):
@expose("/")
def index(self) -> FlaskResponse:
return redirect("/superset/welcome/")
return redirect("/superset/dashboard/home/")

0 comments on commit 3121a5f

Please sign in to comment.