瀏覽代碼

AMBARI-15198. Close icons on modal top right do not honor the underlying logic associated with the close/cancel buttons (pallavkul)

Pallav Kulshreshtha 9 年之前
父節點
當前提交
5fd757939c

+ 0 - 48
contrib/views/files/src/main/resources/ui/app/services/file-copy.js

@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import FileOperationMixin from '../mixins/file-operation';
-
-export default Ember.Service.extend(FileOperationMixin, {
-  logger: Ember.inject.service('alert-messages'),
-
-  // Returns a promise for the operation. Upon sucess or error, this also
-  // appropriately sends error messages.
-
-  copy: function (srcPath, destName) {
-    return new Ember.RSVP.Promise((resolve, reject) => {
-      var adapter = this.get('store').adapterFor('file');
-      var baseURL = adapter.buildURL('file');
-      var moveUrl = baseURL.substring(0, baseURL.lastIndexOf('/')) + "/copy";
-      var data = {sourcePaths: srcPath, destinationPath: destName};
-      adapter.ajax(moveUrl, "POST", {data: data}).then((response) => {
-        this.get('logger').success(`Successfully copied to ${destName}.`, {}, {flashOnly: true});
-        resolve(response);
-      }, (responseError) => {
-        var error = this.extractError(responseError);
-        this.get('logger').danger(`Failed to copy to ${destName}`, error);
-        reject(error);
-      });
-    });
-  },
-
-  _isDestinationPathExists(destinationPath) {
-    return this.get('store').peekAll('file').isAny('path', destinationPath);
-  }
-});

+ 0 - 47
contrib/views/files/src/main/resources/ui/app/services/file-move.js

@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import FileOperationMixin from '../mixins/file-operation';
-
-export default Ember.Service.extend(FileOperationMixin, {
-  logger: Ember.inject.service('alert-messages'),
-
-  // Returns a promise for the operation. Upon sucess or error, this also
-  // appropriately sends error messages.
-  move: function(srcPath, destName ) {
-    return new Ember.RSVP.Promise((resolve, reject) => {
-      var adapter = this.get('store').adapterFor('file');
-      var baseURL = adapter.buildURL('file');
-      var moveUrl = baseURL.substring(0, baseURL.lastIndexOf('/')) + "/move";
-      var data = {sourcePaths: srcPath, destinationPath: destName};
-      adapter.ajax(moveUrl, "POST", {data: data}).then((response) => {
-        this.get('logger').success(`Successfully moved to ${destName}.`, {}, {flashOnly: true});
-        resolve(response);
-      }, (responseError) => {
-        var error = this.extractError(responseError);
-        this.get('logger').danger(`Failed to move to ${destName}`, error);
-        reject(error);
-      });
-    });
-  },
-
-  _isDestinationPathExists(destinationPath) {
-    return this.get('store').peekAll('file').isAny('path', destinationPath);
-  }
-});

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/copy-modal.hbs

@@ -21,7 +21,7 @@
     <div class="modal-dialog modal-lg">
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h3 class="modal-title">Copy to <span style="font-weight: normal; font-size: 14px;">{{selectionName}}</span>
           </h3>
           <div class="text-danger">

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/delete-modal.hbs

@@ -21,7 +21,7 @@
     <div class="modal-dialog">
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h4 class="modal-title">{{fa-icon icon="trash"}} Delete</h4>
         </div>
         <div class="modal-body">

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/move-modal.hbs

@@ -21,7 +21,7 @@
     <div class="modal-dialog modal-lg">
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h3 class="modal-title">Move to <span style="font-weight: normal; font-size: 14px;">{{selectionName}}</span>
           </h3>
           <div class="text-danger">

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/new-directory.hbs

@@ -25,7 +25,7 @@
       <!-- Modal content-->
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h4 class="modal-title">{{fa-icon "folder-o"}} Add new folder</h4>
         </div>
         <form role="form">

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/open-preview-modal.hbs

@@ -21,7 +21,7 @@
     <div class="modal-dialog modal-lg">
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h3 class="modal-title">File Preview</h3>
           <div>{{ selectedFilePath }}</div>
         </div>

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/permission-modal.hbs

@@ -21,7 +21,7 @@
     <div class="modal-dialog modal-sm">
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h4 class="modal-title">{{fa-icon icon="edit"}} Edit Permissions for {{#if selected.isDirectory}}folder{{else}}file{{/if}}</h4>
         </div>
         <form class="form-horizontal">

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/rename-modal.hbs

@@ -21,7 +21,7 @@
     <div class="modal-dialog">
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h4 class="modal-title">{{fa-icon icon="edit"}} Rename {{#if selected.isDirectory}}Folder{{else}}File{{/if}}</h4>
         </div>
         <form>

+ 1 - 1
contrib/views/files/src/main/resources/ui/app/templates/components/upload-file.hbs

@@ -25,7 +25,7 @@
       <!-- Modal content-->
       <div class="modal-content">
         <div class="modal-header">
-          <button type="button" class="close" data-dismiss="modal">&times;</button>
+          <button type="button" class="fa fa-times pull-right" {{action 'close'}}></button>
           <h4>{{fa-icon "upload"}} Upload file to {{path}}</h4>
         </div>
         <div class="modal-body">