Skip to content
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

Merged
merged 8 commits into from
Sep 21, 2018

Conversation

WakeupTsai
Copy link
Contributor

No description provided.

@@ -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({
Copy link
Contributor

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({
Copy link
Contributor

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) => {
Copy link
Contributor

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({
Copy link
Contributor

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.'
Copy link
Contributor

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.

@@ -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.'
Copy link
Contributor

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.

@LucienLee LucienLee merged commit f61a9e9 into develop Sep 21, 2018
@LucienLee LucienLee deleted the phstsai/notification branch September 21, 2018 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants