You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ry...@apache.org on 2020/11/19 18:14:30 UTC
[airflow] branch master updated: Improve UI file naming/patterns
(#12486)
This is an automated email from the ASF dual-hosted git repository.
ryanahamilton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new bc01907 Improve UI file naming/patterns (#12486)
bc01907 is described below
commit bc01907eeadc0f2f2516dc8b1af57236a1a256d3
Author: Ryan Hamilton <ry...@ryanahamilton.com>
AuthorDate: Thu Nov 19 13:12:42 2020 -0500
Improve UI file naming/patterns (#12486)
* Use friendlier terms for file naming
* Correlate asset names to template names
---
airflow/www/extensions/init_appbuilder.py | 2 +-
airflow/www/static/js/{base.js => main.js} | 0
airflow/www/static/js/task-instances.js | 2 +-
airflow/www/templates/airflow/{master.html => main.html} | 4 ++--
airflow/www/webpack.config.js | 3 +--
5 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/airflow/www/extensions/init_appbuilder.py b/airflow/www/extensions/init_appbuilder.py
index 96d12d5..036315b 100644
--- a/airflow/www/extensions/init_appbuilder.py
+++ b/airflow/www/extensions/init_appbuilder.py
@@ -47,6 +47,6 @@ def init_appbuilder(app):
app=app,
session=settings.Session,
security_manager_class=security_manager_class,
- base_template='airflow/master.html',
+ base_template='airflow/main.html',
update_perms=conf.getboolean('webserver', 'UPDATE_FAB_PERMS'),
)
diff --git a/airflow/www/static/js/base.js b/airflow/www/static/js/main.js
similarity index 100%
rename from airflow/www/static/js/base.js
rename to airflow/www/static/js/main.js
diff --git a/airflow/www/static/js/task-instances.js b/airflow/www/static/js/task-instances.js
index 452cfd0..ef1c74c 100644
--- a/airflow/www/static/js/task-instances.js
+++ b/airflow/www/static/js/task-instances.js
@@ -20,7 +20,7 @@
/* global window, dagTZ, moment, convertSecsToHumanReadable */
// We don't re-import moment again, otherwise webpack will include it twice in the bundle!
-import { escapeHtml } from './base';
+import { escapeHtml } from './main';
import { defaultFormat, formatDateTime } from './datetime-utils';
function makeDateTimeHTML(start, end) {
diff --git a/airflow/www/templates/airflow/master.html b/airflow/www/templates/airflow/main.html
similarity index 97%
rename from airflow/www/templates/airflow/master.html
rename to airflow/www/templates/airflow/main.html
index 80706cb..c064d3d 100644
--- a/airflow/www/templates/airflow/master.html
+++ b/airflow/www/templates/airflow/main.html
@@ -78,7 +78,7 @@
{{ super() }}
<script>
- // below variables are used in base.js
+ // below variables are used in main.js
var Airflow = {
serverTimezone: '{{ server_timezone }}',
defaultUITimezone: '{{ default_ui_timezone }}'
@@ -91,7 +91,7 @@
<script src="{{ url_for_asset('ie.js') }}"></script>
<![endif]-->
<script src="{{ url_for_asset('moment.js') }}"></script>
- <script src="{{ url_for_asset('base.js') }}"></script>
+ <script src="{{ url_for_asset('main.js') }}"></script>
<script src="{{ url_for_asset('bootstrap-datetimepicker.min.js') }}"></script>
<script src="{{ url_for_asset('bootstrap3-typeahead.min.js') }}"></script>
diff --git a/airflow/www/webpack.config.js b/airflow/www/webpack.config.js
index 5ad978d..f63aa0b 100644
--- a/airflow/www/webpack.config.js
+++ b/airflow/www/webpack.config.js
@@ -37,7 +37,6 @@ const BUILD_DIR = path.resolve(__dirname, './static/dist');
const config = {
entry: {
airflowDefaultTheme: `${STATIC_DIR}/css/bootstrap-theme.css`,
- base: `${STATIC_DIR}/js/base.js`,
connectionForm: `${STATIC_DIR}/js/connection_form.js`,
dags: `${STATIC_DIR}/css/dags.css`,
flash: `${STATIC_DIR}/css/flash.css`,
@@ -46,7 +45,7 @@ const config = {
graph: `${STATIC_DIR}/css/graph.css`,
ie: `${STATIC_DIR}/js/ie.js`,
loadingDots: `${STATIC_DIR}/css/loading-dots.css`,
- main: `${STATIC_DIR}/css/main.css`,
+ main: [`${STATIC_DIR}/css/main.css`, `${STATIC_DIR}/js/main.js`],
materialIcons: `${STATIC_DIR}/css/material-icons.css`,
moment: 'moment-timezone',
switch: `${STATIC_DIR}/css/switch.css`,