Skip to content

🔥 Fix highlight on bulk #5698

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

Merged
merged 1 commit into from
Nov 22, 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
<SpanAnnotationTextField
v-if="hasSpanQuestion(name)"
:id="`${id}-${record.id}-span-field`"
:id="`${id}-${record.id}`"
:name="name"
:title="title"
:fieldText="content"
Expand All @@ -26,7 +26,7 @@
/>
<TextField
v-else-if="isTextType"
:name="name"
:id="`${id}-${record.id}`"
:title="title"
:fieldText="content"
:useMarkdown="settings.use_markdown"
Expand All @@ -35,7 +35,7 @@
/>
<ChatField
v-else-if="isChatType"
:name="name"
:id="`${id}-${record.id}`"
:title="title"
:useMarkdown="settings.use_markdown"
:content="content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="chat" :key="title">
<span class="chat__title" v-text="title" />
<div
:id="`fields-content-${name}`"
:id="`fields-content-${id}`"
class="chat__wrapper"
:class="checkIfAreLessThanTwoRoles ? '--simple' : '--multiple'"
>
Expand Down Expand Up @@ -32,8 +32,8 @@
>
<MarkdownRenderer v-if="useMarkdown" :markdown="text" />
<span v-else v-html="text" /><template>
<style :key="name" scoped>
::highlight(search-text-highlight-{{name}}) {
<style :key="id" scoped>
::highlight(search-text-highlight-{{id}}) {
color: #ff675f;
}
</style>
Expand All @@ -47,9 +47,10 @@

<script>
import { useChatFieldViewModel } from "./useChatFieldViewModel";

export default {
props: {
name: {
id: {
type: String,
required: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { onMounted, watch } from "vue-demi";
import { useSearchTextHighlight } from "../useSearchTextHighlight";

export const useChatFieldViewModel = (props: {
name: string;
id: string;
searchText: string;
}) => {
const { highlightText } = useSearchTextHighlight(props.name);
const { highlightText } = useSearchTextHighlight(props.id);

watch(
() => props.searchText,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
class="text_field_component"
:key="name"
:key="id"
@mouseenter.stop="mouseEnter = true"
@mouseleave.stop="mouseEnter = false"
aria-label="Data Record Field"
Expand Down Expand Up @@ -35,7 +35,7 @@
</BaseActionTooltip>
</div>
<div
:id="`fields-content-${name}`"
:id="`fields-content-${id}`"
class="text_field_component__area --body1"
:aria-label="'Data entry for Field: ' + title"
>
Expand Down Expand Up @@ -97,7 +97,7 @@
[data-theme="dark"] .span-annotation__field--overlapped::highlight(hl-{{id}}-hover) {
background: {{color.palette.veryDark}};
}
::highlight(search-text-highlight-{{name}}) {
::highlight(search-text-highlight-{{id}}) {
color: #ff675f;
}
</style>
Expand All @@ -110,16 +110,11 @@
<script>
import { useSpanAnnotationTextFieldViewModel } from "./useSpanAnnotationTextFieldViewModel";
export default {
name: "SpanAnnotationTextField",
props: {
id: {
type: String,
required: true,
},
name: {
type: String,
required: true,
},
title: {
type: String,
required: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import { SpanQuestionAnswer } from "~/v1/domain/entities/question/QuestionAnswer
import { SpanAnswer } from "~/v1/domain/entities/IAnswer";

export const useSpanAnnotationTextFieldViewModel = (props: {
name: string;
spanQuestion: Question;
id: string;
searchText: string;
}) => {
const { name, spanQuestion, id } = props;
const searchTextHighlight = useSearchTextHighlight(name);
const { spanQuestion, id } = props;
const searchTextHighlight = useSearchTextHighlight(id);
const spanAnnotationSupported = ref(true);
const answer = spanQuestion.answer as SpanQuestionAnswer;
const initialConfiguration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
</BaseButton>
</BaseActionTooltip>
</div>
<div :id="`fields-content-${name}`" class="content-area --body1">
<div :id="`fields-content-${id}`" class="content-area --body1">
<MarkdownRenderer v-if="useMarkdown" :markdown="fieldText" />
<Sandbox v-else-if="isHTML" :content="fieldText" />
<div v-else :class="classes" v-html="fieldText" />
<template>
<style :key="name" scoped>
::highlight(search-text-highlight-{{name}}) {
<style :key="id" scoped>
::highlight(search-text-highlight-{{id}}) {
color: #ff675f;
}
</style>
Expand All @@ -36,7 +36,7 @@ import { useTextFieldViewModel } from "./useTextFieldViewModel";

export default {
props: {
name: {
id: {
type: String,
required: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { onMounted, watch } from "vue-demi";
import { useSearchTextHighlight } from "../useSearchTextHighlight";

export const useTextFieldViewModel = (props: {
name: string;
id: string;
searchText: string;
}) => {
const { highlightText } = useSearchTextHighlight(props.name);
const { highlightText } = useSearchTextHighlight(props.id);

watch(
() => props.searchText,
Expand Down
Loading