Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345056 - disable the submit button if we know that we get an error
Summary: disable the submit button if we know that we get an error
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7   Edit
Assignee: Frank Becker CLA
QA Contact: Frank Becker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 335533
  Show dependency tree
 
Reported: 2011-05-07 13:02 EDT by Frank Becker CLA
Modified: 2011-07-21 17:35 EDT (History)
2 users (show)

See Also:


Attachments
patch V1 (12.88 KB, patch)
2011-05-07 13:56 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (76.97 KB, application/octet-stream)
2011-05-07 13:56 EDT, Frank Becker CLA
no flags Details
patch V2 (6.51 KB, patch)
2011-05-08 08:41 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (4.55 KB, application/octet-stream)
2011-05-08 08:41 EDT, Frank Becker CLA
no flags Details
reverted change (4.57 KB, patch)
2011-05-12 19:31 EDT, Steffen Pingel CLA
no flags Details | Diff
patch V3 (10.02 KB, patch)
2011-05-14 15:46 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (10.36 KB, application/octet-stream)
2011-05-14 15:46 EDT, Frank Becker CLA
no flags Details
fix compile error (1.62 KB, patch)
2011-05-15 17:05 EDT, Steffen Pingel CLA
no flags Details | Diff
mylyn/context/zip (4.30 KB, application/octet-stream)
2011-05-15 17:05 EDT, Steffen Pingel CLA
no flags Details
mylyn/context/zip (1.73 KB, application/octet-stream)
2011-05-15 17:10 EDT, Steffen Pingel CLA
no flags Details
patch V4 (6.35 KB, patch)
2011-06-29 13:15 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (10.56 KB, application/octet-stream)
2011-06-29 13:15 EDT, Frank Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Becker CLA 2011-05-07 13:02:51 EDT
There are some cases where we know that an submit must fail.

1) anonymous user can not submit bugs
2) when ../show_bug.cgi?ctype=xml&id= did not have the exporter attribute in <bugzilla> then all emails did not have @domain

We should show a message with an hyperlink for the action.

patch is coming soon!
Comment 1 Frank Becker CLA 2011-05-07 13:56:03 EDT
Created attachment 195009 [details]
patch V1

committed patch
Comment 2 Frank Becker CLA 2011-05-07 13:56:07 EDT
Created attachment 195010 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2011-05-07 19:20:28 EDT
I'm -1 on the API change to AbstractTaskEditorPage. The problem is that there a multiple things that may need to disable the submit button and making that available through API will lead to more inconsistencies. Frank, can you please revert the API change to AbstractTaskEditorPage?

I like the idea of the patch but it should be sufficient to show an error on submit as we do when the description is empty for instance. 

I would also suggest to rename testCanSubmit() to checkCanSubmit() or something like that. It's a common convention to prefix JUnit test methods with "test" and it can be confusing if that prefix is used in other contexts.
Comment 4 Frank Becker CLA 2011-05-08 08:41:47 EDT
Created attachment 195019 [details]
patch V2

committed patch

Now we show informational when we create the editor and errors when doSubmit is executed.
Comment 5 Frank Becker CLA 2011-05-08 08:41:49 EDT
Created attachment 195020 [details]
mylyn/context/zip
Comment 6 Frank Becker CLA 2011-05-08 08:43:50 EDT
(In reply to comment #3)
> I'm -1 on the API change to AbstractTaskEditorPage. The problem is that there a
> multiple things that may need to disable the submit button and making that
> available through API will lead to more inconsistencies. Frank, can you please
> revert the API change to AbstractTaskEditorPage?

API change reverted!
> 
> I like the idea of the patch but it should be sufficient to show an error on
> submit as we do when the description is empty for instance.
> 
> I would also suggest to rename testCanSubmit() to checkCanSubmit() or something
> like that. It's a common convention to prefix JUnit test methods with "test" and
> it can be confusing if that prefix is used in other contexts.
method renamed!
Comment 7 Shawn Minto CLA 2011-05-09 13:06:54 EDT
Frank, I seem to be seeing this on repositories where I wouldn't expect this type of error to occur as there is no anonymous login.  I think that this could be due to my network being down during a sync of the tasks.
Comment 8 Frank Becker CLA 2011-05-09 15:33:01 EDT
(In reply to comment #7)
> Frank, I seem to be seeing this on repositories where I wouldn't expect this
> type of error to occur as there is no anonymous login.  I think that this could
> be due to my network being down during a sync of the tasks.

I bet that you get "submit disabled, please refresh".

If so the reason is that we have a new attribute in the taskdata (exporter). If exporter is not in taskdata we have no @domin in the email adress so we can not submit. You need to do a refresh and then you can submit the task.
Comment 9 Steffen Pingel CLA 2011-05-09 15:44:33 EDT
We need to fix this so the message does not show for existing tasks. We also need to make the error message more meaningful and include details about the cause.

Frank, are your sure that all Bugzilla versions have the supporter attribute? I am bit afraid that we may break submission for a lot of repositories with this change.
Comment 10 Shawn Minto CLA 2011-05-09 16:09:51 EDT
Yes, i currently have to refresh every single task that I have before submit :(
Comment 11 Frank Becker CLA 2011-05-09 16:14:38 EDT
(In reply to comment #9)
> We need to fix this so the message does not show for existing tasks. We also
> need to make the error message more meaningful and include details about the
> cause.
> 
> Frank, are your sure that all Bugzilla versions have the supporter attribute? I
> am bit afraid that we may break submission for a lot of repositories with this
> change.

Yes I have checked thsi with all ower test repositories. Here the header of the oldest version
<bugzilla version="2.22.7"
          urlbase=""
          maintainer="THE MAINTAINER HAS NOT YET BEEN SET"
          exporter="test@mylyn.eclipse.org"
>

(In reply to comment #10)
> Yes, i currently have to refresh every single task that I have before submit :(

OK, we need to find a way to avoid this.
Comment 12 Steffen Pingel CLA 2011-05-12 19:31:16 EDT
Created attachment 195554 [details]
reverted change
Comment 13 Steffen Pingel CLA 2011-05-12 19:32:00 EDT
Frank, I need to do a weekly build and have reverted the change for now until we have come up with a solution for the migration problem.
Comment 14 Frank Becker CLA 2011-05-14 15:46:52 EDT
Created attachment 195651 [details]
patch V3

committed patch with an solution for the migration problem.
Comment 15 Frank Becker CLA 2011-05-14 15:46:55 EDT
Created attachment 195652 [details]
mylyn/context/zip
Comment 16 Steffen Pingel CLA 2011-05-15 07:48:53 EDT
Frank, it looks like the latest iteration is doing an extra synchronization prior to submission? I'm worried that this could cause merge conflicts or missed incomings. Unless we find a solution that does not require extra network activity, e.g. through using migrateTaskData() I don't think we should go ahead with this change.
Comment 17 Frank Becker CLA 2011-05-15 08:58:24 EDT
(In reply to comment #16)
> Frank, it looks like the latest iteration is doing an extra synchronization
> prior to submission? I'm worried that this could cause merge conflicts or
> missed incomings. Unless we find a solution that does not require extra network
> activity, e.g. through using migrateTaskData() I don't think we should go ahead
> with this change.

No the extra synchronization is only when the URLBASE Attribute does not exits.
The extra synchronization is triggered during open of the editor.

If we want to use the migrate which value should we use for the EXPORTER?
The user of the configuration could be used. But in some cases we can have email without the @domain and user of the configuration set. This is an error but i think it is not so common.

Steffen,

should I create a fix for this?
Comment 18 Steffen Pingel CLA 2011-05-15 13:48:22 EDT
I'm now seeing flickering everytime I open an editor. Can we please revert this change and work with patches until we have arrived at a solution that does not cause regressions?

Not sure what a sensible value for EXPORTER is. Maybe the reporter?
Comment 19 Frank Becker CLA 2011-05-15 14:36:29 EDT
(In reply to comment #18)
> I'm now seeing flickering everytime I open an editor. Can we please revert this
> change and work with patches until we have arrived at a solution that does not
> cause regressions?

OK patch V3 is now reverted!
> 
> Not sure what a sensible value for EXPORTER is. Maybe the reporter?

No the EXPORTER is the name of the logged in user how requested the xml  from bugzilla.
Comment 20 Steffen Pingel CLA 2011-05-15 16:02:31 EDT
(In reply to comment #19)
> > Not sure what a sensible value for EXPORTER is. Maybe the reporter?
> 
> No the EXPORTER is the name of the logged in user how requested the xml  from
> bugzilla.

Interesting. Could we use the user from the task repository object in that case?
Comment 21 Steffen Pingel CLA 2011-05-15 17:05:31 EDT
Created attachment 195681 [details]
fix compile error
Comment 22 Steffen Pingel CLA 2011-05-15 17:05:33 EDT
Created attachment 195682 [details]
mylyn/context/zip
Comment 23 Steffen Pingel CLA 2011-05-15 17:10:12 EDT
Created attachment 195684 [details]
mylyn/context/zip
Comment 24 Frank Becker CLA 2011-06-29 13:15:44 EDT
Created attachment 198845 [details]
patch V4

Here the patch for backport to 3.6.1

This patch is now in HEAD
Comment 25 Frank Becker CLA 2011-06-29 13:15:48 EDT
Created attachment 198846 [details]
mylyn/context/zip
Comment 26 Steffen Pingel CLA 2011-07-21 17:35:20 EDT
Thanks. Since there is a risk of regressions I would prefer if we apply this change to master only for now. I am not sure that it's worth the risk anyways but we can still consider backporting later if the change does not cause any unexpected problems.