ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-15334. Files view does not show directory permission for folders. (dipayanb)
Date Tue, 15 Mar 2016 12:01:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 2ab19a6c9 -> 1d1620a32


AMBARI-15334. Files view does not show directory permission for folders. (dipayanb)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1d1620a3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1d1620a3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1d1620a3

Branch: refs/heads/trunk
Commit: 1d1620a327a041236a1b7ea75859a1f47c63aff3
Parents: 2ab19a6
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Tue Mar 15 17:30:06 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Tue Mar 15 17:30:49 2016 +0530

----------------------------------------------------------------------
 .../ui/app/helpers/show-permission-string.js    | 30 ++++++++++++++++++++
 .../ui/app/templates/components/file-row.hbs    |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1620a3/contrib/views/files/src/main/resources/ui/app/helpers/show-permission-string.js
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/helpers/show-permission-string.js
b/contrib/views/files/src/main/resources/ui/app/helpers/show-permission-string.js
new file mode 100644
index 0000000..e6decc6
--- /dev/null
+++ b/contrib/views/files/src/main/resources/ui/app/helpers/show-permission-string.js
@@ -0,0 +1,30 @@
+/**
+ * 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';
+
+export function showPermissionString(params) {
+  let file = params[0];
+  let permission = file.get('permission');
+  if (file.get('isDirectory')) {
+    return `d${permission.substring(1)}`
+  }
+  return permission;
+}
+
+export default Ember.Helper.helper(showPermissionString);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d1620a3/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
b/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
index 2976cf9..a631335 100644
--- a/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
+++ b/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
@@ -41,6 +41,6 @@
     {{file.group}}
   </div>
   <div class={{get-value-from-columns columnHeaders 'permission' 'columnClass'}}>
-    {{file.permission}}
+    {{show-permission-string file}}
   </div>
 </div>


Mime
View raw message