Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Jun 7, 2023
2 parents cc8ec35 + 5c76068 commit 230efd8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cvat-core/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function filterFieldsToSnakeCase(filter: Record<string, string>, keysToSn
if (searchParams.filter) {
const parsed = JSON.parse(searchParams.filter);
searchParams.filter = JSON.stringify({ and: [parsed, ...filtersGroup] });
} else {
} else if (filtersGroup.length) {
searchParams.filter = JSON.stringify({ and: [...filtersGroup] });
}
return searchParams;
Expand Down
13 changes: 6 additions & 7 deletions cvat-core/src/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { isBrowser, isNode } from 'browser-or-node';

import * as cvatData from 'cvat-data';
import jsonLogic from 'json-logic-js';
import { DimensionType } from 'enums';
import PluginRegistry from './plugins';
import serverProxy, { FramesMetaData } from './server-proxy';
Expand Down Expand Up @@ -318,20 +317,20 @@ FrameData.prototype.data.implementation = async function (onServerRequest) {

function getFrameMeta(jobID, frame): FramesMetaData['frames'][0] {
const { meta, mode, startFrame } = frameDataCache[jobID];
let frame_meta = null;
if (mode === 'interpolation' && meta.frames.length == 1) {
let frameMeta = null;
if (mode === 'interpolation' && meta.frames.length === 1) {
// video tasks have 1 frame info, but image tasks will have many infos
[frame_meta] = meta.frames;
} else if (mode === 'annotation' || mode === 'interpolation' && meta.frames.length > 1) {
[frameMeta] = meta.frames;
} else if (mode === 'annotation' || (mode === 'interpolation' && meta.frames.length > 1)) {
if (frame > meta.stop_frame) {
throw new ArgumentError(`Meta information about frame ${frame} can't be received from the server`);
}
frame_meta = meta.frames[frame - startFrame];
frameMeta = meta.frames[frame - startFrame];
} else {
throw new DataError(`Invalid mode is specified ${mode}`);
}

return frame_meta;
return frameMeta;
}

class FrameBuffer {
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/session-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function implementJob(Job) {
};

Job.prototype.issues.implementation = async function () {
const result = await serverProxy.issues.get({job_id: this.id });
const result = await serverProxy.issues.get({ job_id: this.id });
return result.map((issue) => new Issue(issue));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ context('New organization pipeline.', () => {
cy.assignJobToUser(0, thirdUserName);
cy.renameTask(taskName, newTaskName);
cy.url().then((url) => {
taskID = Number(url.split('/').slice(-1)[0]);
const [link] = url.split('?');
taskID = Number(link.split('/').slice(-1)[0]);
});
cy.getJobNum(0).then(($jobID) => {
jobID = $jobID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ context('Export, import an annotation task.', { browser: '!firefox' }, () => {
cy.createZipArchive(directoryToArchive, archivePath);
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName);
cy.openTask(taskName);
cy.url().then((link) => {
cy.url().then((url) => {
const [link] = url.split('?');
taskId = Number(link.split('/').slice(-1)[0]);
});
cy.addNewLabel(newLabelName);
Expand Down Expand Up @@ -122,7 +123,8 @@ context('Export, import an annotation task.', { browser: '!firefox' }, () => {
cy.contains('The task has been restored successfully. Click here to open').should('exist').and('be.visible');
cy.closeNotification('.ant-notification-notice-info');
cy.openTask(taskName);
cy.url().then((link) => {
cy.url().then((url) => {
const [link] = url.split('?');
expect(Number(link.split('/').slice(-1)[0])).to.be.equal(taskId + 1);
});
cy.get('.cvat-constructor-viewer-item').then((labels) => {
Expand Down
3 changes: 2 additions & 1 deletion tests/cypress/e2e/actions_users/issue_1810_login_logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ context('When clicking on the Logout button, get the user session closed.', () =
cy.login();
cy.openTask(taskName);
// get id task
cy.url().then((link) => {
cy.url().then((url) => {
const [link] = url.split('?');
taskId = Number(link.split('/').slice(-1)[0]);
});
});
Expand Down

0 comments on commit 230efd8

Please sign in to comment.