rusackas commented on code in PR #39434:
URL: https://github.com/apache/superset/pull/39434#discussion_r4018343188


##########
superset-frontend/src/dashboard/components/PropertiesModal/sections/LabelColorMapping.tsx:
##########
@@ -0,0 +1,207 @@
+/**
+ * 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 React, { useMemo } from 'react';
+import { t } from '@apache-superset/core/translation';
+import { styled } from '@apache-superset/core/theme';
+
+const Container = styled.div`
+  margin-bottom: ${({ theme }: any) => (theme?.gridUnit || 4) * 4}px;
+  padding: ${({ theme }: any) => (theme?.gridUnit || 4) * 4}px;
+  background-color: ${({ theme }: any) => theme?.colors?.grayscale?.light4 || 
'#f6f6f6'};
+  border-radius: ${({ theme }: any) => theme?.borderRadius || 4}px;
+`;
+
+const Row = styled.div`
+  display: flex;
+  align-items: center;
+  margin-bottom: ${({ theme }: any) => (theme?.gridUnit || 4) * 2}px;
+  gap: ${({ theme }: any) => (theme?.gridUnit || 4) * 2}px;
+`;
+
+const HeaderRow = styled.div`
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: ${({ theme }: any) => (theme?.gridUnit || 4) * 4}px;
+`;
+
+// Bulletproof Styled Components to mimic Ant Design
+const StyledInput = styled.input`
+  flex: 1;
+  width: 100%;
+  padding: ${({ theme }: any) => (theme?.gridUnit || 4) * 1.5}px ${({ theme }: 
any) => (theme?.gridUnit || 4) * 2}px;
+  font-size: 14px;
+  border-radius: ${({ theme }: any) => theme?.borderRadius || 4}px;
+  border: 1px solid ${({ theme }: any) => theme?.colors?.grayscale?.light2 || 
'#e0e0e0'};
+  color: ${({ theme }: any) => theme?.colors?.grayscale?.dark1 || '#333333'};
+  outline: none;
+
+  &:focus {
+    border-color: ${({ theme }: any) => theme?.colors?.primary?.base || 
'#20a7c9'};
+  }
+`;
+
+const StyledColorInput = styled.input`
+  cursor: pointer;
+  height: 34px;
+  width: 40px;
+  padding: 0;
+  border: 1px solid ${({ theme }: any) => theme?.colors?.grayscale?.light2 || 
'#e0e0e0'};
+  border-radius: ${({ theme }: any) => theme?.borderRadius || 4}px;
+  outline: none;

Review Comment:
   Same story here, StyledInput/StyledColorInput lost their `any` typing in 
380f435c along with the rest of the file's theme callbacks.



##########
superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx:
##########
@@ -22,6 +22,7 @@ import type { editors } from '@apache-superset/core';
 import { EditorHost } from 'src/core/editors';
 import { ModalFormField } from 'src/components/Modal';
 import { ValidationObject } from 'src/components/Modal/useModalValidation';
+import LabelColorMapping from './LabelColorMapping';
 
 type EditorAnnotation = editors.EditorAnnotation;
 

Review Comment:
   Agreed, LabelColorMapping.test.tsx only checks that a row's inputs render 
after clicking Add more, it never asserts onJsonMetadataChange actually fires 
with the right payload, and there's no update/delete coverage at all. Would 
like to see that filled in before this merges.



-- 
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]

Reply via email to