Copilot commented on code in PR #37262: URL: https://github.com/apache/superset/pull/37262#discussion_r2726699846
########## superset-frontend/src/dashboard/util/dnd-reorder.test.ts: ########## @@ -0,0 +1,140 @@ +/** + * 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 Review Comment: The Apache License header has been incorrectly truncated. Lines 12-18 of the standard header are missing, which removes important license information including the disclaimer about the "AS IS" BASIS and warranty limitations. Please restore the complete Apache License header to match other files in the codebase. ```suggestion * 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. ``` ########## superset-frontend/src/dashboard/util/getDropPosition.test.ts: ########## @@ -0,0 +1,504 @@ +/** + * 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 getDropPosition, { + DROP_TOP, + DROP_RIGHT, + DROP_BOTTOM, + DROP_LEFT, + DROP_FORBIDDEN, +} from 'src/dashboard/util/getDropPosition'; + +import { + CHART_TYPE, + DASHBOARD_GRID_TYPE, + DASHBOARD_ROOT_TYPE, + HEADER_TYPE, + ROW_TYPE, + TAB_TYPE, +} from 'src/dashboard/util/componentTypes'; +import { ComponentType } from '../types'; + +type ClientOffset = { + x: number; + y: number; +}; + +type DOMRectLike = { + top: number; + right: number; + bottom: number; + left: number; +}; + +type DropTargetMonitor = { + getItem: () => { + id: string; + type: ComponentType; + }; + getClientOffset: () => ClientOffset; +}; + +type DropTargetComponent = { + props: { + depth: number; + parentComponent: { + type: ComponentType; + }; + component: { + id: string; + type: ComponentType; + children: string[]; + }; + orientation: 'row' | 'column'; + isDraggingOverShallow: boolean; + }; + ref: { + getBoundingClientRect: () => DOMRectLike; Review Comment: The type definition for `ref.getBoundingClientRect` in the test does not match the implementation. The test defines it as returning `DOMRectLike`, while the implementation in getDropPosition.ts (line 73) defines it as returning `DOMRectLike | null`. The test should match the implementation to accurately test runtime behavior. ```suggestion getBoundingClientRect: () => DOMRectLike | null; ``` ########## superset-frontend/src/dashboard/util/getDropPosition.test.ts: ########## @@ -0,0 +1,504 @@ +/** + * 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 getDropPosition, { + DROP_TOP, + DROP_RIGHT, + DROP_BOTTOM, + DROP_LEFT, + DROP_FORBIDDEN, +} from 'src/dashboard/util/getDropPosition'; + +import { + CHART_TYPE, + DASHBOARD_GRID_TYPE, + DASHBOARD_ROOT_TYPE, + HEADER_TYPE, + ROW_TYPE, + TAB_TYPE, +} from 'src/dashboard/util/componentTypes'; +import { ComponentType } from '../types'; + +type ClientOffset = { + x: number; + y: number; +}; + +type DOMRectLike = { + top: number; + right: number; + bottom: number; + left: number; +}; + +type DropTargetMonitor = { + getItem: () => { + id: string; + type: ComponentType; + }; + getClientOffset: () => ClientOffset; +}; + +type DropTargetComponent = { + props: { + depth: number; + parentComponent: { + type: ComponentType; + }; + component: { + id: string; + type: ComponentType; + children: string[]; + }; + orientation: 'row' | 'column'; + isDraggingOverShallow: boolean; + }; + ref: { + getBoundingClientRect: () => DOMRectLike; + }; +}; Review Comment: Type definitions for ClientOffset, DOMRectLike, DropTargetMonitor, and DropTargetComponent are duplicated between this test file and getDropPosition.ts. Consider exporting these types from getDropPosition.ts and importing them in the test file to maintain a single source of truth and reduce maintenance burden. ########## superset-frontend/oxlint.json: ########## @@ -14,7 +14,11 @@ }, "settings": { "react": { +<<<<<<< HEAD "version": "17.0.2" +======= + "version": "18" +>>>>>>> 8900135a64 (fix: resolve frontend lint config issue) Review Comment: Git merge conflict markers remain in the file. This must be resolved before merging. The conflict is between React version "17.0.2" and "18". Please resolve this conflict by choosing the appropriate version or by properly merging the changes. ```suggestion "version": "18" ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
