diff --git a/.rat-excludes b/.rat-excludes index ea26511a3c530..608e1daf7caf6 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -64,8 +64,6 @@ underscore.js jquery.dataTables.min.js jqClock.min.js dagre-d3.min.js -bootstrap-toggle.min.js -bootstrap-toggle.min.css d3.v3.min.js ace.js node_modules/* diff --git a/airflow/www/package.json b/airflow/www/package.json index 955df82efc1c8..166e73cd0c1fe 100644 --- a/airflow/www/package.json +++ b/airflow/www/package.json @@ -60,7 +60,6 @@ }, "dependencies": { "bootstrap-3-typeahead": "^4.0.2", - "bootstrap-toggle": "^2.2.2", "d3": "^3.4.4", "d3-tip": "^0.9.1", "dagre-d3": "^0.6.4", diff --git a/airflow/www/static/css/switch.css b/airflow/www/static/css/switch.css new file mode 100644 index 0000000000000..1d8d9886742f1 --- /dev/null +++ b/airflow/www/static/css/switch.css @@ -0,0 +1,84 @@ +/** + * 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. + */ + +.switch-label { + display: inline-block; + margin: 0; + cursor: pointer; +} + +.switch-input { + /* Visusally hidden input but still accessible */ + position: absolute; + overflow: hidden; + clip: rect(1px, 1px, 1px, 1px); + border: 0; + width: 1px; + height: 1px; + padding: 0; + white-space: nowrap; + clip-path: inset(50%); +} + +.switch { + box-sizing: content-box; + display: inline-flex; + align-items: center; + border-radius: 999px; + width: 2.5rem; + padding: 2px; + background-color: #c4c2c1; + cursor: pointer; +} + +.switch::before { + border-radius: 50%; + width: 1.5rem; + height: 1.5rem; + content: ''; + background-color: #edecec; + transition-timing-function: ease-in-out; + transition-duration: 0.25s; + transition-property: transform, background-color; +} + +.switch-input:checked + .switch { + background-color: #005c66; +} + +.switch-input:checked + .switch::before { + background-color: #fffefd; + transform: translateX(1rem); +} + +.switch-input:focus + .switch { + box-shadow: 0 0 0 3px rgba(0, 92, 102, 0.4); +} + +.switch-input:focus + .switch::before { + background-color: #fff; +} + +.switch-input:not(:checked) + .switch:hover { + background-color: #9e9e9c; +} + +.switch-input:not(:checked) + .switch:hover::before { + background-color: #f5f5f5; +} diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html index cbd4d76d7436b..43afd65723417 100644 --- a/airflow/www/templates/airflow/dag.html +++ b/airflow/www/templates/airflow/dag.html @@ -23,7 +23,7 @@ {% block head_css %} {{ super() }} - + {% endblock %} {% block content %} @@ -32,7 +32,10 @@

{% if dag.parent_dag is defined and dag.parent_dag %} SUBDAG: {{ dag.dag_id }} {% else %} - + DAG: {{ dag.dag_id }} {{ dag.description[0:150] + '…' if dag.description and dag.description|length > 150 else dag.description|default('', true) }} {% endif %} @@ -346,7 +349,6 @@

DAGs

- + @@ -245,7 +248,6 @@

DAGs

- {% endblock %} diff --git a/airflow/www/webpack.config.js b/airflow/www/webpack.config.js index 98bcd04c09b03..3424e439c3757 100644 --- a/airflow/www/webpack.config.js +++ b/airflow/www/webpack.config.js @@ -40,6 +40,7 @@ const config = { 'task-instances': `${STATIC_DIR}/js/task-instances.js`, ganttChartD3v2: `${STATIC_DIR}/js/gantt-chart-d3v2.js`, main: `${STATIC_DIR}/css/main.css`, + switch: `${STATIC_DIR}/css/switch.css`, airflowDefaultTheme: `${STATIC_DIR}/css/bootstrap-theme.css`, moment: 'moment-timezone', }, @@ -145,9 +146,6 @@ const config = { }, { from: 'node_modules/bootstrap-3-typeahead/*min.*', flatten: true - }, { - from: 'node_modules/bootstrap-toggle/**/*bootstrap-toggle.min.*', - flatten: true, }, { from: 'node_modules/datatables.net/**/**.min.*', flatten: true diff --git a/airflow/www/yarn.lock b/airflow/www/yarn.lock index daf56e86587b7..a46431319bcf9 100644 --- a/airflow/www/yarn.lock +++ b/airflow/www/yarn.lock @@ -1161,11 +1161,6 @@ bootstrap-3-typeahead@^4.0.2: resolved "https://registry.yarnpkg.com/bootstrap-3-typeahead/-/bootstrap-3-typeahead-4.0.2.tgz#cb1c969044856862096fc8c71cc21b3acbb50412" integrity sha1-yxyWkESFaGIJb8jHHMIbOsu1BBI= -bootstrap-toggle@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/bootstrap-toggle/-/bootstrap-toggle-2.2.2.tgz#2b88534fc1b998674f877f98ba0d8b5b743e96fe" - integrity sha1-K4hTT8G5mGdPh3+Yug2LW3Q+lv4= - bootstrap@^3.3: version "3.4.1" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.4.1.tgz#c3a347d419e289ad11f4033e3c4132b87c081d72" diff --git a/licenses/LICENSE-bootstrap-toggle.txt b/licenses/LICENSE-bootstrap-toggle.txt deleted file mode 100644 index 0bd283164f026..0000000000000 --- a/licenses/LICENSE-bootstrap-toggle.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2011-2014 Min Hur, The New York Times Company - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/setup.cfg b/setup.cfg index 359a7054dc057..593dae5a0334f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,6 @@ license_files = LICENSE NOTICE # Start of licenses generated automatically - licenses/LICENSE-bootstrap-toggle.txt licenses/LICENSE-bootstrap.txt licenses/LICENSE-bootstrap3-typeahead.txt licenses/LICENSE-d3-tip.txt