Skip to content

Commit 7fef8ed

Browse files
committed
renamed SHOW_STANDARD_ALERT to SHOW_ALERT
1 parent 1d44b10 commit 7fef8ed

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

src/containers/alerts.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import {connect} from 'react-redux';
4-
import {AlertTypes} from '../lib/alerts/index.jsx';
54

65
import {
76
closeAlert,

src/containers/inline-messages.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import {connect} from 'react-redux';
4-
import {AlertTypes} from '../lib/alerts/index.jsx';
54

65
import {
76
filterInlineAlerts

src/reducers/alerts.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@ import alertsData from '../lib/alerts/index.jsx';
22
import {AlertTypes, AlertLevels} from '../lib/alerts/index.jsx';
33
import extensionData from '../lib/libraries/extensions/index.jsx';
44

5-
const SHOW_STANDARD_ALERT = 'scratch-gui/alerts/SHOW_STANDARD_ALERT';
5+
const SHOW_ALERT = 'scratch-gui/alerts/SHOW_ALERT';
66
const SHOW_EXTENSION_ALERT = 'scratch-gui/alerts/SHOW_EXTENSION_ALERT';
77
const CLOSE_ALERT = 'scratch-gui/alerts/CLOSE_ALERT';
88
const CLOSE_ALERTS_WITH_ID = 'scratch-gui/alerts/CLOSE_ALERTS_WITH_ID';
99

10+
/**
11+
* Initial state of alerts reducer
12+
*
13+
* {bool} visible - whether the alerts are visible
14+
* {array} alertsList - list of alerts, each with properties:
15+
* * alert type (required): one of AlertTypes
16+
* * closeButton (optional): bool indicating that we should show close button
17+
* * content (optional): react element (a <FormattedMessage />)
18+
* * extentionId (optional): id string that identifies the extension
19+
* * iconURL (optional): string
20+
* * level (required): string, one of AlertLevels
21+
* * message (optional): string
22+
* * showReconnect (optional): bool
23+
*/
1024
const initialState = {
1125
visible: true,
12-
// list of alerts, each with properties:
13-
// * alert type (required): one of AlertTypes
14-
// * closeButton (optional): bool indicating that we should show close button
15-
// * content (optional): react element (a <FormattedMessage />)
16-
// * extentionId (optional): id string that identifies the extension
17-
// * iconURL (optional): string
18-
// * level (required): string, one of AlertLevels
19-
// * message (optional): string
20-
// * showReconnect (optional): bool
2126
alertsList: []
2227
};
2328

@@ -37,7 +42,7 @@ const filterInlineAlerts = alertsList => (
3742
const reducer = function (state, action) {
3843
if (typeof state === 'undefined') state = initialState;
3944
switch (action.type) {
40-
case SHOW_STANDARD_ALERT: { // also will show inline alerts
45+
case SHOW_ALERT: { // shows standard and inline alerts
4146
const alertId = action.alertId;
4247
if (alertId) {
4348
const newAlert = {
@@ -147,7 +152,7 @@ const closeAlertsWithId = function (alertId) {
147152
*/
148153
const showStandardAlert = function (alertId) {
149154
return {
150-
type: SHOW_STANDARD_ALERT,
155+
type: SHOW_ALERT,
151156
alertId
152157
};
153158
};

0 commit comments

Comments
 (0)