Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in UI code #8583

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cvat-core/src/annotations-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ export default class Collection {
const predicate = sign > 0 ? (frame) => frame <= frameTo : (frame) => frame >= frameTo;
const update = sign > 0 ? (frame) => frame + 1 : (frame) => frame - 1;

// if not looking for an emty frame nor frame with annotations, return the next frame
// if not looking for an empty frame nor frame with annotations, return the next frame
// check if deleted frames are allowed additionally
if (!annotationsFilters) {
let frame = frameFrom;
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/cloud-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Object.defineProperties(CloudStorage.prototype.save, {
}
// update
if (typeof this.id !== 'undefined') {
// provider_type and recource should not change;
// provider_type and resource should not change;
// send to the server only the values that have changed
const initialData: SerializedCloudStorage = {};
if (this.displayName) {
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/src/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ export function getContextImage(jobID: number, frame: number): Promise<Record<st
// it might raise multiple server requests for context images
// if the promise was pending before and several requests came for the same frame
// all these requests will stuck on "finally"
// and when the promise fullfilled, it will run all the microtasks
// and when the promise is fulfilled, it will run all the microtasks
// since they all have the same request id, all they will perform in executor()
frameData.activeContextRequest.finally(() => setTimeout(checkAndExecute));
} else {
Expand Down Expand Up @@ -789,7 +789,7 @@ export async function getFrame(
// - getContextImage
// - getCachedChunks
// And from this idea we should call refreshJobCacheIfOutdated from each one
// Hovewer, following from the order, these methods are usually called
// However, following from the order, these methods are usually called
// it may lead to even more confusing behaviour
//
// Usually user first receives frame, then user receives ranges and finally user receives context images
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/object-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function findAngleDiff(rightAngle: number, leftAngle: number): number {
angleDiff = ((angleDiff + 180) % 360) - 180;
if (Math.abs(angleDiff) >= 180) {
// if the main arc is bigger than 180, go another arc
// to find it, just substract absolute value from 360 and inverse sign
// to find it, just subtract absolute value from 360 and inverse sign
angleDiff = 360 - Math.abs(angleDiff) * Math.sign(angleDiff) * -1;
}
return angleDiff;
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/requests-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RequestsManager {
const promise = new Promise<Request>((resolve, reject) => {
const timeoutCallback = async (): Promise<void> => {
// We make sure that no more than REQUESTS_COUNT requests are sent simultaneously
// If thats the case, we re-schedule the timeout
// If that's the case, we re-schedule the timeout
const timestamp = Date.now();
if (this.requestStack.length >= REQUESTS_COUNT) {
const timestampToCheck = this.requestStack[this.requestStack.length - 1];
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/server-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
}
});

// removing possible dublicates
// removing possible duplicates
const obj = result.results.reduce((acc: Record<string, any>, item: any) => {
acc[item.id] = item;
return acc;
Expand Down Expand Up @@ -244,7 +244,7 @@
return new ServerError(message, 0);
}

function prepareData(details) {

Check warning on line 247 in cvat-core/src/server-proxy.ts

View workflow job for this annotation

GitHub Actions / Linter

Missing return type on function
const data = new FormData();
for (const [key, value] of Object.entries(details)) {
if (Array.isArray(value)) {
Expand Down Expand Up @@ -286,7 +286,7 @@
return requestId++;
}

async function get(url: string, requestConfig) {

Check warning on line 289 in cvat-core/src/server-proxy.ts

View workflow job for this annotation

GitHub Actions / Linter

Missing return type on function
return new Promise((resolve, reject) => {
const newRequestId = getRequestId();
requests[newRequestId] = { resolve, reject };
Expand Down Expand Up @@ -819,7 +819,7 @@
save_images: saveImages,
};
return new Promise<string | void>((resolve, reject) => {
async function request() {

Check warning on line 822 in cvat-core/src/server-proxy.ts

View workflow job for this annotation

GitHub Actions / Linter

Missing return type on function
Axios.post(baseURL, {}, {
params,
})
Expand Down Expand Up @@ -914,7 +914,7 @@
const url = `${backendAPI}/tasks/${id}/backup/export`;

return new Promise<string | void>((resolve, reject) => {
async function request() {

Check warning on line 917 in cvat-core/src/server-proxy.ts

View workflow job for this annotation

GitHub Actions / Linter

Missing return type on function
try {
const response = await Axios.post(url, {}, {
params,
Expand Down Expand Up @@ -996,7 +996,7 @@
const url = `${backendAPI}/projects/${id}/backup/export`;

return new Promise<string | void>((resolve, reject) => {
async function request() {

Check warning on line 999 in cvat-core/src/server-proxy.ts

View workflow job for this annotation

GitHub Actions / Linter

Missing return type on function
try {
const response = await Axios.post(url, {}, {
params,
Expand Down Expand Up @@ -1124,7 +1124,7 @@
message: 'CVAT is uploading task data to the server',
}));

async function bulkUpload(taskId, files) {

Check warning on line 1127 in cvat-core/src/server-proxy.ts

View workflow job for this annotation

GitHub Actions / Linter

Missing return type on function
const fileBulks = files.reduce((fileGroups, file) => {
const lastBulk = fileGroups[fileGroups.length - 1];
if (chunkSize - lastBulk.size >= file.size) {
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/src/session-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export function implementJob(Job: typeof JobClass): typeof JobClass {
}

if ('annotationsFilters' in searchParameters && 'generalFilters' in searchParameters) {
throw new ArgumentError('Both annotations filters and general fiters could not be used together');
throw new ArgumentError('Both annotations filters and general filters could not be used together');
}

if (!Number.isInteger(frameFrom) || !Number.isInteger(frameTo)) {
Expand Down Expand Up @@ -1045,7 +1045,7 @@ export function implementTask(Task: typeof TaskClass): typeof TaskClass {
}

if ('annotationsFilters' in searchParameters && 'generalFilters' in searchParameters) {
throw new ArgumentError('Both annotations filters and general fiters could not be used together');
throw new ArgumentError('Both annotations filters and general filters could not be used together');
}

if (!Number.isInteger(frameFrom) || !Number.isInteger(frameTo)) {
Expand Down
4 changes: 2 additions & 2 deletions cvat-data/src/ts/3rdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ These files are from the [Broadway.js](https://github.com/mbebenita/Broadway) re
Authors don't provide an npm package, so we need to store these components in our repository.
We use this dependency to decode video chunks from a server and split them to frames on client side.

We need to run this package in node environent (for example for debug, or for running unit tests).
But there aren't any ways to do that (even with syntetic environment, provided for example by the package ``browser-env``).
We need to run this package in node environment (for example for debug, or for running unit tests).
But there aren't any ways to do that (even with synthetic environment, provided for example by the package ``browser-env``).
For example there are issues with canvas using (webpack doesn't work with binary canvas package for node-js) and others.
So, we have solved to write patch file for this library.
It modifies source code a little to support our scenario of using.
Expand Down
2 changes: 1 addition & 1 deletion cvat-data/src/ts/unzip_imgs.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ onmessage = (e) => {
.async('blob')
.then((fileData) => {
if (!errored) {
// do not need to read the rest of block if an error already occured
// do not need to read the rest of block if an error already occurred
if (dimension === dimension2D) {
createImageBitmap(fileData).then((img) => {
postMessage({
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/react_nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
root /usr/share/nginx/html;

# Disable server signature to make it slighty harder for
# Disable server signature to make it slightly harder for
# attackers to find known vulnerabilities. See
# https://datatracker.ietf.org/doc/html/rfc9110#name-server
server_tokens off;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ObjectMapperComponent(props: Props): JSX.Element {
const [rightValue, setRightValue] = useState<object | null>(null);

const setMappingWrapper = (updated: Props['defaultMapping']): void => {
// if we prefer useEffect instead of this approch
// if we prefer useEffect instead of this approach
// component will be rerendered first with extras that depends on parent state
// these extras will use outdated information in this case
onUpdateMapping(updated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function AutomaticAnnotationProgress(props: Props): JSX.Element |
return (<>Unknown status received</>);
}

return <>Automatic annotation accomplisted</>;
return <>Automatic annotation accomplished</>;
})()}
</Text>
</div>
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function customWaViewHit(pageName?: string, queryString?: string, hashInf
waHitFunction(pageName, queryString, hashInfo);
} catch (error: any) {
// eslint-disable-next-line
console.error(`Web analitycs hit function has failed. ${error.toString()}`);
console.error(`Web analytics hit function has failed. ${error.toString()}`);
}
}
}
2 changes: 1 addition & 1 deletion cvat-ui/src/utils/opencv-wrapper/opencv-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class OpenCVWrapper {
cv.findContours(expanded, contours, hierarchy, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_NONE);
for (let i = 0; i < contours.size(); i++) {
const contour = contours.get(i);
// substract offset we created when copied source image
// subtract offset we created when copied source image
jsContours.push(Array.from(contour.data32S as number[]).map((el) => el - 1));
contour.delete();
}
Expand Down
Loading