Skip to content

Commit

Permalink
feat: add icons for true/false
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Dec 20, 2024
1 parent bd30973 commit 4c38ba5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
8 changes: 1 addition & 7 deletions frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
let crumbs: Array<{ label: string; href: string; icon?: string }> = [];
const disableWorkhopLink = [
'workshop1',
'workshop2',
'workshop3',
'workshop4',
'workshop5',
] // Disable workshops links in breadcrumb
const disableWorkhopLink = ['workshop1', 'workshop2', 'workshop3', 'workshop4', 'workshop5']; // Disable workshops links in breadcrumb
$: {
// Remove zero-length tokens.
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/DetailView/DetailView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
<a href={value} target="_blank" class="anchor">{value}</a>
{:else if ISO_8601_REGEX.test(value) && (key === 'created_at' || key === 'updated_at' || key === 'expiry_date' || key === 'accepted_at' || key === 'rejected_at' || key === 'revoked_at' || key === 'eta')}
{formatDateOrDateTime(value, languageTag())}
{:else if m[toCamelCase((value.str || value.name) ?? value)]}
{:else if m[toCamelCase(value.str || value.name)]}
{safeTranslate((value.str || value.name) ?? value)}
{:else}
{(value.str || value.name) ?? value}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ export const URL_MODEL_MAP: ModelMap = {
{ field: 'risk-origin' },
{ field: 'motivation', valueType: 'number' },
{ field: 'resources', valueType: 'number' },
{ field: 'activity', valueType: 'number' },
{ field: 'activity', valueType: 'number' }
]
},
stakeholders: {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lib/utils/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export function unsafeTranslate(key: string, params = {}, options = {}): string
if (Object.hasOwn(m, toCamelCase(key))) {
return m[toCamelCase(key)](params, options);
}
if (typeof key === 'boolean') {
return key ? '✅' : '❌';
}
}

/**
Expand Down

0 comments on commit 4c38ba5

Please sign in to comment.