You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by db...@apache.org on 2016/03/15 13:00:22 UTC

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

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 04a9aa393 -> 7db352828


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/7db35282
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7db35282
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7db35282

Branch: refs/heads/branch-2.2
Commit: 7db352828dfe6e83d1480f97da7a6fba956d607a
Parents: 04a9aa3
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Tue Mar 15 17:30:06 2016 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
Committed: Tue Mar 15 17:30:06 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/7db35282/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/7db35282/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>