You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2019/05/03 05:13:53 UTC

[atlas] branch branch-2.0 updated: ATLAS-3155: UI - IE-11 - Name entry not clickable (#2)

This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 37ae1d5  ATLAS-3155: UI - IE-11 - Name entry not clickable (#2)
37ae1d5 is described below

commit 37ae1d5d257bcf358a747659da3d20e038958ac8
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu May 2 17:59:31 2019 +0530

    ATLAS-3155: UI - IE-11 - Name entry not clickable (#2)
    
    Signed-off-by: Madhan Neethiraj <ma...@apache.org>
    (cherry picked from commit bd7f5eecf8cadae392adb948e3492ce6c1c97bbf)
---
 .../js/templates/entity/CreateEntityLayoutView_tmpl.html   |  2 +-
 .../js/templates/search/SearchResultLayoutView_tmpl.html   | 10 +++++-----
 .../public/js/views/entity/CreateEntityLayoutView.js       | 14 ++++++--------
 .../org/apache/atlas/web/security/AtlasSecurityConfig.java |  2 +-
 4 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
index 5645d51..9fcbd85 100644
--- a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
@@ -27,7 +27,7 @@
                     <select class="form-control col-sm-6 row-margin-bottom" data-id="entityList"></select>
                 </div>
                 {{/if}}
-                <div class="col-sm-4">
+                <div class="col-sm-4 toggleRequiredSwitch">
                     <span class="pull-left">Required</span>
                     <label class="switch pull-left">
                         <input type="checkbox" class="switch-input" name="toggleRequired" value="text">
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 81cddf5..d287ac9 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -25,10 +25,13 @@
     <div class="searchTable">
         <div class="{{#unless isGlossaryView}}row well{{/unless}}" style="padding-top: 0px;">
             <div class="row form-group pagination-box filter-box" style="display: none;">
-                <div class="col-sm-4">
+                <div class="col-sm-3">
                     <span class="labelShowRecord pull-left" data-id="pageRecordText"> </span>
                 </div>
-                <div class="col-sm-8 inline-content-fr no-padding-left">
+                <div class="col-sm-9 inline-content-fr no-padding-left">
+                    <div class="inline">
+                        <a href="javascript:void(0)" class=" multiSelectTag assignTag btn btn-action btn-sm" style="display:none" title="Assign Classification" data-id="addAssignTag"><i class="fa fa-plus"></i>&nbsp;Classification</a>
+                    </div>
                     <div class="inline" data-id="colManager"></div>
                     <div class="inline" data-id="containerCheckBox" style="display: none;">
                         <label class="checkbox-inline btn" for="historicalentities">
@@ -47,9 +50,6 @@
                             <b>Exclude sub-types</b></label>
                     </div>
                     {{/ifCond}}
-                    <div class="inline">
-                        <a href="javascript:void(0)" class=" multiSelectTag assignTag btn btn-action btn-sm" style="display:none" data-id="addAssignTag"><i class="fa fa-plus"></i> Assign Tag</a>
-                    </div>
                 </div>
             </div>
             <div id="r_searchResultTableLayoutView">
diff --git a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
index 22ce48c..2b2e4e0 100644
--- a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
+++ b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
@@ -125,6 +125,7 @@ define(['require',
                 }
                 this.showLoader();
                 this.fetchCollections();
+                this.$('.toggleRequiredSwitch').hide();
             },
             bindRequiredField: function() {
                 var that = this;
@@ -411,6 +412,11 @@ define(['require',
                         }
                     })
                 }
+                if (attributeDefs.attributeDefs.length || attributeDefs.relationshipAttributeDefs.length) {
+                    this.$('.toggleRequiredSwitch').show();
+                } else {
+                    this.$('.toggleRequiredSwitch').hide();
+                }
                 //make a function call.
                 this.renderAttribute({
                     attributeDefs: attributeDefs
@@ -443,14 +449,6 @@ define(['require',
                         // For create entity bind keyup for non-required field when all elements are optional
                         this.bindNonRequiredField();
                     }
-                    this.ui.toggleRequired.prop('checked', true);
-                } else {
-                    this.ui.entityInputData.find('fieldset').each(function() {
-                        // if checkbox is alredy selected then dont hide
-                        if (!$(this).find('div').hasClass('false') && !that.ui.toggleRequired.is(":checked")) {
-                            $(this).hide();
-                        }
-                    });
                 }
                 this.$('select[data-type="boolean"]').each(function(value, key) {
                     var dataKey = $(key).data('key');
diff --git a/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java b/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
index 286f85c..bf6b85b 100644
--- a/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
+++ b/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
@@ -128,7 +128,7 @@ public class AtlasSecurityConfig extends WebSecurityConfigurerAdapter {
                 .authorizeRequests().anyRequest().authenticated()
                 .and()
                     .headers()
-                        .addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy","script-src 'self' 'unsafe-inline' 'unsafe-eval'"))
+                        .addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy", "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:; connect-src 'self'; img-src 'self' blob: data:; style-src 'self' 'unsafe-inline';font-src 'self' data:"))
                         .addHeaderWriter(new StaticHeadersWriter("Server","Apache Atlas"))
                 .and()
                     .servletApi()