Skip to content

Commit 74dfc89

Browse files
Fix lint
1 parent 3b21287 commit 74dfc89

File tree

3 files changed

+103
-72
lines changed

3 files changed

+103
-72
lines changed

airflow-core/docs/howto/custom-view-plugin.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ In this object reference, the list of dictionaries with Middleware factories obj
3838
initialization parameters and some metadata information like the name are passed on.
3939

4040
Using external_views in Airflow plugin, allows to register custom views that are rendered in iframes or external link
41-
in the Airflow UI. This is useful for integrating external applications or custom dashboards into the Airflow UI, or link to
42-
external resources from the nav bar.
41+
in the Airflow UI. This is useful for integrating external applications or custom dashboards into the Airflow UI.
4342
In this object reference, the list of dictionaries with the view name, iframe src (templatable), destination and
4443
optional parameters like the icon and url_route are passed on.
4544

airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts

Lines changed: 81 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,80 @@ export const $ExternalLogUrlResponse = {
32693269
description: 'Response for the external log URL endpoint.'
32703270
} as const;
32713271

3272+
export const $ExternalViewResponse = {
3273+
properties: {
3274+
name: {
3275+
type: 'string',
3276+
title: 'Name'
3277+
},
3278+
href: {
3279+
type: 'string',
3280+
title: 'Href'
3281+
},
3282+
icon: {
3283+
anyOf: [
3284+
{
3285+
type: 'string'
3286+
},
3287+
{
3288+
type: 'null'
3289+
}
3290+
],
3291+
title: 'Icon'
3292+
},
3293+
dark_mode_icon: {
3294+
anyOf: [
3295+
{
3296+
type: 'string'
3297+
},
3298+
{
3299+
type: 'null'
3300+
}
3301+
],
3302+
title: 'Dark Mode Icon'
3303+
},
3304+
url_route: {
3305+
anyOf: [
3306+
{
3307+
type: 'string'
3308+
},
3309+
{
3310+
type: 'null'
3311+
}
3312+
],
3313+
title: 'Url Route'
3314+
},
3315+
category: {
3316+
anyOf: [
3317+
{
3318+
type: 'string'
3319+
},
3320+
{
3321+
type: 'null'
3322+
}
3323+
],
3324+
title: 'Category'
3325+
},
3326+
destination: {
3327+
anyOf: [
3328+
{
3329+
type: 'string',
3330+
enum: ['nav', 'dag', 'dag_run', 'task', 'task_instance']
3331+
},
3332+
{
3333+
type: 'null'
3334+
}
3335+
],
3336+
title: 'Destination'
3337+
}
3338+
},
3339+
additionalProperties: true,
3340+
type: 'object',
3341+
required: ['name', 'href'],
3342+
title: 'ExternalViewResponse',
3343+
description: 'Serializer for IFrame Plugin responses.'
3344+
} as const;
3345+
32723346
export const $ExtraLinkCollectionResponse = {
32733347
properties: {
32743348
extra_links: {
@@ -3399,58 +3473,6 @@ export const $HealthInfoResponse = {
33993473
description: 'Health serializer for responses.'
34003474
} as const;
34013475

3402-
export const $IFrameViewsResponse = {
3403-
properties: {
3404-
name: {
3405-
type: 'string',
3406-
title: 'Name'
3407-
},
3408-
src: {
3409-
type: 'string',
3410-
title: 'Src'
3411-
},
3412-
icon: {
3413-
anyOf: [
3414-
{
3415-
type: 'string'
3416-
},
3417-
{
3418-
type: 'null'
3419-
}
3420-
],
3421-
title: 'Icon'
3422-
},
3423-
url_route: {
3424-
anyOf: [
3425-
{
3426-
type: 'string'
3427-
},
3428-
{
3429-
type: 'null'
3430-
}
3431-
],
3432-
title: 'Url Route'
3433-
},
3434-
destination: {
3435-
anyOf: [
3436-
{
3437-
type: 'string',
3438-
enum: ['nav', 'dag', 'dag_run', 'task', 'task_instance']
3439-
},
3440-
{
3441-
type: 'null'
3442-
}
3443-
],
3444-
title: 'Destination'
3445-
}
3446-
},
3447-
additionalProperties: true,
3448-
type: 'object',
3449-
required: ['name', 'src'],
3450-
title: 'IFrameViewsResponse',
3451-
description: 'Serializer for IFrame Plugin responses.'
3452-
} as const;
3453-
34543476
export const $ImportErrorCollectionResponse = {
34553477
properties: {
34563478
import_errors: {
@@ -3830,12 +3852,13 @@ export const $PluginResponse = {
38303852
type: 'array',
38313853
title: 'Fastapi Root Middlewares'
38323854
},
3833-
iframe_views: {
3855+
external_views: {
38343856
items: {
3835-
'$ref': '#/components/schemas/IFrameViewsResponse'
3857+
'$ref': '#/components/schemas/ExternalViewResponse'
38363858
},
38373859
type: 'array',
3838-
title: 'Iframe Views'
3860+
title: 'External Views',
3861+
description: "Aggregate all external views. Both 'external_views' and 'appbuilder_menu_items' are included here."
38393862
},
38403863
appbuilder_views: {
38413864
items: {
@@ -3849,7 +3872,8 @@ export const $PluginResponse = {
38493872
'$ref': '#/components/schemas/AppBuilderMenuItemResponse'
38503873
},
38513874
type: 'array',
3852-
title: 'Appbuilder Menu Items'
3875+
title: 'Appbuilder Menu Items',
3876+
deprecated: true
38533877
},
38543878
global_operator_extra_links: {
38553879
items: {
@@ -3885,7 +3909,7 @@ export const $PluginResponse = {
38853909
}
38863910
},
38873911
type: 'object',
3888-
required: ['name', 'macros', 'flask_blueprints', 'fastapi_apps', 'fastapi_root_middlewares', 'iframe_views', 'appbuilder_views', 'appbuilder_menu_items', 'global_operator_extra_links', 'operator_extra_links', 'source', 'listeners', 'timetables'],
3912+
required: ['name', 'macros', 'flask_blueprints', 'fastapi_apps', 'fastapi_root_middlewares', 'external_views', 'appbuilder_views', 'appbuilder_menu_items', 'global_operator_extra_links', 'operator_extra_links', 'source', 'listeners', 'timetables'],
38893913
title: 'PluginResponse',
38903914
description: 'Plugin serializer.'
38913915
} as const;

airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,20 @@ export type ExternalLogUrlResponse = {
871871
url: string;
872872
};
873873

874+
/**
875+
* Serializer for IFrame Plugin responses.
876+
*/
877+
export type ExternalViewResponse = {
878+
name: string;
879+
href: string;
880+
icon?: string | null;
881+
dark_mode_icon?: string | null;
882+
url_route?: string | null;
883+
category?: string | null;
884+
destination?: 'nav' | 'dag' | 'dag_run' | 'task' | 'task_instance' | null;
885+
[key: string]: unknown | string;
886+
};
887+
874888
/**
875889
* Extra Links Response.
876890
*/
@@ -923,18 +937,6 @@ export type HealthInfoResponse = {
923937
dag_processor?: DagProcessorInfoResponse | null;
924938
};
925939

926-
/**
927-
* Serializer for IFrame Plugin responses.
928-
*/
929-
export type IFrameViewsResponse = {
930-
name: string;
931-
src: string;
932-
icon?: string | null;
933-
url_route?: string | null;
934-
destination?: 'nav' | 'dag' | 'dag_run' | 'task' | 'task_instance' | null;
935-
[key: string]: unknown | string;
936-
};
937-
938940
/**
939941
* Import Error Collection Response.
940942
*/
@@ -1034,8 +1036,14 @@ export type PluginResponse = {
10341036
flask_blueprints: Array<(string)>;
10351037
fastapi_apps: Array<FastAPIAppResponse>;
10361038
fastapi_root_middlewares: Array<FastAPIRootMiddlewareResponse>;
1037-
iframe_views: Array<IFrameViewsResponse>;
1039+
/**
1040+
* Aggregate all external views. Both 'external_views' and 'appbuilder_menu_items' are included here.
1041+
*/
1042+
external_views: Array<ExternalViewResponse>;
10381043
appbuilder_views: Array<AppBuilderViewResponse>;
1044+
/**
1045+
* @deprecated
1046+
*/
10391047
appbuilder_menu_items: Array<AppBuilderMenuItemResponse>;
10401048
global_operator_extra_links: Array<(string)>;
10411049
operator_extra_links: Array<(string)>;

0 commit comments

Comments
 (0)