You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2025/01/07 20:20:18 UTC

(superset) 01/02: fixups

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch labels
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4f266536a057e6255c3ce431c94ff56226c17fed
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Tue Jan 7 12:18:36 2025 -0800

    fixups
---
 .../storybook/stories/superset-ui-style/Theme.stories.tsx         | 4 ++--
 superset-frontend/src/components/AlteredSliceTag/index.tsx        | 8 ++++++--
 superset-frontend/src/components/Icons/Icon.tsx                   | 4 ++--
 superset-frontend/src/components/Label/Label.test.tsx             | 4 +++-
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx
index a670558de0..b46c9dfb81 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx
@@ -11,8 +11,8 @@
  *
  * 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
+ * "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.
  */
diff --git a/superset-frontend/src/components/AlteredSliceTag/index.tsx b/superset-frontend/src/components/AlteredSliceTag/index.tsx
index 7273ea26f0..9aca6b46b8 100644
--- a/superset-frontend/src/components/AlteredSliceTag/index.tsx
+++ b/superset-frontend/src/components/AlteredSliceTag/index.tsx
@@ -215,11 +215,15 @@ const AlteredSliceTag: FC<AlteredSliceTagProps> = props => {
     );
   }, [rows]);
 
-  const icon = <Icons.Warning iconSize="m" />;
   const triggerNode = useMemo(
     () => (
       <Tooltip id="difference-tooltip" title={t('Click to see difference')}>
-        <Label icon={icon} className="label" type="alert" onClick={() => {}}>
+        <Label
+          icon={<Icons.Warning iconSize="m" />}
+          className="label"
+          type="alert"
+          onClick={() => {}}
+        >
           {t('Altered')}
         </Label>
       </Tooltip>
diff --git a/superset-frontend/src/components/Icons/Icon.tsx b/superset-frontend/src/components/Icons/Icon.tsx
index 32c308f53d..39e5627235 100644
--- a/superset-frontend/src/components/Icons/Icon.tsx
+++ b/superset-frontend/src/components/Icons/Icon.tsx
@@ -37,8 +37,8 @@ const AntdIconComponent = ({
 export const StyledIcon = styled(AntdIconComponent)<IconType>`
   ${({ iconColor }) => iconColor && `color: ${iconColor};`};
   span {
-    // Hack to fix issues with some icons
-    line-height: 0px !important;
+    // Fixing alignement on some of the icons
+    line-height: 0px;
   }
   font-size: ${({ iconSize, theme }) =>
     iconSize
diff --git a/superset-frontend/src/components/Label/Label.test.tsx b/superset-frontend/src/components/Label/Label.test.tsx
index fcabd744a7..ac57250bc7 100644
--- a/superset-frontend/src/components/Label/Label.test.tsx
+++ b/superset-frontend/src/components/Label/Label.test.tsx
@@ -37,7 +37,9 @@ test('works with an onClick handler', () => {
 // test stories from the storybook!
 test('renders all the storybook gallery variants', () => {
   const { container } = render(<LabelGallery />);
+  const nonInteractiveLabelCount = 4;
+  const renderedLabelCount = options.length * 2 + nonInteractiveLabelCount;
   expect(container.querySelectorAll('.ant-tag')).toHaveLength(
-    options.length * 2 + 4,
+    renderedLabelCount,
   );
 });