From e05f8f9eb0935a422fa06df53c88b5591b933ccb Mon Sep 17 00:00:00 2001 From: Raul Martin Date: Tue, 3 Dec 2024 09:13:30 -0800 Subject: [PATCH] refactor: LEAP-1291: Remove Stale Feature Flag - fflag_fix_front_lsdv_4988_dynamic_no_label_120523_short --- .../core/feature_flags/stale_feature_flags.py | 1 - .../src/stores/Annotation/Annotation.js | 27 ------------------- web/libs/editor/src/utils/feature-flags.ts | 3 --- 3 files changed, 31 deletions(-) diff --git a/label_studio/core/feature_flags/stale_feature_flags.py b/label_studio/core/feature_flags/stale_feature_flags.py index 5d7bb27c8b4b..64aab160125a 100644 --- a/label_studio/core/feature_flags/stale_feature_flags.py +++ b/label_studio/core/feature_flags/stale_feature_flags.py @@ -10,7 +10,6 @@ 'fflag_feat_front_lsdv_4620_outliner_optimization_310723_short': True, 'fflag_fix_front_lsdv_4600_lead_time_27072023_short': False, 'fflag_feat_front_lops_e_10_updated_ux_short': False, - '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_feat_front_lsdv_3025_outliner_filter_short': False, diff --git a/web/libs/editor/src/stores/Annotation/Annotation.js b/web/libs/editor/src/stores/Annotation/Annotation.js index 457db481d30a..01276c3d3623 100644 --- a/web/libs/editor/src/stores/Annotation/Annotation.js +++ b/web/libs/editor/src/stores/Annotation/Annotation.js @@ -16,7 +16,6 @@ import { FF_LLM_EPIC, FF_LSDV_3009, FF_LSDV_4583, - FF_LSDV_4988, FF_REVIEWER_FLOW, isFF, } from "../../utils/feature-flags"; @@ -1038,32 +1037,6 @@ const _Annotation = types for (let key of keys) { if (key.endsWith("labels")) { - const hasControlTag = tagNames.has(obj.from_name) || tagNames.has("labels"); - - // remove non-existent labels, it actually breaks dynamic labels - // and makes no reason overall — labels from predictions can be out of config - if (!isFF(FF_LSDV_4988) && hasControlTag) { - const labelsContainer = tagNames.get(obj.from_name) ?? tagNames.get("labels"); - const value = obj.value[key]; - - if (value && value.length && labelsContainer.type.endsWith("labels")) { - const filteredValue = value.filter((labelName) => !!labelsContainer.findLabel(labelName)); - const oldKey = key; - - key = key === labelsContainer.type ? key : labelsContainer.type; - - if (oldKey !== key) { - obj.type = key; - obj.value[key] = obj.value[oldKey]; - delete obj.value[oldKey]; - } - - if (filteredValue.length !== value.length) { - obj.value[key] = filteredValue; - } - } - } - // detect most relevant label tags if that one from from_name is missing // can be useful for predictions in old format with config in new format: // Rectangle + Labels -> RectangleLabels diff --git a/web/libs/editor/src/utils/feature-flags.ts b/web/libs/editor/src/utils/feature-flags.ts index 67147b46b2fa..d5d11a08b3fc 100644 --- a/web/libs/editor/src/utils/feature-flags.ts +++ b/web/libs/editor/src/utils/feature-flags.ts @@ -196,9 +196,6 @@ export const FF_LSDV_4712 = "fflag_feat_front_lsdv_4712_skipduplicates_editing_1 */ export const FF_LSDV_4881 = "fflag_fix_front_lsdv_4881_timeseries_points_missing_140423_short"; -/** Fix "No Label" for Dynamic Labels by switching off missing labels removal */ -export const FF_LSDV_4988 = "fflag_fix_front_lsdv_4988_dynamic_no_label_120523_short"; - /** * Fixing issues related to selection tool functional (selecting hidden regions, onClick in Konva, interaction with regions inside selection area) *