Page MenuHomePhorge

ManiphestProject
ActivePublic

Members

  • This project does not have any members.
  • View All

Watchers

  • This project does not have any watchers.
  • View All

Recent Activity

Wed, Oct 13

speck accepted D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Thanks!

Wed, Oct 13, 21:08 · Maniphest
Ekubischta accepted D25015: Show confirmation dialog when closing a modal if form contents have been changed.
Wed, Oct 13, 20:53 · Maniphest
Ekubischta added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#826, @speck wrote:

I think that makes sense. Could you make a task to address this so we don’t lose track of it? Then let’s get this landed.

Wed, Oct 13, 20:52 · Maniphest
speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

I think that makes sense. Could you make a task to address this so we don’t lose track of it? Then let’s get this landed.

Wed, Oct 13, 16:35 · Maniphest
Ekubischta added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

I feel like we should move translation to a new revision, so we can move forward with this one.

Wed, Oct 13, 01:47 · Maniphest

Tue, Oct 5

dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

I'm down to do a https://meet.jit.si/ with someone else who is also down for this idea as well as the idea of translatable generic confirm() and alert() dialogs that can trivially go from pht() in PHP to JavaScript. Anyone?

Tue, Oct 5, 03:43 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

We cam have a i18n option for both confirmDialog and alertDialog.... Let's do this, who is down?

Tue, Oct 5, 03:38 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#793, @dcog wrote:
In D25015#792, @dcog wrote:

Thanks -- Can anyone think of a more generic solution here as far as dialogs? Something for both confirm() and prompt().

One thing to note here: Native JavaScript blocks execution when these functions are used. This is apparently nearly impossible behavior to mimic exactly, but we can solve this with asynchronous functions with our generic and platform-specific confirm() and alert() functions. Otherwise, should there be an always-available global translation for both alert() and confirm()?

Example of custom confirm():

JX.confirm({
  message: "Form data may have changed. Are you sure you want to close this dialog?",
  buttonConfirm: "Discard Changes",
  buttonCancel: "Cancel",
  onConfirm: function() {
    // Something something
  }
});

But it would need translation added...

Tue, Oct 5, 03:37 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#792, @dcog wrote:

Thanks -- Can anyone think of a more generic solution here as far as dialogs? Something for both confirm() and prompt().

One thing to note here: Native JavaScript blocks execution when these functions are used. This is apparently nearly impossible behavior to mimic exactly, but we can solve this with asynchronous functions with our generic and platform-specific confirm() and alert() functions. Otherwise, should there be an always-available global translation for both alert() and confirm()?

Tue, Oct 5, 03:36 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Thanks -- Can anyone think of a more generic solution here as far as dialogs? Something for both confirm() and prompt().

Tue, Oct 5, 03:35 · Maniphest

Wed, Sep 22

speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#735, @avivey wrote:

I may be late for the party, but can't the translated verbiage be provided to the dialog in the $form_attributes in AphrontDialogView.php:337, and read using form.getAttribute(key) in the js?

I looked at the $form_attributes a week or so back but I think those end up being transformed into the literal HTML attributes of the dialog's <form> element. I think we need to add a new field to the dialog, something like setMetadata() that @dcog found in the workboard view.

Wed, Sep 22, 01:16 · Maniphest

Sep 20 2021

avivey added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

I may be late for the party, but can't the translated verbiage be provided to the dialog in the $form_attributes in AphrontDialogView.php:337, and read using form.getAttribute(key) in the js?

Sep 20 2021, 15:04 · Maniphest

Sep 17 2021

dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

What if, to get this functionality pushed through, we for now change the verbiage to two English words -- "Discard changes?"

Sep 17 2021, 02:17 · Maniphest

Sep 13 2021

dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Dug up some more info as well...

Sep 13 2021, 20:29 · Maniphest
speck updated subscribers of D25015: Show confirmation dialog when closing a modal if form contents have been changed.

@Leon95 updated/included some translated text for calendar widgets under D25016 which may also be useful as reference. However one big difference is that the calendar widget has its own explicit view/behavior, whereas front-end workflows have multiple varying uses with different content.

Sep 13 2021, 00:12 · Maniphest

Sep 4 2021

dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#678, @speck wrote:

It looks like there is a JX.phtize() which appears to be used to create a function that mimics pht() in JavaScript but I believe requires that whatever is passed to phtize() is effectively a map of translations which is presumably passed from the server somewhere. I've not yet uncovered this later part.

Sep 4 2021, 22:28 · Maniphest
speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

It looks like there is a JX.phtize() which appears to be used to create a function that mimics pht() in JavaScript but I believe requires that whatever is passed to phtize() is effectively a map of translations which is presumably passed from the server somewhere. I've not yet uncovered this later part.

Sep 4 2021, 19:10 · Maniphest

Aug 24 2021

speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#633, @avivey wrote:

In this case I think the error text is agnostic of the instance of the dialog.

I was thinking about this use-case, which implies to me that the dialog author should be involved in the error text:

image.png (206×423 px, 14 KB)

Aug 24 2021, 18:51 · Maniphest

Aug 20 2021

avivey added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

What are the implications of making changes to the javelinjs.com https://github.com/phacility/javelin/ library?

Aug 20 2021, 06:58 · Maniphest

Aug 19 2021

dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Also I don’t believe javelin.io is related to the Javalin used in Phab.

Aug 19 2021, 05:45 · Maniphest
speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Ah I did not look closely enough. Dang. We should be attaching the message to the view on the server then, somehow.

Aug 19 2021, 04:51 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Oh, another potential concern...

Aug 19 2021, 04:34 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#616, @speck wrote:

In this case I think the error text is agnostic of the instance of the dialog. From looking at AphrontDialogView I didn't see any obvious way to include additional fields/text that could be pulled out here on the front end. Looking elsewhere in this file (line ~297) it looks like some other generic text is used

if (!this._paused) {
  JX.$E('Resuming a workflow which is not paused!');
}

However that's the only case where JX.$E is used outside of an is-development check. I'm not sure where these Javascript translations would go or when the translation file is generated.

Aug 19 2021, 04:33 · Maniphest
speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

In this case I think the error text is agnostic of the instance of the dialog. From looking at AphrontDialogView I didn't see any obvious way to include additional fields/text that could be pulled out here on the front end. Looking elsewhere in this file (line ~297) it looks like some other generic text is used

if (!this._paused) {
  JX.$E('Resuming a workflow which is not paused!');
}
Aug 19 2021, 01:34 · Maniphest

Aug 18 2021

20after4 added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

+1 this has bitten me before.

Aug 18 2021, 18:08 · Maniphest

Jul 28 2021

avivey added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

The translated text can be a property of the dialogue itself, if we're worried about having extra objects laying around - the confirmation feels like it's a feature of the dialogue anyway.

Jul 28 2021, 07:20 · Maniphest
avivey added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

There's no way to invoke pht from JS (because it's really complicated in the general case). The general practice is to provide the translated value from PHP when building the relevant objects. There should be an example in the UIExamples app - there's a page with buttons built in JS.

Jul 28 2021, 07:11 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

I 100% agree with this. Is there no way to invoke internationalization via JS only? If not, that's perfectly great, but wondering about an answer offhand.

Jul 28 2021, 06:40 · Maniphest

Jul 26 2021

Ekubischta added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
Jul 26 2021, 22:31 · Maniphest

Jul 25 2021

dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

On a related note, tonight I discovered this UIExamples application (changing links from my Vagrant install):

Jul 25 2021, 04:07 · Maniphest
dcog added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.
In D25015#532, @speck wrote:

It’s generally more clear to have the buttons read “Discard changes” vs. “Ok” or “Yes”

I agree

Would it be easy to change the prompt to be more descriptive with actions?

For me, I think it might be on the hard side... and maybe add some bloat? Unless there is a styled generic confirm box created that maybe uses a callback instead of blocks execution...

Jul 25 2021, 03:30 · Maniphest
dcog updated the summary of D25015: Show confirmation dialog when closing a modal if form contents have been changed.
Jul 25 2021, 03:02 · Maniphest

Jul 24 2021

speck added a comment to D25015: Show confirmation dialog when closing a modal if form contents have been changed.

Would it be easy to change the prompt to be more descriptive with actions? It’s generally more clear to have the buttons read “Discard changes” vs. “Ok” or “Yes”

Jul 24 2021, 21:04 · Maniphest
dcog requested review of D25015: Show confirmation dialog when closing a modal if form contents have been changed.
Jul 24 2021, 06:55 · Maniphest
dcog updated the task description for T15034: Show confirmation dialog when closing a modal if form contents have been changed.
Jul 24 2021, 06:47 · Maniphest
dcog created T15034: Show confirmation dialog when closing a modal if form contents have been changed.
Jul 24 2021, 06:47 · Maniphest

Jun 15 2021

Matthew changed the visibility for Maniphest.
Jun 15 2021, 04:26

Jun 11 2021

Matthew created Maniphest.
Jun 11 2021, 16:16