-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Task] Pop notification when creating or deleting resources #34
Conversation
@@ -71,6 +71,10 @@ class CreateDeployment extends React.Component< | |||
protected handleSubmit = (deployment: DeploymentModel.Deployment) => { | |||
this.props.addDeployment(deployment); | |||
this.props.push('/application/deployment'); | |||
return notification.success({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't need to return.
} | ||
}; | ||
|
||
protected handleRemoveDeployment = (id: string) => { | ||
this.setState({ deletable: false }); | ||
this.props.removeDeployment(id); | ||
clearInterval(this.intervalPodId); | ||
return notification.success({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't need to return
return <Icon type="clock-circle" className={styles.pendIcon} />; | ||
default: | ||
return <Icon type="close-circle" className={styles.errorIcon} />; | ||
protected renderStatusIcon = (deployment: DeploymentModel.Controller) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Nice to have
const isPending = deployment.currentPod === deployment.desiredPod;
const isRunning = deployment.currentPod === deployment.availablePod;
const classname = isPending
? ( isRunning ? styles.readyIcon : styles.pending )
: styles.errorIcon
return ;
@@ -50,14 +50,26 @@ class Namespace extends React.Component<NamespaceProps, NamespaceState> { | |||
protected handleSubmit = (namespace: NamespaceModel.Namespace) => { | |||
this.props.addNamespace(namespace); | |||
this.setState({ visibleModal: false }); | |||
return notification.success({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't have to return
@@ -50,14 +50,26 @@ class Namespace extends React.Component<NamespaceProps, NamespaceState> { | |||
protected handleSubmit = (namespace: NamespaceModel.Namespace) => { | |||
this.props.addNamespace(namespace); | |||
this.setState({ visibleModal: false }); | |||
return notification.success({ | |||
message: 'Success', | |||
description: 'Create the namespace successfully.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have to put into i18n. You can look what I did in another files.
b643e7d
to
93e5bc3
Compare
src/components/PodDrawer/index.tsx
Outdated
@@ -182,7 +182,7 @@ class PodDrawer extends React.PureComponent<PodDrawerProps, PodDrawerState> { | |||
protected handleRemovePod = (id: string) => { | |||
this.setState({ deletable: false }); | |||
this.props.removePod(id); | |||
return notification.success({ | |||
notification.success({ | |||
message: 'Success', | |||
description: 'Delete the pod successfully.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please enable i18n on notification message.
02e4ff4
to
c9c5a04
Compare
8b9f1d4
to
21eb87f
Compare
No description provided.