Skip to content

Commit

Permalink
Merge pull request #43 from caponetto/RHOAIENG-13167
Browse files Browse the repository at this point in the history
RHOAIENG-13167: Fix Tags component style used by the Filter tools
  • Loading branch information
ederign authored Sep 20, 2024
2 parents efe3e85 + 0e41f0a commit 45bf7bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/metadata-common/src/FilterTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class FilterTools extends React.Component<
renderAppliedTag(tag: string, index: string): JSX.Element {
return (
<button
className={`${FILTER_TAG} tag applied-tag`}
className={`${FILTER_TAG} jp-CellTags-Tag jp-CellTags-Applied`}
id={'filter' + '-' + tag + '-' + index}
key={'filter' + '-' + tag + '-' + index}
title={tag}
Expand All @@ -132,7 +132,7 @@ export class FilterTools extends React.Component<
renderUnappliedTag(tag: string, index: string): JSX.Element {
return (
<button
className={`${FILTER_TAG} tag unapplied-tag`}
className={`${FILTER_TAG} jp-CellTags-Tag jp-CellTags-Unapplied`}
id={'filter' + '-' + tag + '-' + index}
key={'filter' + '-' + tag + '-' + index}
title={tag}
Expand Down Expand Up @@ -160,12 +160,12 @@ export class FilterTools extends React.Component<
currentTags: string[],
clickedTag: string
): string[] {
if (target.classList.contains('unapplied-tag')) {
target.classList.replace('unapplied-tag', 'applied-tag');
if (target.classList.contains('jp-CellTags-Unapplied')) {
target.classList.replace('jp-CellTags-Unapplied', 'jp-CellTags-Applied');

currentTags.splice(-1, 0, clickedTag);
} else if (target.classList.contains('applied-tag')) {
target.classList.replace('applied-tag', 'unapplied-tag');
} else if (target.classList.contains('jp-CellTags-Applied')) {
target.classList.replace('jp-CellTags-Applied', 'jp-CellTags-Unapplied');

const idx = currentTags.indexOf(clickedTag);
currentTags.splice(idx, 1);
Expand Down

0 comments on commit 45bf7bc

Please sign in to comment.