Skip to content

Commit 5c841af

Browse files
committed
fix: OU-1195 translations and optional chaining
1 parent d6f3b6d commit 5c841af

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

web/locales/en/plugin__monitoring-plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,11 @@
186186
"Dashboard name is required": "Dashboard name is required",
187187
"Failed to create dashboard. Please try again.": "Failed to create dashboard. Please try again.",
188188
"Create": "Create",
189-
"Create button is disabled because you do not have permission": "Create button is disabled because you do not have permission",
189+
"You don't have permissions to create dashboards": "You don't have permissions to create dashboards",
190190
"Create Dashboard": "Create Dashboard",
191191
"Select project": "Select project",
192192
"Select a project": "Select a project",
193+
"No project found for \"{{filter}}\"": "No project found for \"{{filter}}\"",
193194
"my-new-dashboard": "my-new-dashboard",
194195
"Creating...": "Creating...",
195196
"View and manage dashboards.": "View and manage dashboards.",

web/src/components/dashboards/perses/dashboard-create-dialog.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export const DashboardCreateDialog: React.FunctionComponent = () => {
172172
return (
173173
<>
174174
{disabled ? (
175-
<Tooltip content={t('Create button is disabled because you do not have permission')}>
175+
<Tooltip content={t("You don't have permissions to create dashboards")}>
176176
<span style={{ cursor: 'not-allowed' }}>
177177
<CreateBtn />
178178
</span>
@@ -222,7 +222,9 @@ export const DashboardCreateDialog: React.FunctionComponent = () => {
222222
key={selectedProject || 'no-selection'}
223223
initialOptions={projectOptions}
224224
placeholder={t('Select a project')}
225-
noOptionsFoundMessage={(filter) => t(`No project found for "${filter}"`)}
225+
noOptionsFoundMessage={(filter) =>
226+
t('No project found for "{{filter}}"', { filter })
227+
}
226228
onClearSelection={() => {
227229
setSelectedProject(null);
228230
}}

web/src/components/dashboards/perses/hooks/useEditableProjects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const combinePersesAndOcpProjects = (
2121
): string[] => {
2222
const persesProjectNames = Object.keys(persesUserPermissions).filter((name) => name !== '*');
2323
const allAvailableProjects = new Set<string>([...persesProjectNames]);
24-
ocpProjects?.forEach((project) => {
24+
ocpProjects.forEach((project) => {
2525
if (project.metadata?.name) {
2626
allAvailableProjects.add(project.metadata.name);
2727
}

0 commit comments

Comments
 (0)