Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[Files] Added description to Files management UI (elastic#145577)
Browse files Browse the repository at this point in the history
## Summary

<img width="474" alt="Screenshot 2022-11-17 at 15 52 12"
src="https://user-images.githubusercontent.com/8155004/202479188-9d728af7-5895-41f5-85dd-e5032ca74968.png">

Original context:
elastic#144425 (comment)
  • Loading branch information
jloleysens authored Nov 18, 2022
1 parent 0b6de4b commit 193b4ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface Props<T extends UserContentCommonSchema = UserContentCommonSche
entityName: string;
entityNamePlural: string;
tableListTitle: string;
tableListDescription?: string;
listingLimit: number;
initialFilter?: string;
initialPageSize: number;
Expand Down Expand Up @@ -133,6 +134,7 @@ const ast = Ast.create([]);

function TableListViewComp<T extends UserContentCommonSchema>({
tableListTitle,
tableListDescription,
entityName,
entityNamePlural,
initialFilter: initialQuery,
Expand Down Expand Up @@ -592,6 +594,7 @@ function TableListViewComp<T extends UserContentCommonSchema>({
<PageTemplate panelled data-test-subj={pageDataTestSubject}>
<KibanaPageTemplate.Header
pageTitle={<span id={headingId}>{tableListTitle}</span>}
description={tableListDescription}
rightSideItems={[
renderCreateButton() ?? <span />,
...additionalRightSideActions?.slice(0, 2),
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/files_management/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const App: FunctionComponent = () => {
return (
<>
<TableListView<FilesUserContentSchema>
tableListTitle={i18nTexts.tableListTitle}
tableListDescription={i18nTexts.tableListDescription}
titleColumnName={i18nTexts.titleColumnName}
emptyPrompt={<EmptyPrompt />}
entityName={i18nTexts.entityName}
Expand Down Expand Up @@ -59,7 +61,6 @@ export const App: FunctionComponent = () => {
initialFilter=""
initialPageSize={50}
listingLimit={1000}
tableListTitle={i18nTexts.tableListTitle}
onClickTitle={({ attributes }) => setSelectedFile(attributes as unknown as FileJSON)}
deleteItems={async (items) => {
await filesClient.bulkDelete({ ids: items.map(({ id }) => id) });
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/files_management/public/i18n_texts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import { FileStatus } from '@kbn/files-plugin/common';
import { i18n } from '@kbn/i18n';

export const i18nTexts = {
tableListTitle: i18n.translate('filesManagement.table.title', { defaultMessage: 'Files' }),
tableListDescription: i18n.translate('filesManagement.table.description', {
defaultMessage: 'Manage files stored in Kibana.',
}),
titleColumnName: i18n.translate('filesManagement.table.titleColumnName', {
defaultMessage: 'Name',
}),
tableListTitle: i18n.translate('filesManagement.table.title', { defaultMessage: 'Files' }),
entityName: i18n.translate('filesManagement.entityName.title', { defaultMessage: 'file' }),
retry: i18n.translate('filesManagement.button.retry', {
defaultMessage: 'Retry',
Expand Down

0 comments on commit 193b4ec

Please sign in to comment.