[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-19 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r810511424



##
File path: airflow/www/views.py
##
@@ -3867,13 +3870,15 @@ class VariableModelView(AirflowModelView):
 'add': 'create',
 'list': 'read',
 'edit': 'edit',
+'show': 'show',

Review comment:
   done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-19 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r810511392



##
File path: airflow/www/views.py
##
@@ -3859,6 +3859,9 @@ class VariableModelView(AirflowModelView):
 
 list_template = 'airflow/variable_list.html'
 edit_template = 'airflow/variable_edit.html'
+show_template = 'airflow/variable_show.html'

Review comment:
   overriding _show of BaseCRUDView to mask secret values.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-19 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r810511249



##
File path: airflow/www/templates/airflow/variable_show_widget.html
##
@@ -0,0 +1,70 @@
+{#
+ 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 'appbuilder/general/lib.html' as lib %}
+{% include 'appbuilder/general/confirm.html' %}
+{% include 'appbuilder/general/alert.html' %}
+
+{% block columns %}
+
+{% if fieldsets %}
+
+{% for fieldset_item in fieldsets %}
+{% if fieldset_item[1].get('expanded') == None %}
+{% set expanded = True %}
+{% else %}
+{% set expanded = fieldset_item[1].get('expanded') %}
+{% endif %}
+{% call lib.accordion_tag(loop.index,fieldset_item[0], expanded) %}
+
+
+{% for item in fieldset_item[1].get('fields') %}
+
+{{label_columns.get(item)}}
+{{value_columns[include_columns.index(item)]}}

Review comment:
   done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-08 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r801526519



##
File path: airflow/www/views.py
##
@@ -3859,6 +3859,9 @@ class VariableModelView(AirflowModelView):
 
 list_template = 'airflow/variable_list.html'
 edit_template = 'airflow/variable_edit.html'
+show_template = 'airflow/variable_show.html'

Review comment:
   but FAB's widget have different formatting than what we need for show 
variable , i.e preserving the format of the string




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-07 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r801157071



##
File path: airflow/www/widgets.py
##
@@ -72,3 +72,8 @@ class BS3TextAreaROWidget(BS3TextAreaFieldWidget):
 def __call__(self, field, **kwargs):
 kwargs['readonly'] = 'true'
 return super().__call__(field, **kwargs)
+
+class AirflowModelShowWidget(RenderTemplateWidget):
+"""Airflow model show widget"""
+
+template = 'airflow/model_show.html'

Review comment:
   Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-06 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r800219334



##
File path: airflow/www/widgets.py
##
@@ -72,3 +72,8 @@ class BS3TextAreaROWidget(BS3TextAreaFieldWidget):
 def __call__(self, field, **kwargs):
 kwargs['readonly'] = 'true'
 return super().__call__(field, **kwargs)
+
+class AirflowModelShowWidget(RenderTemplateWidget):
+"""Airflow model show widget"""
+
+template = 'airflow/model_show.html'

Review comment:
   In FAB's template, formatter is invoked and value of the field is passed.
   
https://github.com/dpgaspar/Flask-AppBuilder/blob/3a6b45b1c12a52a794de27910896cbae61270d6b/flask_appbuilder/templates/appbuilder/general/widgets/show.html#L5
   
   FAB's code is passing value (string) of the field instead of dictionary of 
key and value, so below airflow code is breaking: 
https://github.com/apache/airflow/blob/ac93ee863a28d7774477a120696f2430dbb284df/airflow/www/views.py#L3895
   
   above code is expecting dictionary instead of string.
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] aa3pankaj commented on a change in pull request #21342: Add 'Show record' option for variables

2022-02-06 Thread GitBox


aa3pankaj commented on a change in pull request #21342:
URL: https://github.com/apache/airflow/pull/21342#discussion_r800219334



##
File path: airflow/www/widgets.py
##
@@ -72,3 +72,8 @@ class BS3TextAreaROWidget(BS3TextAreaFieldWidget):
 def __call__(self, field, **kwargs):
 kwargs['readonly'] = 'true'
 return super().__call__(field, **kwargs)
+
+class AirflowModelShowWidget(RenderTemplateWidget):
+"""Airflow model show widget"""
+
+template = 'airflow/model_show.html'

Review comment:
   In FAB's template, formatter is invoked and value of the field is passed.
   
https://github.com/dpgaspar/Flask-AppBuilder/blob/3a6b45b1c12a52a794de27910896cbae61270d6b/flask_appbuilder/templates/appbuilder/general/widgets/show.html#L5
   
   FAB's code is passing value (string) of the field instead of dictionary of 
key and value, so this code is breaking: 
https://github.com/apache/airflow/blob/ac93ee863a28d7774477a120696f2430dbb284df/airflow/www/views.py#L3895
   
   above code is expecting dictionary instead of string.
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org