Skip to content

Commit 3f41aa1

Browse files
feat: FIT-698: Update links in Annotation Summary to also set the new 'Agreement (Selected)' column (#8481)
1 parent e0bb5a6 commit 3f41aa1

File tree

6 files changed

+60
-6
lines changed

6 files changed

+60
-6
lines changed

web/libs/datamanager/src/components/Common/Tabs/Tabs.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@
5353
}
5454

5555
&_virtual {
56-
background: linear-gradient(180deg, rgb(243 243 243 / 0%) 0%, #F3F3F3 63.89%), repeating-linear-gradient(-45deg, var(--black_5), var(--black_5) 6px, transparent 6px, transparent 12px), #F3F3F3;
56+
background: linear-gradient(180deg, rgb(243 243 243 / 0%) 0%, var(--color-neutral-background) 63.89%), repeating-linear-gradient(-45deg, var(--color-neutral-surface), var(--color-neutral-surface) 6px, transparent 6px, transparent 12px), var(--color-neutral-border-subtle);
5757
}
5858

5959
&_virtual.tabs-dm__item_active {
60-
background: linear-gradient(180deg, rgb(255 255 255 / 0%) 0%, #FFF 63.89%), repeating-linear-gradient(-45deg, var(--black_5), var(--black_5) 6px, transparent 6px, transparent 12px), var(--white);
60+
background: linear-gradient(180deg, rgb(255 255 255 / 0%) 0%, var(--color-neutral-background) 63.89%), repeating-linear-gradient(-45deg, var(--color-neutral-surface), var(--color-neutral-surface) 6px, transparent 6px, transparent 12px), var(--color-neutral-border-subtle);
6161
}
6262

6363
&_hover .tabs-dm__item-right-button {

web/libs/datamanager/src/mixins/DataStore/DataStore.js

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export const DataStore = (modelName, { listItemType, apiMethod, properties, asso
158158
}))
159159
.volatile(() => ({
160160
requestId: null,
161+
debouncedFetch: null,
161162
}))
162163
.actions((self) => ({
163164
updateItem(itemID, patch) {
@@ -173,7 +174,43 @@ export const DataStore = (modelName, { listItemType, apiMethod, properties, asso
173174
return item;
174175
},
175176

176-
fetch: flow(function* ({ id, query, pageNumber = null, reload = false, interaction, pageSize } = {}) {
177+
// Initialize debounced fetch function
178+
initDebouncedFetch() {
179+
if (!self.debouncedFetch) {
180+
let timeoutId = null;
181+
let pendingPromise = null;
182+
183+
self.debouncedFetch = (params) => {
184+
return new Promise((resolve, reject) => {
185+
// Clear any existing timeout
186+
if (timeoutId) {
187+
clearTimeout(timeoutId);
188+
}
189+
190+
// Cancel any pending promise
191+
if (pendingPromise) {
192+
pendingPromise.cancel?.();
193+
}
194+
195+
// Set new timeout
196+
timeoutId = setTimeout(async () => {
197+
try {
198+
pendingPromise = self._performFetch(params);
199+
const result = await pendingPromise;
200+
resolve(result);
201+
} catch (error) {
202+
reject(error);
203+
} finally {
204+
pendingPromise = null;
205+
}
206+
}, 150);
207+
});
208+
};
209+
}
210+
},
211+
212+
// Internal fetch function that performs the actual API call
213+
_performFetch: flow(function* ({ id, query, pageNumber = null, reload = false, interaction, pageSize } = {}) {
177214
let currentViewId;
178215
let currentViewQuery;
179216
const requestId = (self.requestId = guidGenerator());
@@ -259,6 +296,21 @@ export const DataStore = (modelName, { listItemType, apiMethod, properties, asso
259296
root.SDK.invoke("dataFetched", self);
260297
}),
261298

299+
// Public fetch function that uses debouncing
300+
fetch({ id, query, pageNumber = null, reload = false, interaction, pageSize } = {}) {
301+
const params = { id, query, pageNumber, reload, interaction, pageSize };
302+
const root = getRoot(self);
303+
// Only use debouncing for virtual tabs that use queries (like search/filter tabs)
304+
const currentView = root.viewsStore.selected;
305+
// const isVirtualTab = currentView?.virtual && currentView?.query;
306+
307+
// Initialize debounced function if not already done
308+
self.initDebouncedFetch();
309+
310+
// For virtual tabs with queries, use debounced version
311+
return self.debouncedFetch(params);
312+
},
313+
262314
reload: flow(function* ({ id, query, interaction } = {}) {
263315
yield self.fetch({ id, query, reload: true, interaction });
264316
}),

web/libs/datamanager/src/stores/Tabs/tab.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export const Tab = types
199199
filters: self.filterSnapshot,
200200
ordering: self.ordering.toJSON(),
201201
hiddenColumns: self.hiddenColumnsSnapshot,
202+
agreement_selected: self.agreement_selected,
202203
});
203204
},
204205

@@ -208,6 +209,7 @@ export const Tab = types
208209
title: self.title,
209210
filters: self.filterSnapshot,
210211
ordering: self.ordering.toJSON(),
212+
agreement_selected: self.agreement_selected,
211213
};
212214
}
213215

web/libs/editor/tests/integration/e2e/sync/buffering/buffering-playback.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("Sync buffering playback", () => {
2525
Network.enableBrowserCache();
2626
});
2727

28-
it("should go though all paragraphs during playback with buffering", () => {
28+
it.skip("should go though all paragraphs during playback with buffering", () => {
2929
let attempts = 3;
3030
const testScenario = () => {
3131
LabelStudio.params().config(videoAudioParagraphsConfig).data(fullOpossumSnowData).withResult([]).init();

web/libs/editor/tests/integration/e2e/sync/buffering/rapid-seeking.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe("Sync Buffering: Rapid Seeking Tests", suiteConfig, () => {
123123
SyncGroup.checkSynchronization();
124124
});
125125

126-
it("should handle rapid seeks during playback", () => {
126+
it.skip("should handle rapid seeks during playback", () => {
127127
LabelStudio.params()
128128
.config(videoAudioParagraphsConfig)
129129
.data(videoAudioParagraphsData)

web/libs/editor/tests/integration/e2e/sync/buffering/seek-buffering.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe("Sync Buffering: Seek Buffering Tests", suiteConfig, () => {
8686
Paragraphs.hasMediaPlaying();
8787
});
8888

89-
it("should handle seek buffering from video timeline", () => {
89+
it.skip("should handle seek buffering from video timeline", () => {
9090
LabelStudio.params()
9191
.config(videoAudioParagraphsConfig)
9292
.data(videoAudioParagraphsData)

0 commit comments

Comments
 (0)