Skip to content

Commit

Permalink
Revert "Fixed Bug: Alpha slider doesn’t move, only the color slider i…
Browse files Browse the repository at this point in the history
…s movable in tag color picker (#4359)" (#4390)

This reverts commit cf7cefe.
  • Loading branch information
gabe-lyons authored Mar 13, 2022
1 parent 63a3339 commit bb413be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"react-syntax-highlighter": "^15.4.4",
"react-timezone-select": "^1.1.15",
"react-visibility-sensor": "^5.1.1",
"rgb-hex": "^4.0.0",
"sinon": "^11.1.1",
"start-server-and-test": "1.12.2",
"styled-components": "^5.2.1",
Expand Down
11 changes: 5 additions & 6 deletions datahub-web-react/src/app/shared/TagStyleEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { ApolloError } from '@apollo/client';
import styled from 'styled-components';
import { ChromePicker } from 'react-color';
import ColorHash from 'color-hash';
import rgbHex from 'rgb-hex';

import { PlusOutlined } from '@ant-design/icons';
import { useGetTagQuery } from '../../graphql/tag.generated';
import { EntityType, FacetMetadata, Maybe, Scalars } from '../../types.generated';
Expand Down Expand Up @@ -258,6 +256,10 @@ export default function TagStyleEntity({ urn, useGetSearchResults = useWrappedSe
saveColor();
};

const handleColorChange = (color: any) => {
setColorValue(color?.hex);
};

// Update Description
const updateDescriptionValue = (desc: string) => {
setUpdatedDescription(desc);
Expand Down Expand Up @@ -312,10 +314,7 @@ export default function TagStyleEntity({ urn, useGetSearchResults = useWrappedSe
</TagName>
{displayColorPicker && (
<ColorPickerPopOver ref={colorPickerRef}>
<ChromePicker
color={colorValue}
onChange={(c) => setColorValue(`#${rgbHex(c.rgb.r, c.rgb.g, c.rgb.b, c.rgb.a)}`)}
/>
<ChromePicker color={colorValue} onChange={handleColorChange} />
</ColorPickerPopOver>
)}
</div>
Expand Down
5 changes: 0 additions & 5 deletions datahub-web-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14722,11 +14722,6 @@ [email protected]:
convert-source-map "^0.3.3"
css "^2.0.0"

rgb-hex@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/rgb-hex/-/rgb-hex-4.0.0.tgz#02fb1e215e3fe5d070501579a3d2e4fa3c0acec8"
integrity sha512-Eg2ev5CiMBnQ9Gpflmqbwbso0CCdISqtVIow7OpYSLN1ULUv2jTB9YieS1DSSn/17AD7KkPWDPzSFzI4GSuu/Q==

rgb-regex@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1"
Expand Down

0 comments on commit bb413be

Please sign in to comment.