vincbeck commented on code in PR #44464: URL: https://github.com/apache/airflow/pull/44464#discussion_r1868305774
########## providers/src/airflow/providers/fab/www/extensions/init_jinja_globals.py: ########## @@ -0,0 +1,80 @@ +# Licensed to the Apache Software Foundation (ASF) under one Review Comment: Copy and simplified version of `airflow/www/extensions/init_jinja_globals.py` ########## providers/src/airflow/providers/fab/www/extensions/init_appbuilder.py: ########## @@ -0,0 +1,580 @@ +# 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. + +# mypy: disable-error-code=var-annotated +from __future__ import annotations + +import logging +from functools import reduce +from typing import TYPE_CHECKING + +from flask import Blueprint, current_app, url_for +from flask_appbuilder import __version__ +from flask_appbuilder.babel.manager import BabelManager +from flask_appbuilder.const import ( + LOGMSG_ERR_FAB_ADD_PERMISSION_MENU, + LOGMSG_ERR_FAB_ADD_PERMISSION_VIEW, + LOGMSG_ERR_FAB_ADDON_IMPORT, + LOGMSG_ERR_FAB_ADDON_PROCESS, + LOGMSG_INF_FAB_ADD_VIEW, + LOGMSG_INF_FAB_ADDON_ADDED, + LOGMSG_WAR_FAB_VIEW_EXISTS, +) +from flask_appbuilder.filters import TemplateFilters +from flask_appbuilder.menu import Menu +from flask_appbuilder.views import IndexView + +from airflow import settings +from airflow.configuration import conf +from airflow.www.extensions.init_auth_manager import init_auth_manager Review Comment: TODO: move this extension. I have not done it yet since it seems a bit more complicated than the others. ########## providers/src/airflow/providers/fab/www/static/js/toggle_theme.js: ########## @@ -0,0 +1,46 @@ +/*! Review Comment: Copy of `airflow/www/static/js/toggle_theme.js` ########## providers/src/airflow/providers/fab/www/app.py: ########## @@ -0,0 +1,87 @@ +# Review Comment: I copied this file from `airflow/www/app.py` and removed what seemed to me unnecessary ########## providers/src/airflow/providers/fab/www/extensions/init_manifest_files.py: ########## @@ -0,0 +1,61 @@ +# Review Comment: Copy of `airflow/www/extensions/init_manifest_files.py` ########## providers/src/airflow/providers/fab/www/extensions/init_appbuilder.py: ########## @@ -0,0 +1,580 @@ +# Licensed to the Apache Software Foundation (ASF) under one Review Comment: Copy of `airflow/www/extensions/init_appbuilder.py` with some methods removed ########## providers/src/airflow/providers/fab/www/package.json: ########## @@ -0,0 +1,156 @@ +{ + "name": "airflow-www", + "version": "1.0.0", + "description": "Apache Airflow is a platform to programmatically author, schedule and monitor workflows.", + "scripts": { + "test": "jest", + "dev": "NODE_ENV=development webpack --watch --progress --devtool eval-cheap-source-map --mode development", + "prod": "NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --mode production --progress", + "build": "NODE_ENV=production webpack --progress --mode production", + "lint": "eslint --ignore-path=.eslintignore --max-warnings=0 --ext .js,.jsx,.ts,.tsx . && tsc", + "lint:fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx . && tsc", + "format": "yarn prettier --write .", + "generate-api-types": "npx openapi-typescript \"../api_connexion/openapi/v1.yaml\" --output static/js/types/api-generated.ts && node alias-rest-types.js static/js/types/api-generated.ts" + }, + "author": "Apache", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/apache/airflow.git" + }, + "homepage": "https://airflow.apache.org/", + "keywords": [ + "big", + "data", + "workflow", + "airflow", + "d3", + "nerds", + "database", + "flask" + ], + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { Review Comment: Should we try to reduce the number of dependencies? Not exactly sure which ones do the plugins need ########## providers/src/airflow/providers/fab/www/static/js/main.js: ########## @@ -0,0 +1,324 @@ +/*! Review Comment: Copy of `airflow/www/static/js/main.js` ########## providers/src/airflow/providers/fab/www/extensions/init_views.py: ########## @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one Review Comment: Copy of `airflow/www/extensions/init_views.py`. I kept only `init_plugins` and `init_error_handlers` methods ########## providers/src/airflow/providers/fab/www/static/css/loading-dots.css: ########## @@ -0,0 +1,60 @@ +/*! Review Comment: Copy of `airflow/www/static/css/loading-dots.css` ########## providers/src/airflow/providers/fab/www/templates/airflow/main.html: ########## @@ -0,0 +1,85 @@ +{# Review Comment: Copy of `airflow/www/templates/airflow/main.html`. I removed unnecessary blocks ########## providers/src/airflow/providers/fab/www/static/css/main.css: ########## @@ -0,0 +1,676 @@ +/*! Review Comment: Copy of `airflow/www/static/css/main.css` ########## providers/src/airflow/providers/fab/www/static/css/bootstrap-theme.css: ########## @@ -0,0 +1,6215 @@ +/*! Review Comment: Copy of `airflow/www/static/css/bootstrap-theme.css` ########## providers/src/airflow/providers/fab/www/package.json: ########## @@ -0,0 +1,156 @@ +{ + "name": "airflow-www", + "version": "1.0.0", + "description": "Apache Airflow is a platform to programmatically author, schedule and monitor workflows.", + "scripts": { Review Comment: The `build` script needs to be run to generate assets in `providers/src/airflow/providers/fab/www/static/dist`. I guess I need to modify the script `scripts/ci/pre_commit/compile_www_assets.py` to also generate assets in the fab provider? Until Airflow 3 UI will become the default UI in Airflow we'll generate twice the assets (one in core Airflow, one in Fab provider). Once the transition to the new UI done, we will only do it in Fab provider? ########## providers/src/airflow/providers/fab/www/static/js/datetime_utils.js: ########## @@ -0,0 +1,134 @@ +/*! Review Comment: Copy of `airflow/www/static/js/datetime_utils.js` ########## providers/src/airflow/providers/fab/www/extensions/init_security.py: ########## @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one Review Comment: Copy of `airflow/www/extensions/init_security.py`. I kept only `init_xframe_protection` method ########## providers/src/airflow/providers/fab/www/templates/airflow/_messages.html: ########## @@ -0,0 +1,30 @@ +{# Review Comment: Copy of `airflow/www/templates/airflow/_messages.html` ########## providers/src/airflow/providers/fab/www/templates/appbuilder/navbar_menu.html: ########## @@ -0,0 +1,60 @@ +{# Review Comment: Copy of `airflow/www/templates/appbuilder/navbar_menu.html` ########## providers/src/airflow/providers/fab/www/templates/appbuilder/navbar.html: ########## @@ -0,0 +1,53 @@ +{# Review Comment: Copy of `airflow/www/templates/appbuilder/navbar.html`. I removed the right part of the header (containing user information). But maybe we want to keep it? ########## providers/src/airflow/providers/fab/www/static/css/material-icons.css: ########## @@ -0,0 +1,84 @@ +/*! Review Comment: Copy of `airflow/www/static/css/material-icons.css` ########## providers/src/airflow/providers/fab/www/templates/airflow/traceback.html: ########## @@ -0,0 +1,57 @@ +{# Review Comment: Copy of `airflow/www/templates/airflow/traceback.html` ########## providers/src/airflow/providers/fab/www/templates/swagger-ui/index.j2: ########## @@ -0,0 +1,87 @@ +{# Review Comment: Copy of `airflow/www/templates/swagger-ui/index.j2` ########## providers/src/airflow/providers/fab/www/webpack.config.js: ########## @@ -0,0 +1,270 @@ +/*! Review Comment: Copy of `airflow/www/webpack.config.js`. I removed all the assets specific to pages. These assets are no longer necessary. ########## providers/src/airflow/providers/fab/www/templates/airflow/error.html: ########## @@ -0,0 +1,35 @@ +{# Review Comment: Copy of `airflow/www/templates/airflow/error.html` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
