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

LWS-145: Remove freetext label and add quotes instead #1074

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 12 additions & 0 deletions lxl-web/src/lib/components/find/SearchMapping.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
class="mapping-item {m.children ? 'pill-group' : 'pill'} pill-{m.operator}"
class:wildcard={m.operator === 'equals' && m.display === '*'}
class:outer={depth === 0}
class:free-text={m?.['@id'] === 'https://id.kb.se/vocab/textQuery'}
>
{#if 'children' in m}
<svelte:self mapping={m.children} parentOperator={m.operator} depth={depth + 1} />
Expand Down Expand Up @@ -162,4 +163,15 @@
.pill-between:last-of-type {
@apply hidden;
}

.free-text {
& > .pill-label {
display: none;
}

& > .pill-value::before,
& > .pill-value::after {
content: '"';
}
}
</style>
5 changes: 4 additions & 1 deletion lxl-web/src/lib/types/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface MultiSelectFacet extends Facet {
}

export interface DisplayMapping {
'@id'?: string;
display?: DisplayDecorated;
up?: Link;
children?: DisplayMapping[];
Expand Down Expand Up @@ -126,7 +127,9 @@ export interface SearchMapping extends MappingObj {
up: { '@id': string };
}

interface ObjectProperty {}
interface ObjectProperty {
'@id'?: string;
}

export interface DatatypeProperty {
'@type': 'DataTypeProperty';
Expand Down
1 change: 1 addition & 0 deletions lxl-web/src/lib/utils/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function displayMappings(
if ('property' in m && operator) {
const property = m[operator] as FramedData;
return {
...(isObject(m.property) && { '@id': m.property['@id'] }),
display: displayUtil.lensAndFormat(property, LensType.Chip, locale),
label: m.alias
? translate(`facet.${m.alias}`)
Expand Down
Loading