From 829163c2a8aa042407a6fd2ee45d10cea69e933f Mon Sep 17 00:00:00 2001 From: Charles du Jeu Date: Thu, 17 Sep 2009 09:21:38 +0000 Subject: [PATCH] Resources, craete/save, modal windows, etc. git-svn-id: https://svn.argeo.org/commons/trunk@2942 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../org/argeo/security/ria/RolesApplet.js | 63 +++++++++++++--- .../argeo/security/ria/UserEditorApplet.js | 41 ++++++++--- .../org/argeo/security/ria/UsersApplet.js | 54 +++++++------- .../security/ria/components/INaturePane.js | 4 ++ .../security/ria/components/IUserDataPane.js | 6 +- .../ria/components/PasswordCredentialImpl.js | 26 ++++++- .../ria/components/SimpleUserNatureImpl.js | 68 ++++++++++++++++-- .../document-properties.png | Bin 0 -> 721 bytes .../org.argeo.security.ria/document-save.png | Bin 0 -> 579 bytes .../org.argeo.security.ria/go-next.png | Bin 0 -> 663 bytes .../org.argeo.security.ria/list-add.png | Bin 0 -> 626 bytes .../org.argeo.security.ria/list-remove.png | Bin 0 -> 354 bytes .../org.argeo.security.ria/window-close.png | Bin 0 -> 821 bytes 13 files changed, 206 insertions(+), 56 deletions(-) create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-properties.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-save.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/go-next.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/list-add.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/list-remove.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/window-close.png diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js index 3803968a9..f2f488d31 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js @@ -28,9 +28,41 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", */ commands : { init : { + "new_role" : { + label : "Create Role", + icon : "org.argeo.security.ria/list-add.png", + shortcut : "Control+n", + enabled : true, + menu : "Roles", + toolbar : "role", + callback : function(e){ + // Prompt for new name + }, + command : null + }, + "delete_role" : { + label : "Delete Role", + icon : "org.argeo.security.ria/list-remove.png", + shortcut : "Control+s", + enabled : true, + menu : "Roles", + toolbar : "role", + callback : function(e){ + // Call service to delete + var crtUsers = this.getViewSelection().getNodes(); + for(var i=0;i 1)); + this.setEnabled(!(data == null || !data.length)); }, command : null - }, - "delete_user" : { - label : "Delete User", - icon : "ria/window-close.png", - shortcut : "Control+s", + }, + "edit_user" : { + label : "Edit User", + icon : "org.argeo.security.ria/document-properties.png", + shortcut : "Control+u", enabled : true, menu : "Users", - toolbar : "user", + toolbar : "userslist", callback : function(e){ // Call service to delete - var crtUsers = this.getViewSelection().getNodes(); - for(var i=0;i 1)); }, command : null - } + } } }, diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/INaturePane.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/INaturePane.js index 84c612a2f..038a26d1a 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/INaturePane.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/INaturePane.js @@ -1,5 +1,9 @@ qx.Interface.define("org.argeo.security.ria.components.INaturePane", { extend : org.argeo.security.ria.components.IUserDataPane, + properties : { + natureUuid : {}, + natureType : {} + }, members : { getNatureLabel : function(){return true}, setData : function(dataMap, format){return true;} diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/IUserDataPane.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/IUserDataPane.js index ca801520b..c3530b650 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/IUserDataPane.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/IUserDataPane.js @@ -4,8 +4,10 @@ qx.Interface.define("org.argeo.security.ria.components.IUserDataPane", { getData : function(format){return true;}, validate : function(){return true;} }, + properties : { + valid : {} + }, events : { - "modified" : "qx.event.type.Event" - + "modified" : "qx.event.type.Event" } }); \ No newline at end of file diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/PasswordCredentialImpl.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/PasswordCredentialImpl.js index 66e38eacf..610e56d12 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/PasswordCredentialImpl.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/PasswordCredentialImpl.js @@ -4,14 +4,24 @@ qx.Class.define("org.argeo.security.ria.components.PasswordCredentialImpl", { events : { "modified" : "qx.event.type.Event" }, + properties : { + valid : { + init : false + } + }, construct : function(){ this.base(arguments); this.setLayout(new qx.ui.layout.HBox(5, "center")); this.add(new qx.ui.basic.Label("Password"), {flex:1}); - this.add(new qx.ui.form.TextField(), {flex:2}); + this.pass1 = new qx.ui.form.PasswordField(); + this.add(this.pass1, {flex:2}); this.add(new qx.ui.basic.Label("Confirm Password"), {flex:1}); - this.add(new qx.ui.form.TextField(), {flex:2}); + this.pass2 = new qx.ui.form.PasswordField(); + this.add(this.pass2, {flex:2}); + this.pass1.addListener("changeValue", function(){this.fireEvent("modified");}, this); + this.pass2.addListener("changeValue", function(){this.fireEvent("modified");}, this); + this.pass2.addListener("changeValue", this.validate, this); }, members : { @@ -19,7 +29,17 @@ qx.Class.define("org.argeo.security.ria.components.PasswordCredentialImpl", { return this; }, getData : function(format){return true;}, - validate : function(){return true;}, + validate : function(){ + if(this.pass1.getValue() == this.pass2.getValue()){ + this.setValid(true); + }else{ + // TODO WHEN TESTING 0.8.3 + //this.pass1.setValid(false); + //this.pass2.setValid(false); + this.setValid(false); + } + return this.getValid(); + }, setEditMode : function(editMode){return true;} } }); \ No newline at end of file diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/SimpleUserNatureImpl.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/SimpleUserNatureImpl.js index c76ec1ad2..bb0900b3c 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/SimpleUserNatureImpl.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/SimpleUserNatureImpl.js @@ -4,10 +4,50 @@ qx.Class.define("org.argeo.security.ria.components.SimpleUserNatureImpl", { events : { "modified" : "qx.event.type.Event" }, + properties : { + valid : { + init : false + }, + natureUuid : { + init : "" + }, + natureType : { + init : "SimpleUser" + }, + dataMap : { + + } + }, construct : function(){ - this.base(arguments); - this.setLayout(new qx.ui.layout.Grid()); + this.base(arguments); + var grid = new qx.ui.layout.Grid(5,5); + this.setLayout(grid); + grid.setColumnFlex(0,1); + grid.setColumnAlign(0,"right", "middle"); + grid.setColumnFlex(1,3); + + this.mailField = new qx.ui.form.TextField(); + this.fNameField = new qx.ui.form.TextField(); + this.nameField = new qx.ui.form.TextField(); + + var labels = ["Email", "First Name", "Last Name"]; + this.fields = { + "email" : this.mailField, + "firstName": this.fNameField, + "lastName" : this.nameField + }; + + for(var i=0;i~T?!(E5^BM$Wf!7CvSr;}Mcv=-?>8OxkFIrT zV3-GQ=JUQYZ$woA5RrNy#Q)h(r+5m5LYuxuA}=#b8OaktL=XfKKm=hqIu#YVHW1ib z0$6J$>t^lT{5-}8#@IqM7-I^s6#&OkKpa+?F$QZ5##pQ^6pCO9u?P^!3oQeP2-eyH zpx`3R&Cdf63#6hn9eh&$Sf^kP5!`j>)qI?d$x2qd1C{!w3A%7VlBGpG)s}Fhc zXLMYTGIY6)>7{0NAMB&9uCA0Ei^XtV7tiwu1Oh&g0SI&*ufIArax1f~aihK(YS9OS zCp8+4YBrnITrQ`c=c(`e8V-lm_kCSlT-4s)i^G5gII(jJpZD+EllwUFT89TuYa|j; z*LBMPs;c2|SQi!+^g>V9DBu+5P%k3inl`WbK61B1W3gCSVexg}_jPh|(rrK6eh;Wn zRa7;y-RfzgF;00000NkvXXu0mjf DrYA9t literal 0 HcmV?d00001 diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-save.png b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-save.png new file mode 100644 index 0000000000000000000000000000000000000000..09f2d75d0601f582d927732002fde8e9c6232c1e GIT binary patch literal 579 zcmV-J0=)f+P)rH~iV87q*pJ@T4ane42@d7t)E;Gwx zpb{E`wFYazTEmym9~lmZ?Lz|ZJ&UIUf>R58`1%vjT3*+g?&~X85D~ohM!>IG%M=9wYYLX6})PdUgrtC2+ld;tl-nu_r@Z% zE?N~sK3Utsqb;l4+73L*NB*ju($M{`K5*;r$GONVUZO36Z~d zP?i9^+Y0A^*&l)D(ZkOHB2q!{W z6ITXhNuK8bL}5shB*bw{7=}%3FQ_V=PKRGRJ4Xg8@;eH{vq2CLMiFV2k(b4sL7Jo# zMM0LPha-U({EuEotsQ1+_`rbfbn?TFxVZ90OiN_Hg>`81DKP3=RXbs8v@-5 R!g~M!002ovPDHLkV1lLg`7;0j literal 0 HcmV?d00001 diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/go-next.png b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/go-next.png new file mode 100644 index 0000000000000000000000000000000000000000..9065e553b66cfc6a0aeb36e5753b51149a6badd6 GIT binary patch literal 663 zcmV;I0%-k-P)>lXw|;#56K7;Haq{&Y2KlR{JV&IY3azfLgp`=v0RVa-Kazx$+ zrkv->jjI3{W5{L;OwN2|H6tda(gW{Cx>tV$?CLyi2M3N5cU`noi`E*c6ha8B1!F2i zQA8AmEH1C{=3{x?Dra!%Ztr*upc46HvLzxDBOcd8MxkN~0a$DC{g6zqz(zVlYAuD# zryD)B^Jz!#$Z!n6gg$fg%j|C6L;cPM+`1h&j)M>oh7~+N!1qd&ie#VKKmpO*lWMXs zw;)B~*oa@cM`u=t0C&)=2UO5$cN0;e!-(e1&TCzk+yjgO0wh4*3)muOcP~YhqMPSs zxqkqMfe6?F+P#3w3tHU{f?!=AK>xnXYhY)7dH(uFym2QNYr;Si>HrfcQk$Vf*vl=o zr&T{>3`3#e^r3loe7ySL+R58D#e0vsry5u0E>DM%#s>wWTC|lD7#I7;i|sDVyO{6trqZ$*otaEx1%J%?(%98PCPs}noTw(p= zCZDc0rOa2di6U@U<2^RFC;?j({~Y6As@E@8rl+^3rlMgQ$u1(E+z$Q@eSl-8qL9oe zul(m9iG15haYbPV0s31wl4UfKudPmYKXsj~ZL`?nZVUnpe8m6NPp-7avpoicC;$Ke M07*qoM6N<$g4M|p-T(jq literal 0 HcmV?d00001 diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/list-remove.png b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/list-remove.png new file mode 100644 index 0000000000000000000000000000000000000000..bebd233e8db38a2ca7bec04153386ff7922c6404 GIT binary patch literal 354 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ zFzyCnMyofE9{~j=OI#yLg7ec#$`gxH8OqDc^)mCai<1)zQuXqS(r3T3kpe2Z@9E+g zV$pkdl40H<2Ladn>&&wscjztQ6zQ0ze4#+}0fT07!sy*UvsQSaSE>mW>g67*>3iyuUT>`|-!>!6GULVnqW@Urt$; z^Lfr8%c|8^mp%P^_$DKRW6L4Sr1zaYj@=7R3pqVtd9#UU`~BvvKLqrC$H<(SI!nc% w`(Rz_-mu>+^Q@Kf=d;vx@2_7XE%1ZkX`e@wRo!z|pjR0@UHx3vIVCg!0FX+Jq5uE@ literal 0 HcmV?d00001 diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/window-close.png b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/window-close.png new file mode 100644 index 0000000000000000000000000000000000000000..d4f48146e3dd7a68393b8dc26850e6aa3cbadeeb GIT binary patch literal 821 zcmV-51Iqk~P)|lVgLXD8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10_zKRk;sroj?8!5zLjq4?>F^WEZ^j`1Q;FJ>{92A>j`DsP?m+DQo+W9 ziN$btcLV^$(WCjUdv^!x-@hYpTpaG{!SCtmf~rpLHRy>&l4d4VrIM{GGsKGKmYLIAO$|cS`Dym(6Jcc z`|!VfMo_K6_gu8aO>9g}6;-WvlaNvZVF2jP0{GWlja>f1`Hy~ol2#K@ZkfZt_y<*nrWh3Div6%&@{~Lf3`zynmcp>-?x;%$@(#`5^uWrHFC-zom8}00000NkvXXu0mjfsUCXS literal 0 HcmV?d00001 -- 2.30.2