Repository: ambari Updated Branches: refs/heads/trunk 14f369426 -> 2de0789f4
AMBARI-5193. Mirroring: hide dataset actions, when Falcon is stopped. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2de0789f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2de0789f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2de0789f Branch: refs/heads/trunk Commit: 2de0789f4ce1c830599f7652ef0cbc191c25fea2 Parents: 14f3694 Author: Aleksandr Kovalenko <[email protected]> Authored: Mon Mar 24 20:06:31 2014 +0200 Committer: Aleksandr Kovalenko <[email protected]> Committed: Mon Mar 24 20:06:31 2014 +0200 ---------------------------------------------------------------------- .../main/mirroring/edit_dataset_controller.js | 18 ++---------------- .../app/controllers/main/mirroring_controller.js | 1 + ambari-web/app/templates/main/mirroring/jobs.hbs | 2 +- ambari-web/app/views/main/mirroring/jobs_view.js | 4 ++++ 4 files changed, 8 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2de0789f/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js index 031261f..fa91791 100644 --- a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js +++ b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js @@ -226,15 +226,6 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({ var scheduleStartDateFormatted = this.toTZFormat(startDate); var scheduleEndDateFormatted = this.toTZFormat(endDate); - var newDataset = { - id: datasetName, - name: datasetName, - source_cluster_name: sourceCluster, - target_cluster_name: targetCluster, - source_dir: sourceDir, - target_dir: targetDir, - dataset_jobs: [] - }; // Compose XML data, that will be sended to server var dataToSend = '<?xml version="1.0"?><feed description="" name="' + prefixedDatasetName + '" xmlns="uri:falcon:feed:0.1"><frequency>' + repeatOptionSelected + '(' + datasetFrequency + ')' + '</frequency><clusters><cluster name="' + sourceCluster + '" type="source"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleEndDateFormatted + @@ -249,8 +240,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({ name: prefixedDatasetName, type: 'feed', entity: dataToSend, - falconServer: App.get('falconServerURL'), - datasetObj: newDataset + falconServer: App.get('falconServerURL') }, success: 'onSaveSuccess', error: 'onSaveError' @@ -262,8 +252,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({ sender: this, data: { dataset: dataToSend, - falconServer: App.get('falconServerURL'), - datasetObj: newDataset + falconServer: App.get('falconServerURL') }, success: 'onSaveSuccess', error: 'onSaveError' @@ -274,9 +263,6 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({ onSaveSuccess: function () { this.set('popup.isSaving', false); this.get('popup').hide(); - var datasetObj = arguments[2].datasetObj; - App.store.load(App.Dataset, datasetObj); - App.router.send('gotoShowJobs'); App.router.get('mainMirroringController').loadData(); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/2de0789f/ambari-web/app/controllers/main/mirroring_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js index 7e32825..189e0f5 100644 --- a/ambari-web/app/controllers/main/mirroring_controller.js +++ b/ambari-web/app/controllers/main/mirroring_controller.js @@ -200,6 +200,7 @@ App.MainMirroringController = Em.ArrayController.extend({ var selectedDataset = this.get('selectedDataset'); if (!selectedDataset) { this.set('selectedDataset', sortedDatasets[0]); + App.router.send('gotoShowJobs'); } } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/2de0789f/ambari-web/app/templates/main/mirroring/jobs.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/mirroring/jobs.hbs b/ambari-web/app/templates/main/mirroring/jobs.hbs index ed008db..f94acf6 100644 --- a/ambari-web/app/templates/main/mirroring/jobs.hbs +++ b/ambari-web/app/templates/main/mirroring/jobs.hbs @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. }} -{{#if view.dataset}} +{{#if view.showActions}} <div class="dataset-details"> <div class="top-left"> <h4>{{view.dataset.name}}</h4> http://git-wip-us.apache.org/repos/asf/ambari/blob/2de0789f/ambari-web/app/views/main/mirroring/jobs_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/mirroring/jobs_view.js b/ambari-web/app/views/main/mirroring/jobs_view.js index f4a0661..c8973d1 100644 --- a/ambari-web/app/views/main/mirroring/jobs_view.js +++ b/ambari-web/app/views/main/mirroring/jobs_view.js @@ -37,6 +37,10 @@ App.MainDatasetJobsView = App.TableView.extend({ return this.get('controller.content'); }.property('controller.content'), + showActions: function () { + return this.get('isLoaded') && this.get('dataset.status') && !this.get('parentView.controller.isDatasetLoadingError'); + }.property('isLoaded', 'dataset.status', 'parentView.controller.isDatasetLoadingError'), + sortView: sort.wrapperView.extend({ loadSortStatuses: function(){ this._super();
