Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2107e5f
register page changes; web3modal connected
Dzeranov Jul 8, 2021
f07709d
Registration flow reworked; Migrations for custom user model
Dzeranov Jul 8, 2021
157c766
Login via wallet address
Dzeranov Jul 12, 2021
91d2d03
[WIP] changes for demo
Dzeranov Jul 19, 2021
4069297
eth.sign is replaced with eth.personal.sign
Dzeranov Jul 19, 2021
7c88157
defunct_hash_message is replaced with encode_defunct
Dzeranov Jul 19, 2021
7f840d5
Using signed email in django sessions
Dzeranov Jul 26, 2021
98e7ef4
Unused model backend removed
Dzeranov Jul 26, 2021
4ede70c
Merge pull request #6 from humanprotocol/replace-eth-sign
vkomodey Jul 26, 2021
3f37cd2
Merge branch 'wallet-connect' into sessions-rework
Dzeranov Jul 26, 2021
92e0614
Merge pull request #7 from humanprotocol/sessions-rework
Dzeranov Jul 26, 2021
6349961
Admin and user login flow is separated. Password for API, wallet for UI
Dzeranov Jul 26, 2021
117e909
Merge pull request #8 from humanprotocol/admin-user-auth-separation
Jul 27, 2021
0a190d7
Jobflow notifier added; Password flow commented out from UI
Dzeranov Aug 9, 2021
eb0c5bf
(migration) is_excahnge_notified field added to engine_task
Dzeranov Aug 9, 2021
584ef33
Fortmatic removed; code cleanup
Dzeranov Aug 9, 2021
7e548b8
get notify_joblow_url from env
Dzeranov Aug 9, 2021
c7e7356
Signup flow removed from UI
Dzeranov Aug 18, 2021
046f2fe
Linter errors fixed
Dzeranov Aug 19, 2021
58f0055
Merge branch 'fix_linter_errors' into remove_signup_flow
Dzeranov Aug 19, 2021
bf4b1a0
InfuraId changed; Code cleanup
Dzeranov Aug 19, 2021
c161983
Unnecessary comments removed
Dzeranov Aug 19, 2021
3876d0c
Pass infura_id and network as env variables; Error log in case of fai…
Dzeranov Aug 23, 2021
c542226
Revert package files change
Dzeranov Aug 23, 2021
dc150e0
Error handling in notify exchange; RPC sent to web3wallet providers i…
Dzeranov Aug 23, 2021
f2f5ef4
Merge pull request #10 from humanprotocol/remove_signup_flow
Aug 23, 2021
2695d40
Stabilizing tests after changing login flow; Small fixes
Dzeranov Aug 31, 2021
6dd6317
code cleanup
Dzeranov Aug 31, 2021
d86d04f
tests cleanup
Dzeranov Sep 9, 2021
0eb7bf0
code cleanup
Dzeranov Sep 9, 2021
6e96308
Merge pull request #12 from humanprotocol/tests_fix
Sep 10, 2021
f868556
Merge branch 'develop' into wallet-connect
Dzeranov Sep 13, 2021
096f97b
E-mail field validator added
Dzeranov Sep 14, 2021
606efc6
Review flow is removed from UI and tests
Dzeranov Sep 16, 2021
7c1c28d
Review flow is removed from backend; Migration added
Dzeranov Sep 20, 2021
4f811e8
Review flow leftovers removed
Dzeranov Sep 21, 2021
e1c7dc2
Leftovers removed
Dzeranov Sep 21, 2021
8fd27c2
Address is added as a different variable in Task model; Readable name…
Dzeranov Sep 22, 2021
7bca632
Merge pull request #14 from humanprotocol/remove_review_system
Sep 28, 2021
c8f16cf
Merge pull request #13 from humanprotocol/email_field_validator
Sep 28, 2021
070bf88
Merge pull request #15 from humanprotocol/readable_task_name
Sep 29, 2021
ab12f93
Task description is added to the model & UI
Dzeranov Oct 18, 2021
2ff53f7
Code cleanup
Dzeranov Oct 19, 2021
a4f588a
Task description element format changed
Dzeranov Oct 20, 2021
e302380
Merge pull request #16 from humanprotocol/task_description
Oct 21, 2021
06d54b6
Admins now couldn't be a job assignee; Disable link to a job if there…
Dzeranov Oct 21, 2021
2bb5d55
CVAT_EXCHANGE_URL in compose file; cvat_exchange instead of jobflow;
Dzeranov Oct 27, 2021
4de3276
Merge pull request #18 from humanprotocol/cvat_exchange_url
Oct 27, 2021
60e92b6
Replace 5432 postgres constant to env variable
vkomodey Oct 28, 2021
bf90268
Merge pull request #19 from humanprotocol/env-postgres-port
Oct 28, 2021
6c8f654
Assignee filter & sorter fixed
Dzeranov Oct 28, 2021
c695c2e
Merge pull request #17 from humanprotocol/change_task_assignee_rules
Oct 28, 2021
959cf6c
Allow annotation instruments base on task type
Dzeranov Nov 2, 2021
c5291dc
Merge pull request #20 from humanprotocol/allowed_annotation_instruments
Nov 4, 2021
2b34885
allowed_annotation_instrument in Task instead of *_mode
Dzeranov Nov 4, 2021
56743b4
Merge pull request #21 from humanprotocol/allowed_annotation_instruments
Nov 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ yarn-error.log*
/site/public/
/site/resources/
/site/node_modules/
/site/tech-doc-hugo
/site/tech-doc-hugo

# Deployment scripts
.deploy
26 changes: 16 additions & 10 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,44 @@ ENV TERM=xterm \
LC_ALL='C.UTF-8'

# Install dependencies
COPY cvat-core/package*.json /tmp/cvat-core/
COPY cvat-canvas/package*.json /tmp/cvat-canvas/
COPY cvat-canvas3d/package*.json /tmp/cvat-canvas3d/
COPY cvat-ui/package*.json /tmp/cvat-ui/
COPY cvat-data/package*.json /tmp/cvat-data/
COPY cvat-core/package.json /tmp/cvat-core/
COPY cvat-canvas/package.json /tmp/cvat-canvas/
COPY cvat-canvas3d/package.json /tmp/cvat-canvas3d/
COPY cvat-ui/package.json /tmp/cvat-ui/
COPY cvat-data/package.json /tmp/cvat-data/

# Install cvat-data dependencies
WORKDIR /tmp/cvat-data/
RUN npm ci
RUN npm install

# Install cvat-core dependencies
WORKDIR /tmp/cvat-core/
RUN npm ci
RUN npm install

# Install cvat-canvas dependencies
WORKDIR /tmp/cvat-canvas/
RUN npm ci
RUN npm install

# Install cvat-canvas dependencies
WORKDIR /tmp/cvat-canvas3d/
RUN npm ci
RUN npm install

# Install cvat-ui dependencies
WORKDIR /tmp/cvat-ui/
RUN npm ci
RUN npm install

# Build source code
COPY cvat-data/ /tmp/cvat-data/
COPY cvat-core/ /tmp/cvat-core/
COPY cvat-canvas3d/ /tmp/cvat-canvas3d/
COPY cvat-canvas/ /tmp/cvat-canvas/
COPY cvat-ui/ /tmp/cvat-ui/

ARG infura_id
ARG web3_network
ENV INFURA_ID=$infura_id
ENV WEB3_NETWORK=$web3_network

RUN npm run build

FROM nginx:stable-alpine
Expand Down
2 changes: 0 additions & 2 deletions cvat-canvas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ Canvas itself handles:
`cvat_canvas_shape_merging`,
`cvat_canvas_shape_drawing`,
`cvat_canvas_shape_occluded`
- Drawn review ROIs have an id `cvat_canvas_issue_region_{issue.id}`
- Drawn review roi has the class `cvat_canvas_issue_region`
- Drawn texts have the class `cvat_canvas_text`
- Tags have the class `cvat_canvas_tag`
- Canvas image has ID `cvat_canvas_image`
Expand Down
9 changes: 0 additions & 9 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ polyline.cvat_shape_drawing_opacity {
stroke: white;
}

.cvat_canvas_issue_region {
display: none;
stroke-width: 0;
}

circle.cvat_canvas_issue_region {
opacity: 1 !important;
}

polyline.cvat_canvas_shape_grouping {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;
Expand Down
7 changes: 1 addition & 6 deletions cvat-canvas/src/typescript/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -29,7 +29,6 @@ const CanvasVersion = pjson.version;
interface Canvas {
html(): HTMLDivElement;
setup(frameData: any, objectStates: any[], zLayer?: number): void;
setupIssueRegions(issueRegions: Record<number, number[]>): void;
activate(clientID: number | null, attributeID?: number): void;
rotate(rotationAngle: number): void;
focus(clientID: number, padding?: number): void;
Expand Down Expand Up @@ -76,10 +75,6 @@ class CanvasImpl implements Canvas {
this.model.setup(frameData, objectStates, zLayer);
}

public setupIssueRegions(issueRegions: Record<number, number[]>): void {
this.model.setupIssueRegions(issueRegions);
}

public fitCanvas(): void {
this.model.fitCanvas(this.view.html().clientWidth, this.view.html().clientHeight);
}
Expand Down
7 changes: 1 addition & 6 deletions cvat-canvas/src/typescript/canvasController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -19,7 +19,6 @@ import {

export interface CanvasController {
readonly objects: any[];
readonly issueRegions: Record<number, number[]>;
readonly zLayer: number | null;
readonly focusData: FocusData;
readonly activeElement: ActiveElement;
Expand Down Expand Up @@ -123,10 +122,6 @@ export class CanvasControllerImpl implements CanvasController {
return this.model.zLayer;
}

public get issueRegions(): Record<number, number[]> {
return this.model.issueRegions;
}

public get objects(): any[] {
return this.model.objects;
}
Expand Down
14 changes: 0 additions & 14 deletions cvat-canvas/src/typescript/canvasModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export enum UpdateReasons {
IMAGE_MOVED = 'image_moved',
GRID_UPDATED = 'grid_updated',

ISSUE_REGIONS_UPDATED = 'issue_regions_updated',
OBJECTS_UPDATED = 'objects_updated',
SHAPE_ACTIVATED = 'shape_activated',
SHAPE_FOCUSED = 'shape_focused',
Expand Down Expand Up @@ -159,7 +158,6 @@ export enum Mode {
export interface CanvasModel {
readonly imageBitmap: boolean;
readonly image: Image | null;
readonly issueRegions: Record<number, number[]>;
readonly objects: any[];
readonly zLayer: number | null;
readonly gridSize: Size;
Expand All @@ -180,7 +178,6 @@ export interface CanvasModel {
move(topOffset: number, leftOffset: number): void;

setup(frameData: any, objectStates: any[], zLayer: number): void;
setupIssueRegions(issueRegions: Record<number, number[]>): void;
activate(clientID: number | null, attributeID: number | null): void;
rotate(rotationAngle: number): void;
focus(clientID: number, padding: number): void;
Expand Down Expand Up @@ -220,7 +217,6 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
gridSize: Size;
left: number;
objects: any[];
issueRegions: Record<number, number[]>;
scale: number;
top: number;
zLayer: number | null;
Expand Down Expand Up @@ -270,7 +266,6 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
},
left: 0,
objects: [],
issueRegions: {},
scale: 1,
top: 0,
zLayer: null,
Expand Down Expand Up @@ -429,11 +424,6 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
});
}

public setupIssueRegions(issueRegions: Record<number, number[]>): void {
this.data.issueRegions = issueRegions;
this.notify(UpdateReasons.ISSUE_REGIONS_UPDATED);
}

public activate(clientID: number | null, attributeID: number | null): void {
if (this.data.activeElement.clientID === clientID && this.data.activeElement.attributeID === attributeID) {
return;
Expand Down Expand Up @@ -706,10 +696,6 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
return this.data.image;
}

public get issueRegions(): Record<number, number[]> {
return { ...this.data.issueRegions };
}

public get objects(): any[] {
if (this.data.zLayer !== null) {
return this.data.objects.filter((object: any): boolean => object.zOrder <= this.data.zLayer);
Expand Down
102 changes: 0 additions & 102 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
private controller: CanvasController;
private svgShapes: Record<number, SVG.Shape>;
private svgTexts: Record<number, SVG.Text>;
private issueRegionPattern_1: SVG.Pattern;
private issueRegionPattern_2: SVG.Pattern;
private drawnStates: Record<number, DrawnState>;
private drawnIssueRegions: Record<number, SVG.Shape>;
private geometry: Geometry;
private drawHandler: DrawHandler;
private editHandler: EditHandler;
Expand Down Expand Up @@ -520,27 +517,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
}
}

// Transform all drawn issues region
for (const issueRegion of Object.values(this.drawnIssueRegions)) {
((issueRegion as any) as SVG.Shape).attr('r', `${(consts.BASE_POINT_SIZE * 3) / this.geometry.scale}`);
((issueRegion as any) as SVG.Shape).attr(
'stroke-width',
`${consts.BASE_STROKE_WIDTH / this.geometry.scale}`,
);
}

// Transform patterns
for (const pattern of [this.issueRegionPattern_1, this.issueRegionPattern_2]) {
pattern.attr({
width: consts.BASE_PATTERN_SIZE / this.geometry.scale,
height: consts.BASE_PATTERN_SIZE / this.geometry.scale,
});

pattern.children().forEach((element: SVG.Element): void => {
element.attr('stroke-width', consts.BASE_STROKE_WIDTH / this.geometry.scale);
});
}

// Transform handlers
this.drawHandler.transform(this.geometry);
this.editHandler.transform(this.geometry);
Expand All @@ -562,59 +538,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
}
}

private setupIssueRegions(issueRegions: Record<number, number[]>): void {
for (const issueRegion of Object.keys(this.drawnIssueRegions)) {
if (!(issueRegion in issueRegions) || !+issueRegion) {
this.drawnIssueRegions[+issueRegion].remove();
delete this.drawnIssueRegions[+issueRegion];
}
}

for (const issueRegion of Object.keys(issueRegions)) {
if (issueRegion in this.drawnIssueRegions) continue;
const points = this.translateToCanvas(issueRegions[+issueRegion]);
if (points.length === 2) {
this.drawnIssueRegions[+issueRegion] = this.adoptedContent
.circle((consts.BASE_POINT_SIZE * 3 * 2) / this.geometry.scale)
.center(points[0], points[1])
.addClass('cvat_canvas_issue_region')
.attr({
id: `cvat_canvas_issue_region_${issueRegion}`,
fill: 'url(#cvat_issue_region_pattern_1)',
});
} else if (points.length === 4) {
const stringified = this.stringifyToCanvas([
points[0],
points[1],
points[2],
points[1],
points[2],
points[3],
points[0],
points[3],
]);
this.drawnIssueRegions[+issueRegion] = this.adoptedContent
.polygon(stringified)
.addClass('cvat_canvas_issue_region')
.attr({
id: `cvat_canvas_issue_region_${issueRegion}`,
fill: 'url(#cvat_issue_region_pattern_1)',
'stroke-width': `${consts.BASE_STROKE_WIDTH / this.geometry.scale}`,
});
} else {
const stringified = this.stringifyToCanvas(points);
this.drawnIssueRegions[+issueRegion] = this.adoptedContent
.polygon(stringified)
.addClass('cvat_canvas_issue_region')
.attr({
id: `cvat_canvas_issue_region_${issueRegion}`,
fill: 'url(#cvat_issue_region_pattern_1)',
'stroke-width': `${consts.BASE_STROKE_WIDTH / this.geometry.scale}`,
});
}
}
}

private setupObjects(states: any[]): void {
const created = [];
const updated = [];
Expand Down Expand Up @@ -881,7 +804,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
this.svgShapes = {};
this.svgTexts = {};
this.drawnStates = {};
this.drawnIssueRegions = {};
this.activeElement = {
clientID: null,
attributeID: null,
Expand Down Expand Up @@ -915,28 +837,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
const gridDefs: SVGDefsElement = window.document.createElementNS('http://www.w3.org/2000/svg', 'defs');
const gridRect: SVGRectElement = window.document.createElementNS('http://www.w3.org/2000/svg', 'rect');

// Setup defs
const contentDefs = this.adoptedContent.defs();
this.issueRegionPattern_1 = contentDefs
.pattern(consts.BASE_PATTERN_SIZE, consts.BASE_PATTERN_SIZE, (add): void => {
add.line(0, 0, 0, 10).stroke('red');
})
.attr({
id: 'cvat_issue_region_pattern_1',
patternTransform: 'rotate(45)',
patternUnits: 'userSpaceOnUse',
});

this.issueRegionPattern_2 = contentDefs
.pattern(consts.BASE_PATTERN_SIZE, consts.BASE_PATTERN_SIZE, (add): void => {
add.line(0, 0, 0, 10).stroke('yellow');
})
.attr({
id: 'cvat_issue_region_pattern_2',
patternTransform: 'rotate(45)',
patternUnits: 'userSpaceOnUse',
});

// Setup loading animation
this.loadingAnimation.setAttribute('id', 'cvat_canvas_loading_animation');
loadingCircle.setAttribute('id', 'cvat_canvas_loading_circle');
Expand Down Expand Up @@ -1185,8 +1085,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
}
const event: CustomEvent = new CustomEvent('canvas.setup');
this.canvas.dispatchEvent(event);
} else if (reason === UpdateReasons.ISSUE_REGIONS_UPDATED) {
this.setupIssueRegions(this.controller.issueRegions);
} else if (reason === UpdateReasons.GRID_UPDATED) {
const size: Size = this.geometry.grid;
this.gridPattern.setAttribute('width', `${size.width}`);
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"axios": "^0.21.1",
"browser-or-node": "^1.2.1",
"cvat-data": "../cvat-data",
"cvat-data": "file:../cvat-data",
"detect-browser": "^5.2.0",
"error-stack-parser": "^2.0.2",
"form-data": "^2.5.0",
Expand Down
Loading