Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fb-leap-580/non-str…
Browse files Browse the repository at this point in the history
…ing-values
  • Loading branch information
hlomzik committed Jan 23, 2024
2 parents 80abc7e + c8886fb commit 733a30f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Configure yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Configure yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Configure yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -62,7 +62,7 @@ jobs:
npm list --depth=1 || true
- name: Run ESLint
uses: tj-actions/eslint-changed-files@v21
uses: tj-actions/eslint-changed-files@v23
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fun_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Configure yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-set-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
node-version: "${{ env.NODE }}"

- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-jsdoc-to-markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Configure yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }}
Expand Down
2 changes: 2 additions & 0 deletions src/LabelStudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export class LabelStudio {
};

const clearRenderedApp = () => {
if (!rootElement.childNodes?.length) return;

const childNodes = [...rootElement.childNodes];
// cleanDomAfterReact needs this key to be sure that cleaning affects only current react subtree
const reactKey = findReactKey(childNodes[0]);
Expand Down
14 changes: 13 additions & 1 deletion src/core/Hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@ import { createElement, Fragment } from 'react';
import { Tooltip } from '../common/Tooltip/Tooltip';
import Hint from '../components/Hint/Hint';
import { Block, Elem } from '../utils/bem';
import { FF_LSDV_1148, isFF } from '../utils/feature-flags';
import { FF_LSDV_1148, FF_MULTI_OBJECT_HOTKEYS, isFF } from '../utils/feature-flags';
import { isDefined, isMacOS } from '../utils/utilities';
import defaultKeymap from './settings/keymap.json';

if (!isFF(FF_MULTI_OBJECT_HOTKEYS)) {
const prev = (defaultKeymap as Keymap)['image:prev'];
const next = (defaultKeymap as Keymap)['image:next'];

if (prev) {
prev.key = prev.mac = 'ctrl+a';
}
if (next) {
next.key = next.mac = 'ctrl+d';
}
}

// Validate keymap integrity
const allowedKeympaKeys = ['key', 'mac', 'description', 'modifier', 'modifierDescription'];

Expand Down
6 changes: 4 additions & 2 deletions src/core/settings/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@
"description": "Previous Page"
},
"image:prev": {
"key": "ctrl+a",
"key": "ctrl+left",
"mac": "command+left",
"description": "Previous Image"
},
"image:next": {
"key": "ctrl+d",
"key": "ctrl+right",
"mac": "command+right",
"description": "Next Image"
}
}
4 changes: 2 additions & 2 deletions src/regions/VideoRegion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { types } from 'mobx-state-tree';
import { getRoot, types } from 'mobx-state-tree';

import { guidGenerator } from '../core/Helpers';
import { AreaMixin } from '../mixins/AreaMixin';
Expand Down Expand Up @@ -34,7 +34,7 @@ const Model = types
},

get annotation() {
return self.object.annotation;
return getRoot(self)?.annotationStore?.selected;
},

getShape() {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ export const FF_ZOOM_OPTIM = 'fflag_fix_front_leap_32_zoom_perf_190923_short';

export const FF_SAFE_TEXT = 'fflag_fix_leap_466_text_sanitization';

export const FF_MULTI_OBJECT_HOTKEYS = 'fflag_fix_leap_246_multi_object_hotkeys_160124_short';

Object.assign(window, {
APP_SETTINGS: {
...(window.APP_SETTINGS ?? {}),
Expand Down

0 comments on commit 733a30f

Please sign in to comment.