File tree Expand file tree Collapse file tree 3 files changed +28
-8
lines changed
uma-server-webapp/src/main/webapp/resources Expand file tree Collapse file tree 3 files changed +28
-8
lines changed Original file line number Diff line number Diff line change 37
37
"email-address" : " email address" ,
38
38
"share-email" : " Share with email address" ,
39
39
"new" : " New Policy" ,
40
- "edit" : " Edit Policy"
41
-
40
+ "edit" : " Edit Policy" ,
41
+ "claim-name" : " claim name" ,
42
+ "friendly-claim-name" : " friendly claim name" ,
43
+ "claim-value" : " claim value" ,
44
+ "value-type-text" : " Text" ,
45
+ "value-type-number" : " Number" ,
46
+ "clear-all" : " Clear all claims" ,
47
+ "clear-all-confirm" : " Are you sure you want to clear all claims from this policy?"
42
48
},
43
49
"webfinger-error" : " Error" ,
44
50
"webfinger-error-description" : " The server was unable to find an identity provider for <code>__email__</code>." ,
Original file line number Diff line number Diff line change @@ -413,6 +413,7 @@ var PolicyFormView = Backbone.View.extend({
413
413
events :{
414
414
'click .btn-share' : 'addWebfingerClaim' ,
415
415
'click .btn-share-advanced' : 'addAdvancedClaim' ,
416
+ 'click .btn-clear' : 'clearAllClaims' ,
416
417
'click .btn-save' : 'savePolicy' ,
417
418
'click .btn-cancel' : 'cancel'
418
419
} ,
@@ -522,14 +523,12 @@ var PolicyFormView = Backbone.View.extend({
522
523
if ( ! claimsRequired ) {
523
524
claimsRequired = [ ] ;
524
525
}
525
- console . log ( claimsRequired ) ;
526
526
claimsRequired . push ( {
527
527
name : name ,
528
528
friendlyName : friendly ,
529
529
value : value ,
530
530
issuer : issuers
531
531
} ) ;
532
- console . log ( claimsRequired ) ;
533
532
534
533
this . model . set ( {
535
534
scopes : scopes ,
@@ -559,11 +558,25 @@ var PolicyFormView = Backbone.View.extend({
559
558
"keyboard" : true ,
560
559
"show" : true // ensure the modal is shown immediately
561
560
} ) ;
562
- }
563
-
564
-
565
-
561
+ }
562
+ } ,
563
+
564
+ clearAllClaims :function ( e ) {
565
+ e . preventDefault ( ) ;
566
+
567
+ if ( confirm ( $ . t ( 'policy.policy-form.clear-all-confirm' ) ) ) {
566
568
569
+ var scopes = $ ( '#scopes input[type="checkbox"]:checked' ) . map ( function ( idx , elem ) { return $ ( elem ) . val ( ) ; } ) . get ( ) ;
570
+
571
+ var claimsRequired = [ ] ;
572
+
573
+ this . model . set ( {
574
+ scopes : scopes ,
575
+ claimsRequired : claimsRequired
576
+ } , { trigger : false } ) ;
577
+
578
+ this . render ( ) ;
579
+ }
567
580
} ,
568
581
569
582
savePolicy :function ( e ) {
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ <h1 data-i18n="policy.policy-form.edit">Edit Policy</h1>
196
196
< div class = "control-group" >
197
197
< div class = "controls" >
198
198
< button class = "btn btn-info btn-share-advanced" > < i class = "icon-share icon-white" > </ i > < span data-i18n = "policy.policy-form.share-advanced" > Add to claim set</ span > </ button >
199
+ < button class = "btn btn-danger btn-clear" > < i class = "icon-trash icon-white" > </ i > < span data-i18n = "policy.policy-form.clear-all" > Clear all claims</ span > </ button >
199
200
</ div >
200
201
</ div >
201
202
</ fieldset >
You can’t perform that action at this time.
0 commit comments