You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/02/11 09:07:23 UTC

svn commit: r1243015 - in /archiva/trunk/archiva-modules/archiva-web: archiva-web-common/src/main/resources/org/apache/archiva/i18n/ archiva-webapp-js/src/main/webapp/js/archiva/ archiva-webapp-js/src/main/webapp/js/archiva/templates/

Author: olamy
Date: Sat Feb 11 08:07:22 2012
New Revision: 1243015

URL: http://svn.apache.org/viewvc?rev=1243015&view=rev
Log:
[MRM-1576] rewrite proxies connector page
display policy name rather than id in settings popover.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties?rev=1243015&r1=1243014&r2=1243015&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties Sat Feb 11 08:07:22 2012
@@ -90,6 +90,7 @@ remoteIndexUrl=Remote Index Url
 remoteDownloadNetworkProxyId=Proxy for Remote Download Index
 downloadRemoteIndexOnStartup=Download Remote Index on Startup
 remoteDownloadTimeout=Download Remote Timeout
+remoterepository.added=Remote Repository added.
 
 #network proxy
 networkproxy.updated=Network Proxy " {0} " updated.
@@ -100,6 +101,7 @@ networkproxy.delete.confirm=Are you sure
 networkproxy.deleted=Network Proxy {0} deleted
 bulk.save.confirm.title=Network Proxy Bulk Save
 networkproxy.bulk.save.confirm=Are you sure to update {0} network proxy(ies)
+network.proxy.useNtlm=Use NTLM
 
 #menu
 menu.users=User Management

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js?rev=1243015&r1=1243014&r2=1243015&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js Sat Feb 11 08:07:22 2012
@@ -112,6 +112,7 @@ $(function() {
     this.name.subscribe(function(newValue){self.modified(true)});
 
   }
+
   ProxyConnectorViewModel=function(proxyConnector,update,proxyConnectorsViewModel){
     var self=this;
     this.proxyConnector=proxyConnector;
@@ -256,6 +257,13 @@ $(function() {
   ProxyConnectorsViewModel=function(){
     var self=this;
     this.proxyConnectors=ko.observableArray([]);
+    this.proxyConnectors.subscribe(function(newValue){
+      $.log("ProxyConnectorsViewModel#proxyConnectors modified")
+      self.proxyConnectors().sort(function(a,b){
+        if ( a.sourceRepoId()== b.sourceRepoId()) return a.order() - b.order();
+        return (a.sourceRepoId() > b.sourceRepoId())? -1:1;
+      });
+    });
     this.policyInformations=ko.observableArray([]);
     this.managedRepositories=ko.observableArray([]);
     this.remoteRepositories=ko.observableArray([]);
@@ -347,7 +355,10 @@ $(function() {
                                 +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId());
       targetContent.html("");
       targetContent.append($("#proxy-connectors-remote-settings-popover-tmpl")
-                               .tmpl(ko.toJS(proxyConnector)));
+                               .tmpl({
+                                    proxyConnectorsViewModel: self,
+                                    proxyConnector:ko.toJS(proxyConnector)
+                                    }));
 
       var targetImg = $("#proxy-connectors-grid-remoterepo-settings-edit-"+proxyConnector.sourceRepoId()
                             +"-"+proxyConnector.targetRepoId());
@@ -363,6 +374,16 @@ $(function() {
 
     }
 
+    this.findPolicyInformationName=function(id){
+      for(i=0;i<self.policyInformations().length;i++){
+        if (id==self.policyInformations()[i].id()){
+          return self.policyInformations()[i].name();
+        }
+      }
+      return null;
+    }
+
+
     this.displayGrid=function(){
       this.gridViewModel = new ko.simpleGrid.viewModel({
         data: self.proxyConnectors,

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html?rev=1243015&r1=1243014&r2=1243015&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html Sat Feb 11 08:07:22 2012
@@ -91,7 +91,7 @@
 <script id='proxy-connectors-remote-settings-popover-tmpl' type='text/x-jquery-tmpl'>
   <div>
     {{if proxyId}}
-      ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyId}
+      ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyConnector.proxyId}
     {{else}}
       ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${$.i18n.prop('none')}
     {{/if}}
@@ -100,9 +100,10 @@
         <th colspan="2">${$.i18n.prop('proxy-connector.policies')}</th>
       </thead>
       <tbody>
-        {{each(i, entry) policiesEntries}}
+        {{each(i, entry) proxyConnector.policiesEntries}}
+        {{var name = proxyConnectorsViewModel.findPolicyInformationName(entry.key)}}
         <tr>
-          <td>${entry.key}</td>
+          <td>${name}</td>
           <td>${entry.value}</td>
         </tr>
         {{/each}}