Module: tools
Branch: master
Commit: bcab71a7c81db6ec8a285d0ec761c1b295650fea
URL: https://source.winehq.org/git/tools.git/?a=commit;h=bcab71a7c81db6ec8a285d0…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Mar 22 13:15:26 2022 +0100
testbot/cgi: Better select which FormPage fields can be shown / edited.
Also better document why each type of field can or cannot be edited /
shown.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/ObjectModel/CGI/FormPage.pm | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm
index 3ac6223..e432fcb 100644
--- a/testbot/lib/ObjectModel/CGI/FormPage.pm
+++ b/testbot/lib/ObjectModel/CGI/FormPage.pm
@@ -208,6 +208,8 @@ sub GetInputType($$)
{
my ($self, $PropertyDescriptor) = @_;
+ # Note: Editing Detailrefs and Itemrefs is not supported which leaves only
+ # Basic and Enum property descriptors here.
return $PropertyDescriptor->GetClass() eq "Enum" ? "select" :
$PropertyDescriptor->GetType() eq "B" ? "checkbox" :
$PropertyDescriptor->GetType() eq "textarea" ? "textarea" :
@@ -331,12 +333,20 @@ sub DisplayProperty($$)
{
my ($self, $PropertyDescriptor) = @_;
- if ($PropertyDescriptor->GetClass() eq "Detailref")
- {
- return "";
- }
-
- return "rw";
+ return # Detailref fields point to a Collection of objects matching the
+ # primary key of this form data. As such they can neither be shown
+ # nor edited.
+ $PropertyDescriptor->GetClass() eq "Detailref" ? "" :
+ # Itemref fields are keys identifying other objects and thus would
+ # require careful validation if edited. Requiring users to manually
+ # type the appropriate key value would also be cumbersome so this is
+ # currently not supported. But they can be displayed.
+ $PropertyDescriptor->GetClass() eq "Itemref" ? "ro" :
+ # All other properties can be edited...
+ $PropertyDescriptor->GetClass() ne "Basic" ? "rw" :
+ $PropertyDescriptor->GetType() ne "S" ? "rw" :
+ # ...except autoincrement ones (shown as <unset> if undefined)
+ "ro";
}
sub GetActions($)
Module: tools
Branch: master
Commit: 0a18c4e022589dabd375a51f5c979a296f180f83
URL: https://source.winehq.org/git/tools.git/?a=commit;h=0a18c4e022589dabd375a51…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Mar 22 13:15:17 2022 +0100
testbot/cgi: Don't show autoincrement fields of new items.
They don't have a value yet and cannot be edited.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/ObjectModel/CGI/ItemPage.pm | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm
index 9401154..a178aa6 100644
--- a/testbot/lib/ObjectModel/CGI/ItemPage.pm
+++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm
@@ -99,13 +99,16 @@ sub DisplayProperty($$)
my ($self, $PropertyDescriptor) = @_;
my $Display = $self->SUPER::DisplayProperty($PropertyDescriptor);
- if ($Display eq "rw" && ! $self->{Item}->GetIsNew() &&
- $PropertyDescriptor->GetIsKey())
- {
- $Display = "";
- }
-
- return $Display;
+ return # Don't show autoincrement fields of new items: they don't have a
+ # value yet and cannot be edited anyway so there is no point.
+ ($PropertyDescriptor->GetClass() eq "Basic" and
+ $PropertyDescriptor->GetType() eq "S" and
+ $self->{Item}->GetIsNew()) ? "" :
+ # Don't allow editing key attributes of existing items. Furthermore
+ # the item is identified in the page title so hide them altogether.
+ ($PropertyDescriptor->GetIsKey() and !$self->{Item}->GetIsNew() and
+ $Display eq "rw") ? "" :
+ $Display;
}
sub GetActions($)
Module: tools
Branch: master
Commit: 32d395ef14d4ee5284971669d92239eca881e7ed
URL: https://source.winehq.org/git/tools.git/?a=commit;h=32d395ef14d4ee528497166…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Mar 22 13:14:41 2022 +0100
winetest: Fix a minor license format issue in pattern.js.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
winetest/patterns.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winetest/patterns.js b/winetest/patterns.js
index be583a5..042620b 100644
--- a/winetest/patterns.js
+++ b/winetest/patterns.js
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
"use strict";