Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit b8acfa7

Browse files
authored
refactor: OPTIC-469: fflag_feat_front_lops_12_label_ops_ui_short removal (#306)
1 parent d93fbbf commit b8acfa7

File tree

3 files changed

+17
-66
lines changed

3 files changed

+17
-66
lines changed

Diff for: src/components/DataManager/DataManager.js

+17-43
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { inject, observer } from "mobx-react";
22
import React from "react";
33
import { LSPlus } from "../../assets/icons";
44
import { Block, Elem } from "../../utils/bem";
5-
import { FF_LOPS_12, isFF } from "../../utils/feature-flags";
65
import { Interface } from "../Common/Interface";
76
import { Space } from "../Common/Space/Space";
87
import { Spinner } from "../Common/Spinner";
@@ -21,27 +20,15 @@ const injector = inject(({ store }) => {
2120
});
2221

2322
const summaryInjector = inject(({ store }) => {
24-
const { project, taskStore, SDK } = store;
25-
26-
if (isFF(FF_LOPS_12) && SDK?.type === 'labelops') {
27-
return {
28-
total: taskStore?.total ?? 0,
29-
coverage: taskStore?.coverage ?? 'N/A',
30-
precision: taskStore?.precision ?? 'N/A',
31-
confidence: taskStore?.confidence ?? 'N/A',
32-
cloudSync: project.target_syncing ?? project.source_syncing ?? false,
33-
SDK,
34-
};
35-
} else {
36-
return {
37-
totalTasks: project?.task_count ?? project?.task_number ?? 0,
38-
totalFoundTasks: taskStore?.total ?? 0,
39-
totalAnnotations: taskStore?.totalAnnotations ?? 0,
40-
totalPredictions: taskStore?.totalPredictions ?? 0,
41-
cloudSync: project.target_syncing ?? project.source_syncing ?? false,
42-
};
43-
}
23+
const { project, taskStore } = store;
4424

25+
return {
26+
totalTasks: project?.task_count ?? project?.task_number ?? 0,
27+
totalFoundTasks: taskStore?.total ?? 0,
28+
totalAnnotations: taskStore?.totalAnnotations ?? 0,
29+
totalPredictions: taskStore?.totalPredictions ?? 0,
30+
cloudSync: project.target_syncing ?? project.source_syncing ?? false,
31+
};
4532
});
4633

4734
const switchInjector = inject(({ store }) => {
@@ -65,28 +52,15 @@ const ProjectSummary = summaryInjector((props) => {
6552
<Spinner size="small" />
6653
</Space>
6754
)}
68-
{isFF(FF_LOPS_12) && props.SDK?.type === 'labelops' ? (
69-
<span style={{ display: "flex", alignItems: "center", fontSize: 12 }}>
70-
<Space size="compact">
71-
<span>
72-
Total: {props.total}
73-
</span>
74-
<span>GT coverage: {props.coverage}</span>
75-
<span>Precision: {props.precision}</span>
76-
<span>Confidence: {props.confidence}</span>
77-
</Space>
78-
</span>
79-
) : (
80-
<span style={{ display: "flex", alignItems: "center", fontSize: 12 }}>
81-
<Space size="compact">
82-
<span>
83-
Tasks: {props.totalFoundTasks} / {props.totalTasks}
84-
</span>
85-
<span>Annotations: {props.totalAnnotations}</span>
86-
<span>Predictions: {props.totalPredictions}</span>
87-
</Space>
88-
</span>
89-
)}
55+
<span style={{ display: "flex", alignItems: "center", fontSize: 12 }}>
56+
<Space size="compact">
57+
<span>
58+
Tasks: {props.totalFoundTasks} / {props.totalTasks}
59+
</span>
60+
<span>Annotations: {props.totalAnnotations}</span>
61+
<span>Predictions: {props.totalPredictions}</span>
62+
</Space>
63+
</span>
9064
</Space>
9165
);
9266
});

Diff for: src/stores/Tabs/tab.js

-17
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { TabFilter } from "./tab_filter";
1414
import { TabHiddenColumns } from "./tab_hidden_columns";
1515
import { TabSelectedItems } from "./tab_selected_items";
1616
import { History } from '../../utils/history';
17-
import { FF_LOPS_12, isFF } from "../../utils/feature-flags";
1817
import { CustomJSON, StringOrNumberID, ThresholdType } from "../types";
1918
import { clamp } from "../../utils/helpers";
2019

@@ -396,8 +395,6 @@ export const Tab = types
396395
}
397396
if (self.virtual) {
398397
yield self.dataStore.reload({ query: self.query, interaction });
399-
} else if (isFF(FF_LOPS_12) && self.root.SDK?.type === 'labelops') {
400-
yield self.dataStore.reload({ query: self.query, interaction });
401398
}
402399

403400
getRoot(self).SDK?.invoke?.("tabReloaded", self);
@@ -437,20 +434,6 @@ export const Tab = types
437434
localStorage.setItem(`virtual-tab-${projectId}`, JSON.stringify(snapshot));
438435
}
439436

440-
History.navigate({ tab: self.key }, true);
441-
self.reload({ interaction });
442-
} else if (isFF(FF_LOPS_12) && self.root.SDK?.type === 'labelops') {
443-
const snapshot = self.serialize();
444-
445-
self.key = self.parent.snapshotToUrl(snapshot);
446-
447-
const projectId = self.root.SDK.projectId;
448-
449-
// Save the virtual tab of the project to local storage to persist between page navigations
450-
if (projectId) {
451-
localStorage.setItem(`virtual-tab-${projectId}`, JSON.stringify(snapshot));
452-
}
453-
454437
History.navigate({ tab: self.key }, true);
455438
self.reload({ interaction });
456439
} else {

Diff for: src/utils/feature-flags.js

-6
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ export const FF_DEV_3734 = 'fflag_fix_front_dev_3734_hide_task_counter_131222_sh
4040
*/
4141
export const FF_DEV_4008 = "feat_front_dev_4008_quick_task_open_short";
4242

43-
/**
44-
* Support for LabelOps functionality.
45-
* @link https://app.launchdarkly.com/default/branch/features/fflag_feat_front_lops_12_label_ops_ui_short
46-
*/
47-
export const FF_LOPS_12 = "fflag_feat_front_lops_12_label_ops_ui_short";
48-
4943
/**
5044
* Support for Datasets functionality.
5145
*/

0 commit comments

Comments
 (0)