Skip to content

Commit 3c17586

Browse files
2 parents 6bf7829 + 0d52df6 commit 3c17586

File tree

20 files changed

+203
-124
lines changed

20 files changed

+203
-124
lines changed

label_studio/core/utils/sentry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33

44
def event_processor(event, hint):
5-
# skip all transactions without errors
5+
# skip all transactions without exceptions, unless it's a log record
66
if 'exc_info' not in hint:
7+
8+
if 'log_record' in hint:
9+
return event
10+
711
return None
812

913
# skip specified exceptions

label_studio/users/serializers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ class BaseUserSerializer(FlexFieldsModelSerializer):
1414
# short form for user presentation
1515
initials = serializers.SerializerMethodField(default='?', read_only=True)
1616
avatar = serializers.SerializerMethodField(read_only=True)
17+
active_organization_meta = serializers.SerializerMethodField(read_only=True)
1718

1819
def get_avatar(self, instance):
1920
return instance.avatar_url
2021

2122
def get_initials(self, instance):
2223
return instance.get_initials(self._is_deleted(instance))
2324

25+
def get_active_organization_meta(self, instance):
26+
organization = instance.active_organization
27+
title = organization.title if organization is not None else ''
28+
email = organization.created_by.email if organization is not None else ''
29+
30+
return {'title': title, 'email': email}
31+
2432
def _is_deleted(self, instance):
2533
if 'deleted_organization_members' in self.context:
2634
organization_members = self.context.get('deleted_organization_members', None)
@@ -84,6 +92,7 @@ class Meta:
8492
'initials',
8593
'phone',
8694
'active_organization',
95+
'active_organization_meta',
8796
'allow_newsletters',
8897
'date_joined',
8998
)

web/apps/labelstudio/src/app/App.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ import ErrorBoundary from "./ErrorBoundary";
1717
import { FF_OPTIC_2, FF_UNSAVED_CHANGES, FF_PRODUCT_TOUR, isFF } from "../utils/feature-flags";
1818
import { TourProvider } from "@humansignal/core";
1919
import { ToastProvider, ToastViewport } from "@humansignal/ui";
20-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
20+
import { QueryClient } from "@tanstack/react-query";
2121
import { JotaiProvider, JotaiStore } from "../utils/jotai-store";
2222
import { CurrentUserProvider } from "../providers/CurrentUser";
23+
import { QueryClientProvider } from "@tanstack/react-query";
24+
import { LSQueryClient } from "../utils/query-client";
2325
import { RootPage } from "./RootPage";
2426
import "@humansignal/ui/src/tailwind.css";
2527
import "./App.scss";
@@ -67,8 +69,8 @@ const App = ({ content }) => {
6769
<Router history={browserHistory}>
6870
<MultiProvider
6971
providers={[
72+
<QueryClientProvider client={LSQueryClient} key="query" />,
7073
<JotaiProvider key="jotai" store={JotaiStore} />,
71-
<QueryClientProvider key="query" client={queryClient} />,
7274
<AppStoreProvider key="app-store" />,
7375
<ApiProvider key="api" />,
7476
<ConfigProvider key="config" />,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { QueryClient } from "@tanstack/react-query";
2+
3+
export const LSQueryClient = new QueryClient({
4+
defaultOptions: {
5+
queries: {
6+
refetchOnWindowFocus: false,
7+
},
8+
},
9+
});

web/dist/apps/labelstudio/3rdpartylicenses.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12131213
SOFTWARE.
12141214

12151215

1216+
@tanstack/react-query
1217+
MIT
1218+
MIT License
1219+
1220+
Copyright (c) 2021-present Tanner Linsley
1221+
1222+
Permission is hereby granted, free of charge, to any person obtaining a copy
1223+
of this software and associated documentation files (the "Software"), to deal
1224+
in the Software without restriction, including without limitation the rights
1225+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1226+
copies of the Software, and to permit persons to whom the Software is
1227+
furnished to do so, subject to the following conditions:
1228+
1229+
The above copyright notice and this permission notice shall be included in all
1230+
copies or substantial portions of the Software.
1231+
1232+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1233+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1234+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1235+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1236+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1237+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1238+
SOFTWARE.
1239+
1240+
12161241
@thi.ng/bitstream
12171242
Apache-2.0
12181243
Apache License

web/dist/apps/labelstudio/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/dist/apps/labelstudio/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/dist/apps/labelstudio/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/dist/apps/labelstudio/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/dist/apps/labelstudio/vendor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)