Skip to content

Commit 1e93c38

Browse files
committed
Removes gates
1 parent dc3eca7 commit 1e93c38

File tree

12 files changed

+53
-208
lines changed

12 files changed

+53
-208
lines changed

src/components/projects/projectId/settings/GatesIntegration.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/components/projects/projectId/settings/GatesIntegrationWarningModal.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/components/projects/projectId/settings/ProjectSettings.tsx

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useDispatch, useSelector } from "react-redux";
22
import DataSchema from "./DataSchema";
33
import { selectProject, setActiveProject } from "@/src/reduxStore/states/project";
44
import { useCallback, useEffect, useState } from "react";
5-
import { selectAttributes, selectEmbeddings, selectGatesIntegration, setAllAttributes, setAllEmbeddings, setAllRecommendedEncodersDict, setGatesIntegration, setLabelingTasksAll, setRecommendedEncodersAll } from "@/src/reduxStore/states/pages/settings";
5+
import { selectAttributes, selectEmbeddings, setAllAttributes, setAllEmbeddings, setAllRecommendedEncodersDict, setLabelingTasksAll, setRecommendedEncodersAll } from "@/src/reduxStore/states/pages/settings";
66
import { timer } from "rxjs";
77
import { IconCamera, IconCheck, IconDots, IconPlus, IconUpload } from "@tabler/icons-react";
88
import { ModalEnum } from "@/src/types/shared/modal";
@@ -12,7 +12,6 @@ import { setUploadFileType } from "@/src/reduxStore/states/upload";
1212
import { UploadFileType } from "@/src/types/shared/upload";
1313
import { Tooltip } from "@nextui-org/react";
1414
import ProjectMetaData from "./ProjectMetaData";
15-
import GatesIntegration from "./GatesIntegration";
1615
import { selectAllUsers, selectIsManaged, selectOrganizationId, setBricksIntegrator, setComments } from "@/src/reduxStore/states/general";
1716
import Embeddings from "./embeddings/Embeddings";
1817
import { postProcessingEmbeddings, postProcessingRecommendedEncoders } from "@/src/util/components/projects/projectId/settings/embeddings-helper";
@@ -28,7 +27,7 @@ import ProjectSnapshotExportModal from "./ProjectSnapshotExportModal";
2827
import { postProcessLabelingTasks, postProcessLabelingTasksSchema } from "@/src/util/components/projects/projectId/settings/labeling-tasks-helper";
2928
import { getEmptyBricksIntegratorConfig } from "@/src/util/shared/bricks-integrator-helper";
3029
import { useWebsocket } from "@/submodules/react-components/hooks/web-socket/useWebsocket";
31-
import { getGatesIntegrationData, getLabelingTasksByProjectId, getProjectByProjectId, getProjectTokenization } from "@/src/services/base/project";
30+
import { getLabelingTasksByProjectId, getProjectByProjectId, getProjectTokenization } from "@/src/services/base/project";
3231
import { getAllComments } from "@/src/services/base/comment";
3332
import { getAttributes, getCheckCompositeKey } from "@/src/services/base/attribute";
3433
import { getEmbeddings, getRecommendedEncoders } from "@/src/services/base/embedding";
@@ -41,10 +40,8 @@ export default function ProjectSettings() {
4140

4241
const project = useSelector(selectProject);
4342
const attributes = useSelector(selectAttributes);
44-
const isManaged = useSelector(selectIsManaged);
4543
const embeddings = useSelector(selectEmbeddings);
4644
const allUsers = useSelector(selectAllUsers);
47-
const gatesIntegrationData = useSelector(selectGatesIntegration);
4845

4946
const [pKeyValid, setPKeyValid] = useState<boolean | null>(null);
5047
const [pKeyCheckTimer, setPKeyCheckTimer] = useState(null);
@@ -56,7 +53,6 @@ export default function ProjectSettings() {
5653
if (!project) return;
5754
refetchAttributesAndPostProcess();
5855
refetchEmbeddingsAndPostProcess();
59-
refetchAndSetGatesIntegrationData();
6056
refetchLabelingTasksAndProcess();
6157
checkProjectTokenization();
6258

@@ -228,33 +224,12 @@ export default function ProjectSettings() {
228224
});
229225
if (msgParts[2] == 'finished') timer(5000).subscribe(() => checkProjectTokenization());
230226
}
231-
} else if (msgParts[1] == 'gates_integration') {
232-
refetchAndSetGatesIntegrationData();
233-
} else if (['information_source_deleted', 'information_source_updated'].includes(msgParts[1])) {
234-
if (gatesIntegrationData?.missingInformationSources?.includes(msgParts[2])) {
235-
refetchAndSetGatesIntegrationData();
236-
}
237-
} else if (msgParts[1] == 'tokenization' && msgParts[2] == 'docbin' && msgParts[3] == 'state' && msgParts[4] == 'FINISHED') {
238-
refetchAndSetGatesIntegrationData();
239-
} else if (msgParts[1] == 'embedding' && msgParts[3] == 'state' && msgParts[4] == 'FINISHED') {
240-
if (gatesIntegrationData?.missingEmbeddings?.includes(msgParts[2])) {
241-
refetchAndSetGatesIntegrationData();
242-
}
243227
} else if (msgParts[1] == 'embedding_deleted') {
244-
if (gatesIntegrationData?.missingEmbeddings?.includes(msgParts[2])) {
245-
refetchAndSetGatesIntegrationData();
246-
}
247228
refetchEmbeddingsAndPostProcess();
248229
} else if (['label_created', 'label_deleted', 'labeling_task_deleted', 'labeling_task_updated', 'labeling_task_created'].includes(msgParts[1])) {
249230
refetchLabelingTasksAndProcess();
250231
}
251-
}, [project, embeddings, gatesIntegrationData, isAcRunning, tokenizationProgress]);
252-
253-
function refetchAndSetGatesIntegrationData() {
254-
getGatesIntegrationData(project.id, (res) => {
255-
dispatch(setGatesIntegration(res.data['getGatesIntegrationData']));
256-
})
257-
}
232+
}, [project, embeddings, isAcRunning, tokenizationProgress]);
258233

259234
function refetchLabelingTasksAndProcess() {
260235
getLabelingTasksByProjectId(project.id, (res) => {
@@ -326,7 +301,6 @@ export default function ProjectSettings() {
326301

327302
<Embeddings refetchEmbeddings={refetchEmbeddingsAndPostProcess} />
328303
<LabelingTasks />
329-
{isManaged && <GatesIntegration />}
330304
<ProjectMetaData />
331305
<CreateNewAttributeModal />
332306
<ProjectSnapshotExportModal ></ProjectSnapshotExportModal>

src/components/shared/sidebar/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export default function Sidebar() {
217217
</div>}
218218

219219
{isManaged && <div className="flex items-center justify-center mt-4">
220-
<AppSelectionDropdown cockpit={true} gates={true}></AppSelectionDropdown>
220+
<AppSelectionDropdown cockpit={true} cognition={true}></AppSelectionDropdown>
221221
</div>}
222222

223223
<div className="flex-shrink-0 flex pt-3 justify-center">

src/components/shared/statuses/Statuses.tsx

Lines changed: 47 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,53 @@ export default function Statuses({ status, tooltipPosition = DEFAULT_TOOLTIP_POS
1010
const [color, setColor] = useState('');
1111

1212
useEffect(() => {
13-
if (page == 'gates-integrator') {
14-
switch (status) {
15-
case Status.READY:
16-
setStatusName('Ready to use');
17-
setColor('green');
18-
break;
19-
case Status.UPDATING:
20-
setStatusName('Updating');
21-
setColor('yellow');
22-
break;
23-
case Status.NOT_READY:
24-
setStatusName('Not ready');
25-
setColor('red');
26-
break;
27-
}
28-
} else {
29-
switch (status) {
30-
case Status.CREATED:
31-
case Status.RUNNING:
32-
setDataTip(page === 'heuristics' ? 'Heuristic is currently being executed.' : 'Attribute is being calculated.');
33-
setStatusName('Running');
34-
setColor('yellow');
35-
break;
36-
case Status.STARTED:
37-
setDataTip('Annotator has started labeling');
38-
setStatusName('Started');
39-
setColor('yellow');
40-
break;
41-
case Status.FINISHED:
42-
setDataTip('Heuristic was successfully executed.');
43-
setStatusName('Finished');
44-
setColor('green');
45-
break;
46-
case Status.FAILED:
47-
setDataTip((page === 'heuristics' ? 'Heuristic' : 'Attribute') + ' ran into errors.');
48-
setStatusName('Error');
49-
setColor('red');
50-
break;
51-
case Status.USABLE:
52-
setDataTip('Attribute can be used');
53-
setStatusName('Usable');
54-
setColor('green');
55-
break;
56-
case Status.UPLOADED:
57-
setDataTip('Attribute was uploaded');
58-
setStatusName('Uploaded');
59-
setColor('indigo');
60-
break;
61-
case Status.AUTOMATICALLY_CREATED:
62-
setDataTip('Created during the upload process');
63-
setStatusName('Auto. created');
64-
setColor('indigo');
65-
break;
66-
case Status.QUEUED:
67-
setDataTip('Task is queued for processing');
68-
setStatusName('Queued');
69-
setColor('gray');
70-
break;
71-
default:
72-
setDataTip((page === 'heuristics' ? 'Heuristic' : 'Attribute') + ' was successfully registered.');
73-
setStatusName(initialCaption);
74-
setColor('gray');
75-
break;
76-
}
13+
switch (status) {
14+
case Status.CREATED:
15+
case Status.RUNNING:
16+
setDataTip(page === 'heuristics' ? 'Heuristic is currently being executed.' : 'Attribute is being calculated.');
17+
setStatusName('Running');
18+
setColor('yellow');
19+
break;
20+
case Status.STARTED:
21+
setDataTip('Annotator has started labeling');
22+
setStatusName('Started');
23+
setColor('yellow');
24+
break;
25+
case Status.FINISHED:
26+
setDataTip('Heuristic was successfully executed.');
27+
setStatusName('Finished');
28+
setColor('green');
29+
break;
30+
case Status.FAILED:
31+
setDataTip((page === 'heuristics' ? 'Heuristic' : 'Attribute') + ' ran into errors.');
32+
setStatusName('Error');
33+
setColor('red');
34+
break;
35+
case Status.USABLE:
36+
setDataTip('Attribute can be used');
37+
setStatusName('Usable');
38+
setColor('green');
39+
break;
40+
case Status.UPLOADED:
41+
setDataTip('Attribute was uploaded');
42+
setStatusName('Uploaded');
43+
setColor('indigo');
44+
break;
45+
case Status.AUTOMATICALLY_CREATED:
46+
setDataTip('Created during the upload process');
47+
setStatusName('Auto. created');
48+
setColor('indigo');
49+
break;
50+
case Status.QUEUED:
51+
setDataTip('Task is queued for processing');
52+
setStatusName('Queued');
53+
setColor('gray');
54+
break;
55+
default:
56+
setDataTip((page === 'heuristics' ? 'Heuristic' : 'Attribute') + ' was successfully registered.');
57+
setStatusName(initialCaption);
58+
setColor('gray');
59+
break;
7760
}
7861
}, [status, page]);
7962

src/reduxStore/states/modal.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ const initialState: Modals = {
4646
[ModalEnum.PROJECT_SNAPSHOT]: {
4747
open: false,
4848
},
49-
[ModalEnum.GATES_INTEGRATION_WARNING]: {
50-
open: false,
51-
},
5249
[ModalEnum.FILTERED_ATTRIBUTES]: {
5350
open: false,
5451
embeddingId: '',

src/reduxStore/states/pages/settings.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type SettingsState = {
2525
labelingTasks: {
2626
all: LabelingTask[];
2727
},
28-
gatesIntegration: any;
2928
}
3029

3130
function getInitState(): SettingsState {
@@ -46,7 +45,6 @@ function getInitState(): SettingsState {
4645
labelingTasks: {
4746
all: null
4847
},
49-
gatesIntegration: null
5048
};
5149
}
5250

@@ -124,10 +122,6 @@ const settingsSlice = createSlice({
124122
};
125123
}
126124
},
127-
setGatesIntegration(state, action: PayloadAction<any>) {
128-
if (action.payload) state.gatesIntegration = action.payload;
129-
else state.gatesIntegration = null;
130-
}
131125
}
132126
});
133127

@@ -137,7 +131,6 @@ export const selectUseableEmbedableAttributes = (state) => state.settings.attrib
137131
export const selectUsableNonTextAttributes = (state) => state.settings.attributes.useableNonTextAttributes;
138132
export const selectUsableAttributes = (state) => state.settings.attributes.usableAttributes;
139133
export const selectTextAttributes = (state) => state.settings.attributes.usableTextAttributes;
140-
export const selectGatesIntegration = (state) => state.settings.gatesIntegration;
141134

142135
export const selectEmbeddings = (state) => state.settings.embeddings.all;
143136
export const selectEmbeddingsFiltered = (state) => state.settings.embeddings.filtered;
@@ -156,5 +149,5 @@ export const selectVisibleAttributeAC = createSelector([selectUsableAttributesFi
156149
export const selectVisibleAttributesHeuristics = createSelector([selectUsableAttributesFiltered], (a): any => a ? a.filter((a) => a.visibility != AttributeVisibility.HIDE) : null);
157150
export const selectOnAttributeEmbeddings = createSelector([selectEmbeddings], (a): any => a ? a.filter((embedding) => embedding.type == EmbeddingType.ON_ATTRIBUTE && embedding.state == Status.FINISHED) : null);
158151

159-
export const { setAllAttributes, extendAllAttributes, removeFromAllAttributesById, updateAttributeById, setAllEmbeddings, setFilteredEmbeddings, removeFromAllEmbeddingsById, setAllRecommendedEncodersDict, setRecommendedEncodersAll, setLabelingTasksAll, removeFromAllLabelingTasksById, removeLabelFromLabelingTask, setGatesIntegration } = settingsSlice.actions;
152+
export const { setAllAttributes, extendAllAttributes, removeFromAllAttributesById, updateAttributeById, setAllEmbeddings, setFilteredEmbeddings, removeFromAllEmbeddingsById, setAllRecommendedEncodersDict, setRecommendedEncodersAll, setLabelingTasksAll, removeFromAllLabelingTasksById, removeLabelFromLabelingTask } = settingsSlice.actions;
160153
export const settingsReducer = settingsSlice.reducer;

src/services/base/project-setting.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ export function updateAttribute(projectId: string, attributeId: string, onResult
6363
jsonFetchWrapper(finalUrl, FetchType.POST, onResult, JSON.stringify(convertCamelToSnakeCase({ attributeId, dataType, isPrimaryKey, name, sourceCode, visibility })));
6464
}
6565

66-
export function updateProjectGates(projectId: string, onResult: (result: any) => void) {
67-
const finalUrl = `${projectSettingEndpoint}/${projectId}/update-project-gates`;
68-
jsonFetchWrapper(finalUrl, FetchType.POST, onResult);
69-
}
70-
7166
export function calculateUserAttributeAllRecordsPost(projectId: string, options: {
7267
attributeId: string
7368
}, onResult: (result: any) => void) {

src/services/base/project.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ export function getLabelDistribution(projectId: string, labelingTaskId: string |
103103
jsonFetchWrapper(finalUrl, FetchType.GET, onResult);
104104
}
105105

106-
export function getGatesIntegrationData(projectId: string, onResult: (result: any) => void) {
107-
const finalUrl = `${projectEndpoint}/${projectId}/gates-integration-data`;
108-
jsonFetchWrapper(finalUrl, FetchType.GET, onResult);
109-
}
110106

111107
export function getProjectTokenization(projectId: string, onResult: (result: any) => void) {
112108
const finalUrl = `${projectEndpoint}/${projectId}/project-tokenization`;

src/types/shared/modal.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export enum ModalEnum {
2323
HOW_TO_UPDATE = "HOW_TO_UPDATE",
2424
CREATE_NEW_ATTRIBUTE = "CREATE_NEW_ATTRIBUTE",
2525
PROJECT_SNAPSHOT = "PROJECT_SNAPSHOT",
26-
GATES_INTEGRATION_WARNING = "GATES_INTEGRATION_WARNING",
2726
FILTERED_ATTRIBUTES = "FILTERED_ATTRIBUTES",
2827
ADD_EMBEDDING = "ADD_EMBEDDING",
2928
DELETE_EMBEDDING = "DELETE_EMBEDDING",

0 commit comments

Comments
 (0)