Skip to content

Commit

Permalink
refactor: OPTIC-1557: Remove Stale Feature Flag - fflag_fix_front_lsd…
Browse files Browse the repository at this point in the history
…v_4992_hide_all_regions_04052023_short
  • Loading branch information
luarmr committed Jan 23, 2025
1 parent 6e6afe6 commit 965e95f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 55 deletions.
1 change: 0 additions & 1 deletion label_studio/core/feature_flags/stale_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
'fflag_fix_front_lsdv_4988_dynamic_no_label_120523_short': True,
'fflag_fix_back_lsdv_4648_annotator_filter_29052023_short': True,
'fflag_feat_back_lsdv_5035_use_created_at_from_draft_for_annotation_256052023_short': True,
'fflag_fix_front_lsdv_4992_hide_all_regions_04052023_short': True,
'ff_back_dev_4664_remove_storage_file_on_export_delete_29032023_short': False,
'fflag_feat_front_lops_86_datasets_storage_edit_short': False,
'fflag_fix_back_lsdv_4929_limit_exports_10042023_short': True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { OutlinerTree } from "./OutlinerTree";
import { ViewControls } from "./ViewControls";
import "./OutlinerPanel.scss";
import { IconInfo } from "../../../assets/icons/outliner";
import { FF_LSDV_4992, FF_OUTLINER_OPTIM, isFF } from "../../../utils/feature-flags";
import { FF_OUTLINER_OPTIM, isFF } from "../../../utils/feature-flags";

interface OutlinerPanelProps extends PanelProps {
regions: any;
Expand All @@ -18,9 +18,8 @@ interface OutlinerTreeComponentProps {

const OutlinerFFClasses: string[] = [];

if (isFF(FF_LSDV_4992)) {
OutlinerFFClasses.push("ff_hide_all_regions");
}
OutlinerFFClasses.push("ff_hide_all_regions");

if (isFF(FF_OUTLINER_OPTIM)) {
OutlinerFFClasses.push("ff_outliner_optim");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
align-items: center;
grid-auto-flow: column;
grid-auto-columns: min-content;
grid-column-gap: 8px;
grid-column-gap: 4px;
background-color: var(--sand_0);
box-shadow: 0 1px 0 rgb(0 0 0 / 10%);

Expand Down Expand Up @@ -36,11 +36,13 @@
}

.button {
height: 40px;
font-size: 14px;
height: 24px;
font-size: 11px;
font-weight: 400;
padding: 0;
justify-content: flex-start;
white-space: nowrap;
box-shadow: none;

&_newUI {
font-size: 12px;
Expand All @@ -60,34 +62,23 @@
&:focus {
box-shadow: none;
}
}

&_FF_LSDV_4992 {
grid-column-gap: 4px;

.button {
height: 24px;
font-size: 11px;
white-space: nowrap;
box-shadow: none;

&:hover {
background: var(--sand_200);
border-radius: 4px;
}
&:hover {
background: var(--sand_200);
border-radius: 4px;
}

&[disabled] {
background-color: var(--sand_0);
color: var(--sand_400);
}
&[disabled] {
background-color: var(--sand_0);
color: var(--sand_400);
}

&_type_text {
padding: 0 2px !important;
}
&_type_text {
padding: 0 2px !important;
}

&.dropdown__trigger {
padding: 0 6px 0 2px;
}
&.dropdown__trigger {
padding: 0 6px 0 2px;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Menu } from "../../../common/Menu/Menu";
import { BemWithSpecifiContext } from "../../../utils/bem";
import { SidePanelsContext } from "../SidePanelsContext";
import "./ViewControls.scss";
import { FF_DEV_3873, FF_LSDV_4992, isFF } from "../../../utils/feature-flags";
import { FF_DEV_3873, isFF } from "../../../utils/feature-flags";
import { observer } from "mobx-react";

const { Block, Elem } = BemWithSpecifiContext();
Expand Down Expand Up @@ -56,14 +56,14 @@ export const ViewControls: FC<ViewControlsProps> = observer(
case "label":
return {
label: "Group by Label",
selectedLabel: isFF(FF_DEV_3873) ? (isFF(FF_LSDV_4992) ? "By Label" : "Label") : "Grouped by Label",
selectedLabel: isFF(FF_DEV_3873) ? "By Label" : "Grouped by Label",
icon: <IconTagAlt />,
tooltip: "Grouped by Label",
};
case "type":
return {
label: "Group by Tool",
selectedLabel: isFF(FF_DEV_3873) ? (isFF(FF_LSDV_4992) ? "By Tool" : "Tool") : "Grouped by Tool",
selectedLabel: isFF(FF_DEV_3873) ? "By Tool" : "Grouped by Tool",
icon: <IconCursor />,
tooltip: "Grouped by Tool",
};
Expand Down Expand Up @@ -95,7 +95,7 @@ export const ViewControls: FC<ViewControlsProps> = observer(
);

return (
<Block name="view-controls" mod={{ collapsed: context.locked, FF_LSDV_4992: isFF(FF_LSDV_4992) }}>
<Block name="view-controls" mod={{ collapsed: context.locked }}>
<Grouping
value={grouping}
options={["manual", "type", "label"]}
Expand All @@ -115,7 +115,7 @@ export const ViewControls: FC<ViewControlsProps> = observer(
/>
</Elem>
)}
{isFF(FF_LSDV_4992) ? <ToggleRegionsVisibilityButton regions={regions} /> : null}
<ToggleRegionsVisibilityButton regions={regions} />
</Block>
);
},
Expand Down Expand Up @@ -183,16 +183,7 @@ const Grouping = <T extends string>({

// mods are already set in the button from type, so use it only in new UI
const extraStyles = isFF(FF_DEV_3873) ? { mod: { newUI: true } } : undefined;
const style = isFF(FF_LSDV_4992)
? {}
: {
padding: "0",
whiteSpace: "nowrap",
};

if (isFF(FF_DEV_3873)) {
style.padding = "0 12px 0 2px";
}
const style = isFF(FF_DEV_3873) ? { padding: "0 12px 0 2px" } : {};

return (
<Dropdown.Trigger content={dropdownContent} style={{ width: 200 }}>
Expand Down
6 changes: 0 additions & 6 deletions web/libs/editor/src/utils/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ export const FF_LSDV_4988 = "fflag_fix_front_lsdv_4988_dynamic_no_label_120523_s
*/
export const FF_LSDV_4930 = "fflag_fix_front_lsdv_4930_selection_tool_fixes_240423_short";

/**
* Restore "hide all regions" button functionality in the outliner
* @link https://app.launchdarkly.com/default/production/features/fflag_fix_front_lsdv_4992_hide_all_regions_04052023_short
*/
export const FF_LSDV_4992 = "fflag_fix_front_lsdv_4992_hide_all_regions_04052023_short";

/**
* Resetting shared stores on task change to correctly generate dynamic children
* @see: fflag_fix_front_dev_3617_taxonomy_memory_leaks_fix: To enable shared store
Expand Down
1 change: 0 additions & 1 deletion web/libs/editor/tests/integration/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as FLAGS from "../../src/utils/feature-flags";
export const CURRENT_FLAGS = {
[FLAGS.FF_DEV_1170]: true,
[FLAGS.FF_LSDV_4930]: true,
[FLAGS.FF_LSDV_4992]: true,
[FLAGS.FF_DEV_2715]: true,
[FLAGS.FF_LSDV_4620_3]: true,
[FLAGS.FF_LSDV_4620_3_ML]: true,
Expand Down

0 comments on commit 965e95f

Please sign in to comment.