Browse Source

[sqoop] Correct from and to labels for export or import jobs

sqoop.jobs.js not i18n and kind of hacky.
Romain Rigaux 12 years ago
parent
commit
30b4b73

+ 9 - 3
apps/sqoop/src/sqoop/templates/app.mako

@@ -172,6 +172,7 @@ ${ commonheader(None, "sqoop", user, "40px") | n,unicode }
           </ul>
           </ul>
 
 
           <form method="POST" class="form form-horizontal noPadding" data-bind="with: page">
           <form method="POST" class="form form-horizontal noPadding" data-bind="with: page">
+            <div class="alert alert-info"><h3 data-bind="text: description"></h3></div>
             <div class="job-form" data-bind="template: {'name': template(), 'data': node}">
             <div class="job-form" data-bind="template: {'name': template(), 'data': node}">
             </div>
             </div>
 
 
@@ -613,32 +614,37 @@ viewModel.job.subscribe(function(job) {
     if (job.persisted()) {
     if (job.persisted()) {
       viewModel.jobWizard.addPage(new wizard.Page({
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-connector',
         'identifier': 'job-editor-connector',
-        'caption': '${_("Step 1: From")}',
+        'caption': job.type() == 'IMPORT' ? '${_("Step 1: From")}' : '${_("Step 1: To")}',
+        'description': '${_("Database")}',
         'node': job,
         'node': job,
         'template': 'job-editor-connector'
         'template': 'job-editor-connector'
       }));
       }));
       viewModel.jobWizard.addPage(new wizard.Page({
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-framework',
         'identifier': 'job-editor-framework',
-        'caption': '${_("Step 2: to")}',
+        'caption': job.type() == 'IMPORT' ? '${_("Step 2: To")}' : '${_("Step 2: From")}',
+        'description': '${_("HDFS")}',
         'node': job,
         'node': job,
         'template': 'job-editor-framework'
         'template': 'job-editor-framework'
       }));
       }));
     } else {
     } else {
       viewModel.jobWizard.addPage(new wizard.Page({
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-begin',
         'identifier': 'job-editor-begin',
-        'caption': '${_("Step 1: Manage connections")}',
+        'caption': '${_("Step 1: Type")}',
+        'description': '${_("Connection")}',
         'node': job,
         'node': job,
         'template': 'job-editor-begin'
         'template': 'job-editor-begin'
       }));
       }));
       viewModel.jobWizard.addPage(new wizard.Page({
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-connector',
         'identifier': 'job-editor-connector',
         'caption': '${_("Step 2: From")}',
         'caption': '${_("Step 2: From")}',
+        'description': '${_("Database")}',
         'node': job,
         'node': job,
         'template': 'job-editor-connector'
         'template': 'job-editor-connector'
       }));
       }));
       viewModel.jobWizard.addPage(new wizard.Page({
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-framework',
         'identifier': 'job-editor-framework',
         'caption': '${_("Step 3: To")}',
         'caption': '${_("Step 3: To")}',
+        'description': '${_("HDFS")}',
         'node': job,
         'node': job,
         'template': 'job-editor-framework'
         'template': 'job-editor-framework'
       }));
       }));

+ 5 - 0
apps/sqoop/static/js/sqoop.jobs.js

@@ -31,9 +31,14 @@ var jobs = (function($) {
     'updated': null,
     'updated': null,
     'setImport': function(){
     'setImport': function(){
       this.type("IMPORT");
       this.type("IMPORT");
+      // Huge hack for now
+      $('a').filter(function(index) { return $(this).text() === "Step 2: To"; }).text("Step 2: From");
+      $('a').filter(function(index) { return $(this).text() === "Step 3: From"; }).text("Step 3: To");
     },
     },
     'setExport': function(){
     'setExport': function(){
       this.type("EXPORT");
       this.type("EXPORT");
+      $('a').filter(function(index) { return $(this).text() === "Step 2: From"; }).text("Step 2: To");
+      $('a').filter(function(index) { return $(this).text() === "Step 3: To"; }).text("Step 3: From");
     },
     },
     'initialize': function(attrs) {
     'initialize': function(attrs) {
       var self = this;
       var self = this;

+ 2 - 0
apps/sqoop/static/js/sqoop.wizard.js

@@ -87,6 +87,7 @@ var wizard = (function($) {
 
 
     self.identifier = ko.observable();
     self.identifier = ko.observable();
     self.caption = ko.observable();
     self.caption = ko.observable();
+    self.description= ko.observable();
     self.template = ko.observable();
     self.template = ko.observable();
     self.node = ko.observable();
     self.node = ko.observable();
 
 
@@ -97,6 +98,7 @@ var wizard = (function($) {
       self.options = options || {};
       self.options = options || {};
       self.identifier(self.options.identifier);
       self.identifier(self.options.identifier);
       self.caption(self.options.caption);
       self.caption(self.options.caption);
+      self.description(self.options.description);
       self.node(self.options.node);
       self.node(self.options.node);
       self.template(self.options.template);
       self.template(self.options.template);
     }
     }