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

Confirm dialog modal implementation #763

Merged
merged 2 commits into from
Oct 3, 2016

Conversation

mbayopanda
Copy link
Contributor

This PR :

  • Add a generic confirm dialog modal box,
  • Remove de confirmDeletion modal and replace it with the confirmDialog modal
  • Update the project deletion and the patient document deletion

confirm dialog

close #759

@mbayopanda
Copy link
Contributor Author

@jniles could you review this PR

@jniles
Copy link
Contributor

jniles commented Oct 3, 2016

@mbayopanda, the text "Veuillez saisir 'Le nom du project' pour confirmer" makes me think that I should type Le nom du project in in the box. I assume you want the user to type the actual project name.

I would either remove the quotes (Veuillez saisir le nom du project pour confirmer) or actually template in the project name (Veuillez saisir "Project Pax Clinique" pour confirmer). Does that make sense?

@mbayopanda
Copy link
Contributor Author

@jniles you're right.

Copy link
Contributor

@jniles jniles left a comment

Choose a reason for hiding this comment

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

Everything LGTM. Happy to merge this.

It's your choice if you want to work on the $translate parameters now or put if off for later. If later, just say so and I'll merge this.

"PLEASE_TYPE_TEXT" : "Please type in the %ELEMENT% name to confirm",
"CANNOT_UNDONE_ACTION" : "This action CANNOT BE REVERSED, this action will be permanent. You must be sure that you want to do this action",
"NO_CORRESPONDANCY" : "No correspondancy found for ",
"PLEASE_TYPE_TEXT" : "Please type %ELEMENT% to confirm",
Copy link
Contributor

Choose a reason for hiding this comment

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

For future reference, angular-translate provides variable substitution so that you do not have to do this manually. Documentation. An interesting PR related to this.

Since we've been using this style long term, I don't mind merging this PR. But if possible, it would be nice to move to angular-translate's way of putting parameters into our translations. I made an issue about it a long time ago: #408.

Copy link
Contributor Author

@mbayopanda mbayopanda Oct 3, 2016

Choose a reason for hiding this comment

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

Cool 👍


Modal.openConfirmDeletion(request)
Modal.openConfirmDialog(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

Confirm Dialog is much better name 👍.

var request = { pattern: pattern, elementName: 'document'};
var request = {
pattern: pattern,
patternName: 'FORM.PATTERNS.DOCUMENT_NAME'
Copy link
Contributor

Choose a reason for hiding this comment

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

patternName is a much better name 👍

@@ -170,10 +170,10 @@ function EnterpriseController($translate, Enterprises, Currencies, Accounts, uti
function deleteProject(id, pattern) {
var params = {
pattern: pattern,
elementName: $translate.instant('FORM.LABELS.PROJECT')
patternName: 'FORM.PATTERNS.PROJECT_NAME'
Copy link
Contributor

@jniles jniles Oct 3, 2016

Choose a reason for hiding this comment

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

I'm glad the $translate call has finally been moved into the modal. This is a nice improvement.

"PLEASE_TYPE_TEXT" : "Please type in the %ELEMENT% name to confirm",
"CANNOT_UNDONE_ACTION" : "This action CANNOT BE REVERSED, this action will be permanent. You must be sure that you want to do this action",
"NO_CORRESPONDANCY" : "No correspondancy found for ",
"PLEASE_TYPE_TEXT" : "Please type {{value}} to confirm",
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

@jniles jniles merged commit 85a842a into IMA-WorldHealth:master Oct 3, 2016
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.

Generic Confirm Dialog Modal
2 participants