فهرست منبع

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

sqoop.jobs.js not i18n and kind of hacky.
Romain Rigaux 12 سال پیش
والد
کامیت
30b4b73
3فایلهای تغییر یافته به همراه16 افزوده شده و 3 حذف شده
  1. 9 3
      apps/sqoop/src/sqoop/templates/app.mako
  2. 5 0
      apps/sqoop/static/js/sqoop.jobs.js
  3. 2 0
      apps/sqoop/static/js/sqoop.wizard.js

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

@@ -172,6 +172,7 @@ ${ commonheader(None, "sqoop", user, "40px") | n,unicode }
           </ul>
 
           <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>
 
@@ -613,32 +614,37 @@ viewModel.job.subscribe(function(job) {
     if (job.persisted()) {
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-connector',
-        'caption': '${_("Step 1: From")}',
+        'caption': job.type() == 'IMPORT' ? '${_("Step 1: From")}' : '${_("Step 1: To")}',
+        'description': '${_("Database")}',
         'node': job,
         'template': 'job-editor-connector'
       }));
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-framework',
-        'caption': '${_("Step 2: to")}',
+        'caption': job.type() == 'IMPORT' ? '${_("Step 2: To")}' : '${_("Step 2: From")}',
+        'description': '${_("HDFS")}',
         'node': job,
         'template': 'job-editor-framework'
       }));
     } else {
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-begin',
-        'caption': '${_("Step 1: Manage connections")}',
+        'caption': '${_("Step 1: Type")}',
+        'description': '${_("Connection")}',
         'node': job,
         'template': 'job-editor-begin'
       }));
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-connector',
         'caption': '${_("Step 2: From")}',
+        'description': '${_("Database")}',
         'node': job,
         'template': 'job-editor-connector'
       }));
       viewModel.jobWizard.addPage(new wizard.Page({
         'identifier': 'job-editor-framework',
         'caption': '${_("Step 3: To")}',
+        'description': '${_("HDFS")}',
         'node': job,
         'template': 'job-editor-framework'
       }));

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

@@ -31,9 +31,14 @@ var jobs = (function($) {
     'updated': null,
     'setImport': function(){
       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(){
       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) {
       var self = this;

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

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