forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get rid of global
notify
(apache#5355)
* [toasts] get rid of notify globals, refactor messageToasts for use by entire app * [remove notify] use arrow func in ajax call * fix lint + tests * actually fix tests from messageToast refactor * add 'test:one' npm script * debugger * [toasts] convert bootstrap flash messages to toasts in explore + sqllab * [toasts][tests] import from right file (cherry picked from commit 19ac6e1)
- Loading branch information
1 parent
f8eaa02
commit 523d25b
Showing
70 changed files
with
642 additions
and
518 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
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
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
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,33 @@ | ||
{ | ||
"extends": "prettier", | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"prefer-template": 2, | ||
"new-cap": 2, | ||
"no-restricted-syntax": 2, | ||
"guard-for-in": 2, | ||
"prefer-arrow-callback": 2, | ||
"func-names": 2, | ||
"react/jsx-no-bind": 2, | ||
"no-confusing-arrow": 2, | ||
"jsx-a11y/no-static-element-interactions": 2, | ||
"jsx-a11y/anchor-has-content": 2, | ||
"react/require-default-props": 2, | ||
"no-plusplus": 2, | ||
"no-mixed-operators": 0, | ||
"no-continue": 2, | ||
"no-bitwise": 2, | ||
"no-undef": 2, | ||
"no-multi-assign": 2, | ||
"no-restricted-properties": 2, | ||
"no-prototype-builtins": 2, | ||
"jsx-a11y/href-no-hash": 2, | ||
"class-methods-use-this": 2, | ||
"import/no-named-as-default": 2, | ||
"import/prefer-default-export": 2, | ||
"react/no-unescaped-entities": 2, | ||
"react/no-string-refs": 2, | ||
"react/jsx-indent": 0, | ||
"prettier/prettier": "error" | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
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
5 changes: 1 addition & 4 deletions
5
...s/dashboard/fixtures/mockMessageToasts.js → ...cripts/messageToasts/mockMessageToasts.js
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
7 changes: 2 additions & 5 deletions
7
.../dashboard/reducers/messageToasts_spec.js → ...sageToasts/reducers/messageToasts_spec.js
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
35 changes: 35 additions & 0 deletions
35
superset/assets/spec/javascripts/messageToasts/utils/getToastsFromPyFlashMessages_spec.js
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,35 @@ | ||
import { describe, it } from 'mocha'; | ||
import { expect } from 'chai'; | ||
|
||
import { | ||
DANGER_TOAST, | ||
INFO_TOAST, | ||
SUCCESS_TOAST, | ||
} from '../../../../src/messageToasts/constants'; | ||
|
||
import getToastsFromPyFlashMessages from '../../../../src/messageToasts/utils/getToastsFromPyFlashMessages'; | ||
|
||
describe('getToastsFromPyFlashMessages', () => { | ||
it('should return an info toast', () => { | ||
const toast = getToastsFromPyFlashMessages([['info', 'info test']])[0]; | ||
expect(toast).to.deep.include({ toastType: INFO_TOAST, text: 'info test' }); | ||
}); | ||
|
||
it('should return a success toast', () => { | ||
const toast = getToastsFromPyFlashMessages([ | ||
['success', 'success test'], | ||
])[0]; | ||
expect(toast).to.deep.include({ | ||
toastType: SUCCESS_TOAST, | ||
text: 'success test', | ||
}); | ||
}); | ||
|
||
it('should return a danger toast', () => { | ||
const toast = getToastsFromPyFlashMessages([['danger', 'danger test']])[0]; | ||
expect(toast).to.deep.include({ | ||
toastType: DANGER_TOAST, | ||
text: 'danger test', | ||
}); | ||
}); | ||
}); |
31 changes: 0 additions & 31 deletions
31
superset/assets/spec/javascripts/sqllab/AlertsWrapper_spec.jsx
This file was deleted.
Oops, something went wrong.
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
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
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.