Skip to content

Commit ede8247

Browse files
lumburovskalinaLennartSchmidtKernJWittmeyer
authored
Hotfix release (#11)
* redirect logic on label task deletion/heursitic deletion * attribute calculation progress not parsed correctly * Crowd labeler details page → status * Project deleted notification with multiple users * Similarity search display fixes * Filtered attribute specific embeddings for similarity search and outlier slice * Loading indicator missing for sync with backend on record change * Text center for ac modal * Project snapshot export doesnt return fix * Sample projects navigation issue fix * Embeddings in creation not displayed for outliers and similarity search and progress for heursitics displayed correctlye * Record IDE reload and labeling page navigation fixes * Small fix on hovering * Fixed issue for azure embeddings * Azure url,versions and engines duplicate fix * REmvoes bracket for tranferred tokenizer value * Forces uploadtype for none button changes --------- Co-authored-by: Lennart Schmidt <[email protected]> Co-authored-by: JWittmeyer <[email protected]>
1 parent abf412b commit ede8247

File tree

30 files changed

+133
-80
lines changed

30 files changed

+133
-80
lines changed

src/components/projects/SampleProjectsDropdown.tsx

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { Fragment, useCallback, useEffect, useState } from 'react'
1+
import { Fragment, useCallback, useEffect, useRef, useState } from 'react'
22
import { Menu, Transition } from '@headlessui/react'
33
import { ChevronDownIcon } from '@heroicons/react/20/solid'
44
import { useMutation } from '@apollo/client';
55
import { useRouter } from 'next/router';
66
import { useDispatch, useSelector } from 'react-redux';
7-
import { extendAllProjects, selectAllProjects, updateProjectState } from '@/src/reduxStore/states/project';
7+
import { selectAllProjects } from '@/src/reduxStore/states/project';
88
import { ModalButton, ModalEnum } from '@/src/types/shared/modal';
99
import { closeModal, openModal } from '@/src/reduxStore/states/modal';
1010
import Modal from '../shared/modal/Modal';
1111
import { IconAlertTriangle, IconFishHook, IconMessageCircle, IconNews } from '@tabler/icons-react';
1212
import { CREATE_SAMPLE_PROJECT } from '@/src/services/gql/mutations/projects';
13-
import { ProjectStatus } from '@/src/types/components/projects/projects-list';
1413
import { setSearchGroupsStore } from '@/src/reduxStore/states/pages/data-browser';
14+
import { selectProjectIdSampleProject, setProjectIdSampleProject } from '@/src/reduxStore/states/tmp';
1515

1616
const ACCEPT_BUTTON = { buttonCaption: "Create", closeAfterClick: false, useButton: true, disabled: true };
1717

@@ -20,10 +20,11 @@ export default function SampleProjectsDropdown() {
2020
const dispatch = useDispatch();
2121

2222
const projects = useSelector(selectAllProjects);
23+
const tmpProjectIdSample = useSelector(selectProjectIdSampleProject);
2324

24-
const [projectNameInput, setProjectNameInput] = useState<string>("");
25-
const [projectTypeInput, setProjectTypeInput] = useState<string>("");
26-
const [projectNameExists, setProjectNameExists] = useState<boolean>(false);
25+
const [projectNameInput, setProjectNameInput] = useState("");
26+
const [projectTypeInput, setProjectTypeInput] = useState("");
27+
const [projectNameExists, setProjectNameExists] = useState(false);
2728

2829
const [createSampleProjectMut] = useMutation(CREATE_SAMPLE_PROJECT);
2930

@@ -38,23 +39,14 @@ export default function SampleProjectsDropdown() {
3839
}
3940
const projectNameFinal = projectName && projectName ? projectName : projectNameInput;
4041
const projectTypeFinal = projectType ? projectType : projectTypeInput;
41-
const projectSample = {
42-
name: projectNameFinal,
43-
id: "sample",
44-
status: ProjectStatus.INIT_SAMPLE_PROJECT
45-
}
46-
dispatch(extendAllProjects(projectSample));
4742
dispatch(closeModal(ModalEnum.SAMPLE_PROJECT_TITLE));
4843
dispatch(setSearchGroupsStore({}));
4944
createSampleProjectMut({ variables: { name: projectNameFinal, projectType: projectTypeFinal } }).then((res) => {
50-
const projectUpdated = res.data.createSampleProject['project'];
51-
dispatch(updateProjectState('sample', { ...projectUpdated }));
5245
dispatch(closeModal(ModalEnum.SAMPLE_PROJECT_TITLE));
53-
if (router.pathname.includes("/projects")) {
54-
router.push(`/projects/${projectUpdated.id}/overview`);
55-
}
46+
const projectId = res['data']['createSampleProject']['project'].id;
47+
dispatch(setProjectIdSampleProject(projectId));
5648
});
57-
}, []);
49+
}, [projects, projectNameInput, projectTypeInput, router]);
5850

5951
const [acceptButton, setAcceptButton] = useState<ModalButton>(ACCEPT_BUTTON);
6052

@@ -70,6 +62,18 @@ export default function SampleProjectsDropdown() {
7062
setAcceptButton({ ...acceptButton, emitFunction: () => importSampleProject(projectNameInput, projectTypeInput) });
7163
}, [projectNameInput]);
7264

65+
useEffect(() => {
66+
if (tmpProjectIdSample) {
67+
router.push(`/projects/${tmpProjectIdSample}/overview`);
68+
}
69+
}, [tmpProjectIdSample]);
70+
71+
useEffect(() => {
72+
return () => {
73+
dispatch(setProjectIdSampleProject(null));
74+
}
75+
}, []);
76+
7377
return (
7478
<Menu as="div" className="relative inline-block text-left">
7579
<div>

src/components/projects/new/NewProject.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
import { UploadFileType, UploadOptions } from "@/src/types/shared/upload";
22
import { useEffect, useState } from "react";
33
import { useDispatch, useSelector } from "react-redux";
4-
import { setUploadFileType } from "@/src/reduxStore/states/upload";
4+
import { selectUploadData, setUploadFileType } from "@/src/reduxStore/states/upload";
55
import Upload from "../../shared/upload/Upload";
66
import { CacheEnum, selectCachedValue } from "@/src/reduxStore/states/cachedValues";
77
import { setAllProjects } from "@/src/reduxStore/states/project";
88
import { useLazyQuery } from "@apollo/client";
99
import { GET_PROJECT_LIST } from "@/src/services/gql/queries/projects";
1010

1111
const UPLOAD_OPTION = { deleteProjectOnFail: true, tokenizerValues: [] };
12-
12+
const COMPONENT_FILE_TYPE = UploadFileType.RECORDS_NEW;
1313
export default function NewProject() {
1414
const dispatch = useDispatch();
15-
15+
const currentFileType = useSelector(selectUploadData).uploadFileType;
1616
const tokenizerValues = useSelector(selectCachedValue(CacheEnum.TOKENIZER_VALUES));
1717

1818
const [uploadOptions, setUploadOptions] = useState<UploadOptions>(UPLOAD_OPTION);
1919

2020
const [refetchProjects] = useLazyQuery(GET_PROJECT_LIST, { fetchPolicy: "no-cache" });
2121

2222
useEffect(() => {
23-
dispatch(setUploadFileType(UploadFileType.RECORDS_NEW));
23+
dispatch(setUploadFileType(COMPONENT_FILE_TYPE));
2424
refetchProjects().then((res) => {
2525
const projects = res.data["allProjects"].edges.map((edge: any) => edge.node);
2626
dispatch(setAllProjects(projects));
2727
});
2828
}, []);
2929

30+
useEffect(() => {
31+
if (!currentFileType || currentFileType == COMPONENT_FILE_TYPE) return;
32+
dispatch(setUploadFileType(COMPONENT_FILE_TYPE));
33+
}, [currentFileType]);
34+
3035
useEffect(() => {
3136
setUploadOptions({ ...UPLOAD_OPTION, tokenizerValues });
3237
}, [tokenizerValues]);

src/components/projects/projectId/attributes/attributeId/AttributeCalculations.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export default function AttributeCalculation() {
444444
<Tooltip content={TOOLTIPS_DICT.ATTRIBUTE_CALCULATION.BEING_EXECUTED} color="invert" placement="right" className="relative z-10 cursor-auto"><LoadingIcon /></Tooltip>
445445
<div className="text-sm leading-5 font-normal text-gray-500 w-full">
446446
<div className="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700">
447-
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': currentAttribute.progress + '%' }}>
447+
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': (currentAttribute.progress * 100) + '%' }}>
448448
</div>
449449
</div>
450450
</div>

src/components/projects/projectId/data-browser/DataBrowserRecords.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default function DataBrowserRecords(props: DataBrowserRecordsProps) {
3030
const additionalData = useSelector(selectAdditionalData);
3131
const activeSearchParams = useSelector(selectActiveSearchParams);
3232
const attributes = useSelector(selectVisibleAttributesHeuristics);
33+
const recordsInDisplay = useSelector(selectSimilaritySearch).recordsInDisplay;
3334

3435
useEffect(() => {
3536
router.events.on("routeChangeStart", clearFilters);
@@ -84,6 +85,7 @@ export default function DataBrowserRecords(props: DataBrowserRecordsProps) {
8485
}
8586

8687
function refetchMoreRecords(e: any) {
88+
if (recordsInDisplay) return;
8789
if (e.target.offsetHeight + e.target.scrollTop >= e.target.scrollHeight) {
8890
props.refetchNextRecords();
8991
}

src/components/projects/projectId/data-browser/SearchGroups.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default function SearchGroups() {
115115
useEffect(() => {
116116
if (!user || !activeSearchParams || !labelingTasks || !attributes) return;
117117
if (!fullSearchStore || fullSearchStore[SearchGroup.DRILL_DOWN] == undefined) return;
118+
if (recordsInDisplay) return;
118119
refreshTextHighlightNeeded();
119120
setHighlightingToRecords();
120121
if (activeSlice && activeSlice.static) {

src/components/projects/projectId/data-browser/modals/CreateOutlierSliceModal.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Modal from "@/src/components/shared/modal/Modal";
22
import { selectActiveSearchParams, selectSimilaritySearch } from "@/src/reduxStore/states/pages/data-browser";
3-
import { selectEmbeddings } from "@/src/reduxStore/states/pages/settings";
3+
import { selectEmbeddings, selectOnAttributeEmbeddings } from "@/src/reduxStore/states/pages/settings";
44
import { selectProjectId } from "@/src/reduxStore/states/project";
55
import { CREATE_OUTLIER_SLICE } from "@/src/services/gql/mutations/data-browser";
66
import { Embedding } from "@/src/types/components/projects/projectId/settings/embeddings";
@@ -18,14 +18,14 @@ export default function CreateOutlierSliceModal() {
1818
const activeSearchParams = useSelector(selectActiveSearchParams);
1919
const similaritySearch = useSelector(selectSimilaritySearch);
2020
const embeddings = useSelector(selectEmbeddings);
21+
const onAttributeEmbeddings = useSelector(selectOnAttributeEmbeddings);
2122

2223
const [selectedEmbedding, setSelectedEmbedding] = useState<Embedding>(null);
2324
const [acceptButton, setAcceptButton] = useState<ModalButton>(ACCEPT_BUTTON);
2425

2526
const [createOutlierSliceMut] = useMutation(CREATE_OUTLIER_SLICE);
2627

2728
const requestOutlierSlice = useCallback(() => {
28-
// const embeddingId = embeddings.find((embedding) => embedding.name == selectedEmbedding).id;
2929
createOutlierSliceMut({ variables: { projectId: projectId, embeddingId: selectedEmbedding.id } }).then((res) => { });
3030
}, [selectedEmbedding]);
3131

@@ -38,6 +38,6 @@ export default function CreateOutlierSliceModal() {
3838
{(activeSearchParams.length > 0 || similaritySearch.recordsInDisplay) && <div className="text-red-500 mb-2 flex flex-grow justify-center text-sm">
3939
Warning: your current filter selection will be removed!</div>}
4040

41-
<Dropdown2 options={embeddings} buttonName={selectedEmbedding ? selectedEmbedding.name : 'Select embedding'} selectedOption={(option: any) => setSelectedEmbedding(option)} />
41+
<Dropdown2 options={onAttributeEmbeddings} buttonName={selectedEmbedding ? selectedEmbedding.name : 'Select embedding'} selectedOption={(option: any) => setSelectedEmbedding(option)} />
4242
</Modal>)
4343
}

src/components/projects/projectId/data-browser/modals/SimilaritySeachModal.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Modal from "@/src/components/shared/modal/Modal";
22
import { selectModal } from "@/src/reduxStore/states/modal";
33
import { selectActiveSearchParams, selectSimilaritySearch, selectUniqueValuesDict, setRecordsInDisplay, setSearchRecordsExtended } from "@/src/reduxStore/states/pages/data-browser";
4-
import { selectEmbeddings, selectLabelingTasksAll, selectUsableAttributes } from "@/src/reduxStore/states/pages/settings";
4+
import { selectEmbeddings, selectLabelingTasksAll, selectOnAttributeEmbeddings, selectUsableAttributes } from "@/src/reduxStore/states/pages/settings";
55
import { selectProjectId } from "@/src/reduxStore/states/project";
66
import { SEARCH_SIMILAR_RECORDS } from "@/src/services/gql/queries/data-browser";
77
import { FilterIntegrationOperator, SearchOperator } from "@/src/types/components/projects/projectId/data-browser/search-operators";
@@ -33,6 +33,7 @@ export default function SimilaritySearchModal() {
3333
const projectId = useSelector(selectProjectId);
3434
const labelingTasks = useSelector(selectLabelingTasksAll);
3535
const uniqueValuesDict = useSelector(selectUniqueValuesDict);
36+
const onAttributeEmbeddings = useSelector(selectOnAttributeEmbeddings);
3637

3738
const [filterAttributesSS, setFilterAttributesSS] = useState<any>(null);
3839
const [filterAttributesForm, setFilterAttributesForm] = useState<any>([]);
@@ -162,7 +163,7 @@ export default function SimilaritySearchModal() {
162163
<div className="flex flex-grow justify-center text-lg leading-6 text-gray-900 font-medium">Select embedding for similarity search </div>
163164
{(activeSearchParams.length > 0 || similaritySearch.recordsInDisplay) && <div className="text-red-500 mb-2 flex flex-grow justify-center text-sm">Warning: your current filter selection will be removed!</div>}
164165

165-
<Dropdown2 options={embeddings} buttonName={selectedEmbedding ? selectedEmbedding.name : 'Select embedding'} selectedOption={(value) => setSelectedEmbedding(value)} dropdownClasses="my-2" />
166+
<Dropdown2 options={onAttributeEmbeddings} buttonName={selectedEmbedding ? selectedEmbedding.name : 'Select embedding'} selectedOption={(value) => setSelectedEmbedding(value)} dropdownClasses="my-2" />
166167

167168
{filterAttributesSS && filterAttributesSS.length > 0 && <div className="flex flex-col justify-start mt-4">
168169
<div className="pr-2 bg-white text-md font-medium text-gray-900">Filter attributes</div>

src/components/projects/projectId/edit-records/SyncRecordsModal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default function SyncRecordsModal(props: SyncRecordsModalProps) {
2727
const erdDataCopy = { ...props.erdData };
2828
erdDataCopy.syncing = true;
2929
erdDataCopy.errors = null;
30+
props.setErdData(erdDataCopy);
3031
const changes = jsonCopy(erdDataCopy.cachedRecordChanges);
3132
for (const key in changes) delete changes[key].display;
3233
syncChangesMut({ variables: { projectId: projectId, changes: JSON.stringify(changes) } }).then((res) => {

src/components/projects/projectId/heuristics/heuristicId/active-learning/ActiveLearning.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ export default function ActiveLearning() {
185185
if (!currentHeuristic) return;
186186
if (['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted'].includes(msgParts[1])) {
187187
refetchLabelingTasksAndProcess();
188-
} else if ('labeling_task_deleted' == msgParts[1]) {
188+
} else if ('labeling_task_deleted' == msgParts[1] && msgParts[2] == currentHeuristic.labelingTaskId) {
189189
alert('Parent labeling task was deleted!');
190190
router.push(`/projects/${projectId}/heuristics`);
191-
} else if ('information_source_deleted' == msgParts[1]) {
191+
} else if ('information_source_deleted' == msgParts[1] && msgParts[2] == currentHeuristic.id) {
192192
alert('Information source was deleted!');
193193
router.push(`/projects/${projectId}/heuristics`);
194194
} else if (['information_source_updated', 'model_callback_update_statistics'].includes(msgParts[1])) {

src/components/projects/projectId/heuristics/heuristicId/crowd-labeler/CrowdLabeler.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ export default function CrowdLabeler() {
109109
if (!currentHeuristic) return;
110110
if (['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted'].includes(msgParts[1])) {
111111
refetchLabelingTasksAndProcess();
112-
} else if ('labeling_task_deleted' == msgParts[1]) {
112+
} else if ('labeling_task_deleted' == msgParts[1] && currentHeuristic.id == msgParts[2]) {
113113
alert('Parent labeling task was deleted!');
114114
router.push(`/projects/${projectId}/heuristics`);
115-
} else if ('information_source_deleted' == msgParts[1]) {
115+
} else if ('information_source_deleted' == msgParts[1] && currentHeuristic.id == msgParts[2]) {
116116
alert('Information source was deleted!');
117117
router.push(`/projects/${projectId}/heuristics`);
118118
} else if (['information_source_updated', 'model_callback_update_statistics'].includes(msgParts[1])) {

src/components/projects/projectId/heuristics/heuristicId/labeling-function/CalculationProgress.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function CalculationProgress() {
2929
<div className="text-sm leading-5 font-normal text-gray-500">run#{currentHeuristic.lastTask.iteration}</div>
3030
<div className="text-sm leading-5 font-normal text-gray-500 w-full">
3131
<div className="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700">
32-
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': currentHeuristic.lastTask.progress + '%' }}>
32+
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': (currentHeuristic.lastTask.progress * 100) + '%' }}>
3333
</div>
3434
</div>
3535
</div>

src/components/projects/projectId/heuristics/heuristicId/labeling-function/LabelingFunction.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ export default function LabelingFunction() {
183183
if (!currentHeuristic) return;
184184
if (['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted'].includes(msgParts[1])) {
185185
refetchLabelingTasksAndProcess();
186-
} else if ('labeling_task_deleted' == msgParts[1]) {
186+
} else if ('labeling_task_deleted' == msgParts[1] && currentHeuristic.labelingTaskId == msgParts[2]) {
187187
alert('Parent labeling task was deleted!');
188188
router.push(`/projects/${projectId}/heuristics`);
189-
} else if ('information_source_deleted' == msgParts[1]) {
189+
} else if ('information_source_deleted' == msgParts[1] && currentHeuristic.id == msgParts[2]) {
190190
alert('Information source was deleted!');
191191
router.push(`/projects/${projectId}/heuristics`);
192192
} else if (['information_source_updated', 'model_callback_update_statistics'].includes(msgParts[1])) {

src/components/projects/projectId/heuristics/heuristicId/shared/HeuristicsLayout.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ export default function HeuristicsLayout(props: any) {
122122
</a>
123123
{!isHeaderNormal && <div className="mx-4 text-sm leading-5 font-medium text-gray-500 inline-block">{currentHeuristic.name}</div>}
124124
<Statuses status={currentHeuristic.state} page="heuristics" initialCaption="Initial" />
125+
{currentHeuristic.informationSourceType == InformationSourceType.CROWD_LABELER && currentHeuristic.state && <div className="w-36 inline-flex ml-3 bg-gray-200 rounded-full h-2.5 dark:bg-gray-700">
126+
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': (currentHeuristic.progress * 100) + '%' }}>
127+
</div>
128+
</div>}
125129
{currentHeuristic.lastTask && <Tooltip content={TOOLTIPS_DICT.HEURISTICS.EXECUTION_TIME} color="invert" placement="right" className="cursor-auto">
126130
<div className="text-sm leading-5 font-normal text-gray-500 ml-3 mt-1 inline-block">{currentHeuristic.lastTask.durationText}</div>
127131
</Tooltip>}

src/components/projects/projectId/heuristics/heuristicId/zero-shot/CalculationProgress.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function CalculationProgress() {
3737
</Tooltip>
3838
<div className="text-sm leading-5 font-normal text-gray-500 w-full">
3939
<div className="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700">
40-
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': currentHeuristic.lastTask.progress + '%' }}>
40+
<div className="bg-green-400 h-2.5 rounded-full" style={{ 'width': (currentHeuristic.lastTask.progress * 100) + '%' }}>
4141
</div>
4242
</div>
4343
</div>

src/components/projects/projectId/heuristics/heuristicId/zero-shot/ZeroShot.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ export default function ZeroShot() {
143143
if (!currentHeuristic) return;
144144
if (['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted'].includes(msgParts[1])) {
145145
refetchLabelingTasksAndProcess();
146-
} else if ('labeling_task_deleted' == msgParts[1]) {
146+
} else if ('labeling_task_deleted' == msgParts[1] && currentHeuristic.zeroShotSettings.taskId == msgParts[2]) {
147147
alert('Parent labeling task was deleted!');
148148
router.push(`/projects/${projectId}/heuristics`);
149-
} else if ('information_source_deleted' == msgParts[1]) {
149+
} else if ('information_source_deleted' == msgParts[1] && currentHeuristic.id == msgParts[2]) {
150150
alert('Information source was deleted!');
151151
router.push(`/projects/${projectId}/heuristics`);
152152
} else if ('information_source_updated' == msgParts[1]) {

0 commit comments

Comments
 (0)