Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Add notification for successful archive action
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkro committed Jun 5, 2018
1 parent 59fded6 commit cb5962b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
4 changes: 3 additions & 1 deletion app/javascript/react/screens/App/Overview/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ class Overview extends React.Component {
allArchivedPlanRequestsWithTasks,
archiveTransformationPlanAction,
archiveTransformationPlanUrl,
isFetchingArchivedTransformationPlans
isFetchingArchivedTransformationPlans,
addNotificationAction
} = this.props;

const inProgressRequestsTransformationMappings = () => {
Expand Down Expand Up @@ -347,6 +348,7 @@ class Overview extends React.Component {
}
archiveTransformationPlanAction={archiveTransformationPlanAction}
archiveTransformationPlanUrl={archiveTransformationPlanUrl}
addNotificationAction={addNotificationAction}
/>
)}
{hasSufficientProviders ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const Migrations = ({
archivedTransformationPlans,
allArchivedPlanRequestsWithTasks,
archiveTransformationPlanAction,
archiveTransformationPlanUrl
archiveTransformationPlanUrl,
addNotificationAction
}) => {
const filterOptions = [
MIGRATIONS_FILTERS.notStarted,
Expand Down Expand Up @@ -131,6 +132,7 @@ const Migrations = ({
archiveTransformationPlanUrl={archiveTransformationPlanUrl}
fetchTransformationPlansAction={fetchTransformationPlansAction}
fetchTransformationPlansUrl={fetchTransformationPlansUrl}
addNotificationAction={addNotificationAction}
/>
)}
{activeFilter === MIGRATIONS_FILTERS.archived && (
Expand Down Expand Up @@ -170,7 +172,8 @@ Migrations.propTypes = {
allArchivedPlanRequestsWithTasks: PropTypes.array,
isFetchingArchivedTransformationPlans: PropTypes.string,
archiveTransformationPlanAction: PropTypes.func,
archiveTransformationPlanUrl: PropTypes.string
archiveTransformationPlanUrl: PropTypes.string,
addNotificationAction: PropTypes.func
};
Migrations.defaultProps = {
transformationPlans: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const MigrationsCompletedList = ({
archiveTransformationPlanUrl,
fetchTransformationPlansAction,
fetchTransformationPlansUrl,
addNotificationAction,
archived
}) => (
<Grid.Col xs={12}>
Expand Down Expand Up @@ -93,12 +94,18 @@ const MigrationsCompletedList = ({
archiveTransformationPlanUrl,
plan.id
)
.then(() =>
fetchTransformationPlansAction({
.then(() => {
addNotificationAction({
message: sprintf(__('%s successfully archived'), plan.name),
notificationType: 'success',
persistent: false
});

return fetchTransformationPlansAction({
url: fetchTransformationPlansUrl,
archived: false
})
)
});
})
.then(() => {
hideConfirmModalAction();
});
Expand Down Expand Up @@ -213,7 +220,8 @@ MigrationsCompletedList.propTypes = {
archiveTransformationPlanAction: PropTypes.func,
archiveTransformationPlanUrl: PropTypes.string,
fetchTransformationPlansAction: PropTypes.func,
fetchTransformationPlansUrl: PropTypes.string
fetchTransformationPlansUrl: PropTypes.string,
addNotificationAction: PropTypes.func
};
MigrationsCompletedList.defaultProps = {
finishedTransformationPlans: [],
Expand Down

0 comments on commit cb5962b

Please sign in to comment.