Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/apache/superset into fix/…
Browse files Browse the repository at this point in the history
…issue_16254_tab_title
  • Loading branch information
geido committed Aug 23, 2021
2 parents 285cfe3 + 970d762 commit 58d16d5
Show file tree
Hide file tree
Showing 30 changed files with 508 additions and 127 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ update-py:

update-js:
# Install js packages
cd superset-frontend; npm install
cd superset-frontend; npm ci

venv:
# Create a virtual environment and activate it (recommended)
Expand All @@ -81,3 +81,9 @@ py-lint: pre-commit

js-format:
cd superset-frontend; npm run prettier

flask-app:
flask run -p 8088 --with-threads --reload --debugger

node-app:
cd superset-frontend; npm run dev-server
19 changes: 19 additions & 0 deletions docs/src/pages/docs/installation/configuring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,25 @@ CUSTOM_SECURITY_MANAGER = CustomSsoSecurityManager
]
```

### Flask app Configuration Hook

`FLASK_APP_MUTATOR` is a configuration function that can be provided in your environment, receives
the app object and can alter it in any way. For example, add `FLASK_APP_MUTATOR` into your
`superset_config.py` to setup session cookie expiration time to 24 hours:

```
def make_session_permanent():
'''
Enable maxAge for the cookie 'session'
'''
session.permanent = True
# Set up max age of session to 24 hours
PERMANENT_SESSION_LIFETIME = timedelta(hours=24)
def FLASK_APP_MUTATOR(app: Flask) -> None:
app.before_request_funcs.setdefault(None, []).append(make_session_permanent)
```

### Feature Flags

To support a diverse set of users, Superset has some features that are not enabled by default. For
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.3.5
version: 0.3.6
dependencies:
- name: postgresql
version: 10.2.0
Expand Down
6 changes: 6 additions & 0 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ spec:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
readOnly: true
{{- with .Values.extraVolumeMounts }}
{{- tpl (toYaml .) $ | nindent 12 -}}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
Expand All @@ -108,4 +111,7 @@ spec:
- name: superset-config
secret:
secretName: {{ tpl .Values.configFromSecret . }}
{{- with .Values.extraVolumes }}
{{- tpl (toYaml .) $ | nindent 8 -}}
{{- end }}
{{- end -}}
6 changes: 6 additions & 0 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ spec:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
readOnly: true
{{- with .Values.extraVolumeMounts }}
{{- tpl (toYaml .) $ | nindent 12 -}}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
Expand All @@ -109,3 +112,6 @@ spec:
- name: superset-config
secret:
secretName: {{ tpl .Values.configFromSecret . }}
{{- with .Values.extraVolumes }}
{{- tpl (toYaml .) $ | nindent 8 -}}
{{- end }}
6 changes: 6 additions & 0 deletions helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ spec:
mountPath: {{ .Values.extraConfigMountPath | quote }}
readOnly: true
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- tpl (toYaml .) $ | nindent 12 -}}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down Expand Up @@ -127,3 +130,6 @@ spec:
configMap:
name: {{ template "superset.fullname" . }}-extra-config
{{- end }}
{{- with .Values.extraVolumes }}
{{- tpl (toYaml .) $ | nindent 8 -}}
{{- end }}
6 changes: 6 additions & 0 deletions helm/superset/templates/init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
mountPath: {{ .Values.extraConfigMountPath | quote }}
readOnly: true
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- tpl (toYaml .) $ | nindent 10 -}}
{{- end }}
command: {{ tpl (toJson .Values.init.command) . }}
resources:
{{ toYaml .Values.init.resources | indent 10 }}
Expand All @@ -76,5 +79,8 @@ spec:
configMap:
name: {{ template "superset.fullname" . }}-extra-config
{{- end }}
{{- with .Values.extraVolumes }}
{{- tpl (toYaml .) $ | nindent 8 -}}
{{- end }}
restartPolicy: Never
{{- end }}
16 changes: 16 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ extraConfigs: {}

extraSecrets: {}

extraVolumes: []
# - name: customConfig
# configMap:
# name: '{{ template "superset.fullname" . }}-custom-config'
# - name: additionalSecret
# secret:
# secretName: my-secret
# defaultMode: 0600

extraVolumeMounts: []
# - name: customConfig
# mountPath: /mnt/config
# readOnly: true
# - name: additionalSecret:
# mountPath: /mnt/secret

# A dictionary of overrides to append at the end of superset_config.py - the name does not matter
# WARNING: the order is not guaranteed
configOverrides: {}
Expand Down
28 changes: 14 additions & 14 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.85",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.85",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.85",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.85",
"@superset-ui/legacy-preset-chart-deckgl": "^0.4.10",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.86",
"@superset-ui/legacy-preset-chart-deckgl": "^0.4.11",
"@superset-ui/legacy-preset-chart-nvd3": "^0.17.85",
"@superset-ui/plugin-chart-echarts": "^0.17.85",
"@superset-ui/plugin-chart-pivot-table": "^0.17.85",
Expand Down
38 changes: 38 additions & 0 deletions superset-frontend/spec/fixtures/mockReportState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
*
* http://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 dashboardInfo from './mockDashboardInfo';
import { user } from '../javascripts/sqllab/fixtures';

export default {
active: true,
creation_method: 'dashboards',
crontab: '0 12 * * 1',
dashboard: dashboardInfo.id,
name: 'Weekly Report',
owners: [user.userId],
recipients: [
{
recipient_config_json: {
target: user.email,
},
type: 'Email',
},
],
type: 'Report',
};
46 changes: 46 additions & 0 deletions superset-frontend/spec/fixtures/mockStateWithoutUser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
*
* http://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 datasources from 'spec/fixtures/mockDatasource';
import messageToasts from 'spec/javascripts/messageToasts/mockMessageToasts';
import {
nativeFiltersInfo,
mockDataMaskInfo,
} from 'spec/javascripts/dashboard/fixtures/mockNativeFilters';
import chartQueries from 'spec/fixtures/mockChartQueries';
import { dashboardLayout } from 'spec/fixtures/mockDashboardLayout';
import dashboardInfo from 'spec/fixtures/mockDashboardInfo';
import { emptyFilters } from 'spec/fixtures/mockDashboardFilters';
import dashboardState from 'spec/fixtures/mockDashboardState';
import { sliceEntitiesForChart } from 'spec/fixtures/mockSliceEntities';
import reports from 'spec/fixtures/mockReportState';

export default {
datasources,
sliceEntities: sliceEntitiesForChart,
charts: chartQueries,
nativeFilters: nativeFiltersInfo,
dataMask: mockDataMaskInfo,
dashboardInfo,
dashboardFilters: emptyFilters,
dashboardState,
dashboardLayout,
messageToasts,
impressionId: 'mock_impression_id',
reports,
};
2 changes: 2 additions & 0 deletions superset-frontend/spec/helpers/reducerIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import saveModal from 'src/explore/reducers/saveModalReducer';
import explore from 'src/explore/reducers/exploreReducer';
import sqlLab from 'src/SqlLab/reducers/sqlLab';
import localStorageUsageInKilobytes from 'src/SqlLab/reducers/localStorageUsage';
import reports from 'src/reports/reducers/reports';

const impressionId = (state = '') => state;

Expand All @@ -53,5 +54,6 @@ export default {
explore,
sqlLab,
localStorageUsageInKilobytes,
reports,
common: () => common,
};
Loading

0 comments on commit 58d16d5

Please sign in to comment.