Repository: ambari Updated Branches: refs/heads/branch-2.5 a6d858add -> f6b288f0d
AMBARI-19420. Import from local file system doesn't work if the same file is selected again. (Padma Priya via pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f6b288f0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6b288f0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6b288f0 Branch: refs/heads/branch-2.5 Commit: f6b288f0deb10f0f3477e1fc0055e80aacb75b23 Parents: a6d858a Author: pallavkul <[email protected]> Authored: Tue Jan 10 10:36:23 2017 +0530 Committer: pallavkul <[email protected]> Committed: Tue Jan 10 10:38:34 2017 +0530 ---------------------------------------------------------------------- .../resources/ui/app/components/file-picker.js | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f6b288f0/contrib/views/wfmanager/src/main/resources/ui/app/components/file-picker.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/file-picker.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/file-picker.js new file mode 100644 index 0000000..d9729fe --- /dev/null +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/file-picker.js @@ -0,0 +1,32 @@ +/* +* 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 FilePicker from 'ember-cli-file-picker/components/file-picker'; + +export default FilePicker.extend({ + filesAreValid: function(files) { + // do something with the files and add errors: + // this.get('errors').addObject('wrong file type'); + //return false; + return true; + }, + click : function(event){ + this.$('.file-picker__input').val(null);//this is done so that opening the same file would call the callbacks.s + this._super(event); + } +});
