Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
chore(dashboard): Add filter_scopes warning message for json metadata…
Browse files Browse the repository at this point in the history
… editor (apache#21543)

Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
(cherry picked from commit 2cdd88a)
  • Loading branch information
justinpark authored and john-bodley committed Sep 27, 2022
1 parent 6accf2f commit 655cea0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import Modal from 'src/components/Modal';
import { JsonEditor } from 'src/components/AsyncAceEditor';

import ColorSchemeControlWrapper from 'src/dashboard/components/ColorSchemeControlWrapper';
import FilterScopeModal from 'src/dashboard/components/filterscope/FilterScopeModal';
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import withToasts from 'src/components/MessageToasts/withToasts';
import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags';
Expand Down Expand Up @@ -655,6 +656,23 @@ const PropertiesModal = ({
{t(
'This JSON object is generated dynamically when clicking the save or overwrite button in the dashboard view. It is exposed here for reference and for power users who may want to alter specific parameters.',
)}
{onlyApply && (
<>
{' '}
{t(
'Please DO NOT overwrite the "filter_scopes" key.',
)}{' '}
<FilterScopeModal
triggerNode={
<span className="alert-link">
{t('Use "%(menuName)s" menu instead.', {
menuName: t('Set filter mapping'),
})}
</span>
}
/>
</>
)}
</p>
</>
)}
Expand Down
5 changes: 4 additions & 1 deletion superset-frontend/src/views/routes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/

import React from 'react';
import { isFrontendRoute, routes } from './routes';

jest.mock('src/featureFlags', () => ({
...jest.requireActual<object>('src/featureFlags'),
isFeatureEnabled: jest.fn().mockReturnValue(true),
}));
jest.mock('src/views/CRUD/welcome/Welcome', () => () => (
<div data-test="mock-welcome" />
));

describe('isFrontendRoute', () => {
it('returns true if a route matches', () => {
Expand Down

0 comments on commit 655cea0

Please sign in to comment.