Skip to content

JENKINS-62285 Don't use browser alert for notifications and confirmation #60

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

Closed
wants to merge 3 commits into from

Conversation

aytuncbeken
Copy link

Hi,
As a part of the UI Hackfest. I fixed the issue JENKINS-62285.
I hope this PR is acceptable for you.

You can see the details of the issue from here.
https://issues.jenkins-ci.org/browse/JENKINS-62285

alert('The role was added successfully');
location.reload(); // refresh the page
showNotificationOK('The role was added successfully');
//location.reload(); // refresh the page
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't leave commented out code in, it looks like the function handles this?

Suggested change
//location.reload(); // refresh the page

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that, removed now

@timja
Copy link
Member

timja commented May 27, 2020

It would be best to name your PR with a summary description of what this PR does

@aytuncbeken aytuncbeken changed the title JENKINS-62285 JENKINS-62285 Don't use browser alert for notifications and confirmation May 27, 2020
} else {
alert('Unable to remove the sid.' + request.responseText);
showNotificationOK('Sid removed successfully.');
} else {s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
} else {s
} else {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}

function showNotificationOK(message) {
showNotification(message, notificationBar.OK, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a small problem with this behaviour. The page only refreshes when the success notification disappears. So for about 2 seconds, the notification shows but the content is not updated. With the alerts, as soon as the user clicked OK, the page was refreshed. Would it be possible to use a modal popup here? Also note that I'm working on #58 which will completely change the UI.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your comment. I will search for modal solution, not sure though if its possible or not. For providing similar functionality I added optional reload feature, which waits for notification.DELAY.

About the UI change, of course It is up to you. We can apply this change until the new UI is published.

@timja Do you know any examples for Modal implementation ? Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to not refresh the page and to do a live update, or let the user refresh it themselves really.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is topic of the UI change that @AbhyudayaSharma mentioned. Should we decline this request then ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the code will likely still be useful, thanks for doing this!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem

@AbhyudayaSharma
Copy link
Member

Thanks @aytuncbeken ! This code will be useful for me when working on #58. I'm closing this PR then.

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.

3 participants