Skip to content

Commit 27041cb

Browse files
anmarhindilumburovskalinaJWittmeyer
authored
release-v-1-15-0 (#32)
* Version update * Creating LF allows spaces and special characters * Margin missing in the crowd labeler init view (edit description outline overlap) * Zero shot: blue border doesn’t pass when all buttons have indigo color * Submodule update * View as export tooltip centered with margin should be without * run on 10 isn’t disabled on run * Model Downlaod page → OpenAI models cannot be downloaded and should be excluded from the selection list * Users page: two scrollbars * Submodule changes * record coments icon/modal isn’t displayed * Disabled issued on lf run on 10 * ref --------- Co-authored-by: Lina <[email protected]> Co-authored-by: JWittmeyer <[email protected]>
1 parent e471ec3 commit 27041cb

File tree

40 files changed

+120
-71
lines changed

40 files changed

+120
-71
lines changed

src/components/models-download/AddModelDownloadModal.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ModelsDownloaded, ModelsDownloadedStatus } from "@/src/types/components
1111
import { CacheEnum, selectCachedValue } from "@/src/reduxStore/states/cachedValues";
1212
import Dropdown2 from "@/submodules/react-components/components/Dropdown2";
1313
import { modelProviderDownloadModel } from "@/src/services/base/misc";
14+
import { PlatformType } from "@/src/types/components/projects/projectId/settings/embeddings";
1415

1516
const ACCEPT_BUTTON = { buttonCaption: 'Accept', useButton: true };
1617

@@ -29,7 +30,7 @@ export default function AddModelDownloadModal() {
2930

3031
useEffect(() => {
3132
if (!modelsList) return;
32-
setFilteredList(modelsList);
33+
setFilteredList(modelsList.filter((model: any) => model.platform !== PlatformType.OPEN_AI));
3334
}, [modelsList]);
3435

3536
useEffect(() => {

src/components/models-download/ModelsDownload.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useDispatch, useSelector } from "react-redux";
88
import LoadingIcon from "../shared/loading/LoadingIcon";
99
import { openModal, setModalStates } from "@/src/reduxStore/states/modal";
1010
import { ModalEnum } from "@/src/types/shared/modal";
11-
import { selectIsAdmin, selectIsManaged } from "@/src/reduxStore/states/general";
11+
import { selectIsAdmin, selectIsManaged, selectOrganizationId } from "@/src/reduxStore/states/general";
1212
import { timer } from "rxjs";
1313
import { TOOLTIPS_DICT } from "@/src/util/tooltip-constants";
1414
import AddModelDownloadModal from "./AddModelDownloadModal";
@@ -44,7 +44,8 @@ export default function ModelsDownload() {
4444
}
4545
}, []);
4646

47-
useWebsocket(Application.REFINERY, CurrentPage.MODELS_DOWNLOAD, handleWebsocketNotification);
47+
const orgId = useSelector(selectOrganizationId);
48+
useWebsocket(orgId, Application.REFINERY, CurrentPage.MODELS_DOWNLOAD, handleWebsocketNotification);
4849

4950
return (<div className="p-4 bg-gray-100 flex-1 flex flex-col h-[calc(100vh-4rem)] overflow-y-auto">
5051
<div className="flex flex-row items-center">

src/components/projects/ButtonsContainer.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { selectUser } from "@/src/reduxStore/states/general"
1+
import { selectOrganizationId, selectUser } from "@/src/reduxStore/states/general"
22
import { openModal } from "@/src/reduxStore/states/modal";
33
import { setUploadFileType } from "@/src/reduxStore/states/upload";
44
import { ModalEnum } from "@/src/types/shared/modal";
@@ -33,7 +33,8 @@ export default function ButtonsContainer() {
3333
}
3434
}, []);
3535

36-
useWebsocket(Application.REFINERY, CurrentPage.PROJECTS, handleWebsocketNotification, null, CurrentPageSubKey.BUTTONS_CONTAINER);
36+
const orgId = useSelector(selectOrganizationId);
37+
useWebsocket(orgId, Application.REFINERY, CurrentPage.PROJECTS, handleWebsocketNotification, null, CurrentPageSubKey.BUTTONS_CONTAINER);
3738

3839
return (
3940
user && user.role === UserRole.ENGINEER ? (<div>

src/components/projects/ProjectsList.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { selectInactiveOrganization, selectIsDemo, selectIsManaged, selectUser, setComments } from "@/src/reduxStore/states/general"
1+
import { selectInactiveOrganization, selectIsDemo, selectIsManaged, selectOrganizationId, selectUser, setComments } from "@/src/reduxStore/states/general"
22
import { selectAllProjects, setAllProjects } from "@/src/reduxStore/states/project";
33
import { Project, ProjectStatistics } from "@/src/types/components/projects/projects-list";
44
import { percentRoundString } from "@/submodules/javascript-functions/general";
@@ -101,7 +101,8 @@ export default function ProjectsList() {
101101
}
102102
}, []);
103103

104-
useWebsocket(Application.REFINERY, CurrentPage.PROJECTS, handleWebsocketNotification);
104+
const orgId = useSelector(selectOrganizationId);
105+
useWebsocket(orgId, Application.REFINERY, CurrentPage.PROJECTS, handleWebsocketNotification);
105106

106107
return (
107108
<div>

src/components/projects/projectId/admin/ProjectAdmin.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useDispatch, useSelector } from "react-redux";
1111
import NewPersonalToken from "./NewPersonalTokenModal";
1212
import DeletePersonalToken from "./DeletePersonalTokenModal";
1313
import { useRouter } from "next/router";
14-
import { selectIsAdmin } from "@/src/reduxStore/states/general";
14+
import { selectIsAdmin, selectOrganizationId } from "@/src/reduxStore/states/general";
1515
import { useWebsocket } from "@/submodules/react-components/hooks/web-socket/useWebsocket";
1616
import { getAccessTokens } from "@/src/services/base/project";
1717
import { Application, CurrentPage } from "@/submodules/react-components/hooks/web-socket/constants";
@@ -53,7 +53,9 @@ export default function ProjectAdmin() {
5353
}
5454
}, [accessTokens]);
5555

56-
useWebsocket(Application.REFINERY, CurrentPage.ADMIN_PAGE, handleWebsocketNotification, projectId);
56+
57+
const orgId = useSelector(selectOrganizationId);
58+
useWebsocket(orgId, Application.REFINERY, CurrentPage.ADMIN_PAGE, handleWebsocketNotification, projectId);
5759

5860
return (<>
5961
{accessTokens && <div className="p-4 bg-gray-100 h-full overflow-y-auto flex-1 flex flex-col">

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import ContainerLogs from "@/src/components/shared/logs/ContainerLogs";
2121
import LoadingIcon from "@/src/components/shared/loading/LoadingIcon";
2222
import { debounceTime, distinctUntilChanged, fromEvent, timer } from "rxjs";
2323
import { TOOLTIPS_DICT } from "@/src/util/tooltip-constants";
24-
import { selectAllUsers, setComments } from "@/src/reduxStore/states/general";
24+
import { selectAllUsers, selectOrganizationId, setComments } from "@/src/reduxStore/states/general";
2525
import { CommentDataManager } from "@/src/util/classes/comments";
2626
import { CommentType } from "@/src/types/shared/comments";
2727
import BricksIntegrator from "@/src/components/shared/bricks-integrator/BricksIntegrator";
@@ -285,7 +285,8 @@ export default function AttributeCalculation() {
285285
}
286286
}, [projectId, currentAttribute]);
287287

288-
useWebsocket(Application.REFINERY, CurrentPage.ATTRIBUTE_CALCULATION, handleWebsocketNotification, projectId);
288+
const orgId = useSelector(selectOrganizationId);
289+
useWebsocket(orgId, Application.REFINERY, CurrentPage.ATTRIBUTE_CALCULATION, handleWebsocketNotification, projectId);
289290

290291
return (projectId && <div className={`bg-white p-4 overflow-y-auto min-h-full h-[calc(100vh-4rem)]`} onScroll={(e: any) => onScrollEvent(e)}>
291292
{currentAttribute && <div>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function ExecutionContainer(props: ExecutionContainerProps) {
7575
<Tooltip content={TOOLTIPS_DICT.ATTRIBUTE_CALCULATION.EXECUTE_10_RECORDS} color="invert" placement="bottom" className="ml-auto">
7676
<button onClick={calculateUserAttributeSampleRecords}
7777
disabled={props.currentAttribute.state == AttributeState.USABLE || props.currentAttribute.state == AttributeState.RUNNING || requestedSomething || props.tokenizationProgress < 1 || props.checkUnsavedChanges}
78-
className={`bg-white text-gray-700 text-xs font-semibold px-4 py-2 rounded-md border border-gray-300 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed`}>
78+
className={`bg-white text-gray-700 text-xs font-semibold px-4 py-2 rounded-md border border-gray-300 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed`}>
7979
Run on 10
8080
</button>
8181
</Tooltip>

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { expandRecordList, selectActiveSearchParams, selectActiveSlice, selectCo
66
import { postProcessRecordsExtended, postProcessUniqueValues, postProcessUsersCount } from "@/src/util/components/projects/projectId/data-browser/data-browser-helper";
77
import { selectAttributes, selectLabelingTasksAll, setAllAttributes, setAllEmbeddings, setLabelingTasksAll } from "@/src/reduxStore/states/pages/settings";
88
import { postProcessLabelingTasks, postProcessLabelingTasksSchema } from "@/src/util/components/projects/projectId/settings/labeling-tasks-helper";
9-
import { selectAllUsers, selectUser, setComments } from "@/src/reduxStore/states/general";
9+
import { selectAllUsers, selectOrganizationId, selectUser, setComments } from "@/src/reduxStore/states/general";
1010
import DataBrowserRecords from "./DataBrowserRecords";
1111
import { postProcessingEmbeddings } from "@/src/util/components/projects/projectId/settings/embeddings-helper";
1212
import { CommentType } from "@/src/types/shared/comments";
@@ -141,7 +141,7 @@ export default function DataBrowser() {
141141
const currentRecordIds = parsedRecordData?.map((record) => record.id);
142142
if (!currentRecordIds || currentRecordIds.length == 0) return;
143143
getRecordComments(projectId, currentRecordIds, (res) => {
144-
dispatch(setRecordComments(res.data['recordComments']));
144+
dispatch(setRecordComments(res.data['getRecordComments']));
145145
});
146146
}
147147

@@ -175,7 +175,8 @@ export default function DataBrowser() {
175175
}
176176
}, [projectId]);
177177

178-
useWebsocket(Application.REFINERY, CurrentPage.DATA_BROWSER, handleWebsocketNotification, projectId);
178+
const orgId = useSelector(selectOrganizationId);
179+
useWebsocket(orgId, Application.REFINERY, CurrentPage.DATA_BROWSER, handleWebsocketNotification, projectId);
179180

180181
return (<>
181182
{projectId && <div className="flex flex-row h-full">

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export default function DataSliceInfoModal() {
3939
{value.substring(value.startsWith("https") ? 8 : 7)}</span>
4040
</Tooltip>
4141
</div>
42-
<Tooltip content={TOOLTIPS_DICT.DATA_BROWSER.ONLY_MANAGED} color="invert" placement="right">
42+
<Tooltip content={TOOLTIPS_DICT.DATA_BROWSER.ONLY_MANAGED} color="invert" placement="right" className="mt-3">
4343
<button onClick={() => testLink(value + '?pos=1&type=DATA_SLICE')} disabled={!isManaged}
44-
className="mt-3 opacity-100 w-40 bg-indigo-700 text-white text-xs leading-4 font-semibold px-4 py-2 rounded-md cursor-pointer hover:bg-indigo-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed">
44+
className="opacity-100 w-40 bg-indigo-700 text-white text-xs leading-4 font-semibold px-4 py-2 rounded-md cursor-pointer hover:bg-indigo-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed">
4545
View as expert
4646
</button>
4747
</Tooltip>

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { openModal } from "@/src/reduxStore/states/modal";
1616
import { useWebsocket } from "@/submodules/react-components/hooks/web-socket/useWebsocket";
1717
import { scrollElementIntoView } from "@/submodules/javascript-functions/scrollHelper";
1818
import { Application, CurrentPage } from "@/submodules/react-components/hooks/web-socket/constants";
19+
import { selectOrganizationId } from "@/src/reduxStore/states/general";
1920

2021
export default function EditRecords() {
2122
const dispatch = useDispatch();
@@ -72,7 +73,8 @@ export default function EditRecords() {
7273
setAlertLastVisible(Date.now());
7374
}, [alertLastVisible]);
7475

75-
useWebsocket(Application.REFINERY, CurrentPage.EDIT_RECORDS, handleWebsocketNotification, projectId);
76+
const orgId = useSelector(selectOrganizationId);
77+
useWebsocket(orgId, Application.REFINERY, CurrentPage.EDIT_RECORDS, handleWebsocketNotification, projectId);
7678

7779
return (<>{projectId && <div className="bg-white flex flex-col min-h-full h-[calc(100vh-4rem)]">
7880
<NavBarTopEditRecords erdData={erdData} setErdData={(erdData) => setErdData(erdData)} />

src/components/projects/projectId/heuristics/HeuristicsHeader.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Loading } from "@nextui-org/react";
2-
import { selectIsManaged } from '@/src/reduxStore/states/general';
2+
import { selectIsManaged, selectOrganizationId } from '@/src/reduxStore/states/general';
33
import { openModal, selectModal } from '@/src/reduxStore/states/modal';
44
import { selectHeuristicsAll, setHeuristicType } from '@/src/reduxStore/states/pages/heuristics';
55
import { selectLabelingTasksAll } from '@/src/reduxStore/states/pages/settings';
@@ -155,7 +155,8 @@ export default function HeuristicsHeader(props: HeuristicsHeaderProps) {
155155
else if (msgParts[1] == 'weak_supervision_finished') setLoadingIconWS(false);
156156
}, []);
157157

158-
useWebsocket(Application.REFINERY, CurrentPage.HEURISTICS, handleWebsocketNotification, projectId);
158+
const orgId = useSelector(selectOrganizationId);
159+
useWebsocket(orgId, Application.REFINERY, CurrentPage.HEURISTICS, handleWebsocketNotification, projectId);
159160

160161
return (
161162
<div className="flex-shrink-0 block xl:flex justify-between items-center">

src/components/projects/projectId/heuristics/HeuristicsOverview.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import AddCrowdLabelerModal from "./modals/AddCrowdLabelerModal";
1616
import { postProcessingEmbeddings } from "@/src/util/components/projects/projectId/settings/embeddings-helper";
1717
import { CommentType } from "@/src/types/shared/comments";
1818
import { CommentDataManager } from "@/src/util/classes/comments";
19-
import { selectAllUsers, setBricksIntegrator, setComments } from "@/src/reduxStore/states/general";
19+
import { selectAllUsers, selectOrganizationId, setBricksIntegrator, setComments } from "@/src/reduxStore/states/general";
2020
import { getEmptyBricksIntegratorConfig } from "@/src/util/shared/bricks-integrator-helper";
2121
import { useWebsocket } from "@/submodules/react-components/hooks/web-socket/useWebsocket";
2222
import { getAllComments } from "@/src/services/base/comment";
@@ -106,7 +106,8 @@ export function HeuristicsOverview() {
106106
}
107107
}, [projectId]);
108108

109-
useWebsocket(Application.REFINERY, CurrentPage.HEURISTICS, handleWebsocketNotification, projectId);
109+
const orgId = useSelector(selectOrganizationId);
110+
useWebsocket(orgId, Application.REFINERY, CurrentPage.HEURISTICS, handleWebsocketNotification, projectId);
110111

111112
return (projectId && <div className="p-4 bg-gray-100 h-full flex-1 flex flex-col">
112113
<div className="w-full h-full -mr-4">

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import HeuristicStatistics from "../shared/HeuristicStatistics";
2121
import DangerZone from "@/src/components/shared/danger-zone/DangerZone";
2222
import { DangerZoneEnum } from "@/src/types/shared/danger-zone";
2323
import { getPythonClassName, getPythonClassRegExMatch } from "@/submodules/javascript-functions/python-functions-parser";
24-
import { selectAllUsers, setBricksIntegrator, setLabelsBricksIntegrator, setComments } from "@/src/reduxStore/states/general";
24+
import { selectAllUsers, setBricksIntegrator, setLabelsBricksIntegrator, setComments, selectOrganizationId } from "@/src/reduxStore/states/general";
2525
import { CommentType } from "@/src/types/shared/comments";
2626
import { CommentDataManager } from "@/src/util/classes/comments";
2727
import BricksIntegrator from "@/src/components/shared/bricks-integrator/BricksIntegrator";
@@ -204,7 +204,8 @@ export default function ActiveLearning() {
204204
});
205205
}
206206

207-
useWebsocket(Application.REFINERY, CurrentPage.ACTIVE_LEARNING, handleWebsocketNotification, projectId);
207+
const orgId = useSelector(selectOrganizationId);
208+
useWebsocket(orgId, Application.REFINERY, CurrentPage.ACTIVE_LEARNING, handleWebsocketNotification, projectId);
208209

209210
return (
210211
<HeuristicsLayout updateSourceCode={(code) => updateSourceCodeToDisplay(code)}>

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useRouter } from "next/router";
66
import { useCallback, useEffect } from "react";
77
import { useDispatch, useSelector } from "react-redux";
88
import HeuristicsLayout from "../shared/HeuristicsLayout";
9-
import { selectAllUsers, selectAnnotators, setComments } from "@/src/reduxStore/states/general";
9+
import { selectAllUsers, selectAnnotators, selectOrganizationId, setComments } from "@/src/reduxStore/states/general";
1010
import DangerZone from "@/src/components/shared/danger-zone/DangerZone";
1111
import { DangerZoneEnum } from "@/src/types/shared/danger-zone";
1212
import HeuristicStatistics from "../shared/HeuristicStatistics";
@@ -113,15 +113,16 @@ export default function CrowdLabeler() {
113113
}
114114
}, [currentHeuristic, projectId]);
115115

116-
useWebsocket(Application.REFINERY, CurrentPage.CROWD_LABELER, handleWebsocketNotification, projectId);
116+
const orgId = useSelector(selectOrganizationId);
117+
useWebsocket(orgId, Application.REFINERY, CurrentPage.CROWD_LABELER, handleWebsocketNotification, projectId);
117118

118119
return (<HeuristicsLayout>
119120
{currentHeuristic && <div>
120121
{annotators.length == 0 || dataSlices.length == 0 ? (
121122
<>
122123
<div className="overflow-hidden bg-white">
123124
<div className="relative py-8 pr-4">
124-
<div className="absolute top-0 bottom-0 left-3/4 hidden w-screen bg-gray-50 lg:block"></div>
125+
<div className="absolute top-2 bottom-0 left-3/4 hidden w-screen bg-gray-50 lg:block"></div>
125126
<div className="mx-auto max-w-prose text-base lg:grid lg:max-w-none lg:grid-cols-2 lg:gap-8">
126127
<div>
127128
<h2 className="text-lg font-semibold text-indigo-600">Integrating crowd labelers</h2>

0 commit comments

Comments
 (0)