Skip to content

Commit

Permalink
LWS-145: Remove freetext label and add quotes instead (#1074)
Browse files Browse the repository at this point in the history
* Remove freetext label and add quotes instead

* Skip redundant conditional check

* Update changelog
  • Loading branch information
johanbissemattsson authored Jun 26, 2024
1 parent b0f1c89 commit 2801596
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
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
4 changes: 4 additions & 0 deletions lxl-web/src/routes/(app)/[[lang=lang]]/help/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ title: 'Hjälp'

Here we will continuously provide information about newly added features and planned developments:

### 2024-06-26

- Hide labels for free text queries and add quotes instead

### 2024-06-12

- Improved help text
Expand Down
4 changes: 4 additions & 0 deletions lxl-web/src/routes/(app)/[[lang=lang]]/help/sv.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ title: 'Hjälp'

Här kommer vi kontinuerligt berätta om nytillkomna funktioner och planerad utveckling:

### 2024-06-26

- Dölj etikett för fritext-sökningar och lägg till citattecken istället

### 2024-06-12

- Förbättrad hjälptext
Expand Down

0 comments on commit 2801596

Please sign in to comment.