Skip to content

Commit

Permalink
Add URL support for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Oct 29, 2024
1 parent b2e4404 commit 33e330d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/frontend/src/components/nav/NotificationDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function NotificationEntry({
let model_info = ModelInformationDict[model_type as ModelType];
if (model_info?.url_detail && model_id) {
link = getDetailUrl(model_type as ModelType, model_id);
} else if (model_info?.url_overview) {
link = model_info.url_overview;
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/components/render/ModelType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ export const ModelInformationDict: ModelDict = {
label: () => t`Content Type`,
label_multiple: () => t`Content Types`,
api_endpoint: ApiEndpoints.content_type_list
},
error: {
label: () => t`Error`,
label_multiple: () => t`Errors`,
api_endpoint: ApiEndpoints.error_report_list,
url_overview: '/settings/admin/errors'
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/enums/ModelType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ export enum ModelType {
reporttemplate = 'reporttemplate',
labeltemplate = 'labeltemplate',
pluginconfig = 'pluginconfig',
contenttype = 'contenttype'
contenttype = 'contenttype',
error = 'error'
}

0 comments on commit 33e330d

Please sign in to comment.