Skip to content

Commit

Permalink
Merge branch 'develop' into feat/v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
damianpumar committed May 27, 2024
2 parents c47c6c2 + c701642 commit a92d10f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ export class SpanSelection {

const newSelection = { ...selection };

const filteredSelections = this.selections.filter(
(s) => s.node.id === newSelection.node.id
);

if (!config?.allowCharacter) {
if (this.isEmpty(newSelection.text)) return;

Expand All @@ -78,22 +74,6 @@ export class SpanSelection {
this.completeRightSide(newSelection);
}

const overlaps = this.selections.filter((s) => {
return (
(newSelection.from <= s.from && newSelection.to >= s.to) ||
(newSelection.from >= s.from && newSelection.to <= s.to) ||
(newSelection.from < s.from && newSelection.to > s.from) ||
(newSelection.from < s.to && newSelection.to > s.to)
);
});

if (!config?.allowOverlap) {
this.selections = [
...this.selections.filter((s) => s.node.id !== newSelection.node.id),
...filteredSelections.filter((s) => !overlaps.includes(s)),
];
}

const { from, to, entity, text, node } = newSelection;

const span = {
Expand All @@ -115,6 +95,26 @@ export class SpanSelection {

if (!span) return;

const filteredSelections = this.selections.filter(
(s) => s.node.id === span.node.id
);

const overlaps = this.selections.filter((s) => {
return (
(span.from <= s.from && span.to >= s.to) ||
(span.from >= s.from && span.to <= s.to) ||
(span.from < s.from && span.to > s.from) ||
(span.from < s.to && span.to > s.to)
);
});

if (!config?.allowOverlap) {
this.selections = [
...this.selections.filter((s) => s.node.id !== span.node.id),
...filteredSelections.filter((s) => !overlaps.includes(s)),
];
}

this.select(span);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { settingsFake, settingsFakeWith12Elements } from "../ranking-fakes";

let wrapper = null;
const options = {
stubs: ["draggable"],
stubs: ["draggable", "BaseTooltip"],
propsData: { ranking: {} },
};

Expand Down
5 changes: 3 additions & 2 deletions argilla/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ These are the section headers that we use:

### Fixed

- Fix issue when record does not have vectors related ([#4856](https://github.com/argilla-io/argilla/pull/4856))
- Fix issue on character level ([#4836](https://github.com/argilla-io/argilla/pull/4836))
- Fix wildcard import for the whole argilla module. ([#4874](https://github.com/argilla-io/argilla/pull/4874))
- Fix issue when record does not have vectors related. ([#4856](https://github.com/argilla-io/argilla/pull/4856))
- Fix issue on character level. ([#4836](https://github.com/argilla-io/argilla/pull/4836))

## [1.28.0](https://github.com/argilla-io/argilla/compare/v1.27.0...v1.28.0)

Expand Down
1 change: 0 additions & 1 deletion argilla/src/argilla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
"TextClassificationSettings",
"TokenClassificationSettings",
],
"server.app": ["app"],
}

_sys.modules[__name__] = _LazyargillaModule(
Expand Down

0 comments on commit a92d10f

Please sign in to comment.