Skip to content

Commit 88d0d80

Browse files
Add properties for setting ListItemAttachments labels
1 parent c91987a commit 88d0d80

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

docs/documentation/docs/controls/ListItemAttachments.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ The `ListItemAttachments` control can be configured with the following propertie
5959
| itemId | number | no | List Item Id |
6060
| listId | string | yes | Guid of the list. |
6161
| webUrl | string | no | URL of the site. By default it uses the current site URL. |
62+
| label | string | no | Main text to display on the placeholder, next to the icon. |
63+
| description | string | no | Description text to display on the placeholder, below the main text and icon. |
6264
| disabled | boolean | no | Specifies if the control is disabled or not. |
6365
| openAttachmentsInNewWindow | boolean | no | Specifies if the attachment should be openend in a separate browser tab. Use this property set to `true` if you plan to use the component in Microsoft Teams. |
6466

src/controls/listItemAttachments/IListItemAttachmentsProps.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@ export interface IListItemAttachmentsProps {
88
disabled?: boolean;
99
context: BaseComponentContext;
1010
openAttachmentsInNewWindow?: boolean; // JJ - 20200613 - needed to support Microsoft Teams
11+
/**
12+
* Main text to display on the placeholder, next to the icon
13+
*/
14+
label?:string;
15+
/**
16+
* Description text to display on the placeholder, below the main text and icon
17+
*/
18+
description?:string;
1119
}

src/controls/listItemAttachments/ListItemAttachments.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ export class ListItemAttachments extends React.Component<IListItemAttachmentsPro
255255
this.state.showPlaceHolder ?
256256
<Placeholder
257257
iconName='Upload'
258-
iconText={strings.ListItemAttachmentslPlaceHolderIconText}
259-
description={strings.ListItemAttachmentslPlaceHolderDescription}
258+
iconText={this.props.label || strings.ListItemAttachmentslPlaceHolderIconText}
259+
description={this.props.description || strings.ListItemAttachmentslPlaceHolderDescription}
260260
buttonLabel={strings.ListItemAttachmentslPlaceHolderButtonLabel}
261261
hideButton={this.props.disabled}
262262
onConfigure={() => this.setState({ fireUpload: true })} />

0 commit comments

Comments
 (0)