Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated visibility of controls in the ControlsTest web part #1929

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/webparts/controlsTest/IControlsTestWebPartProps.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export type ValidControls = "all" |
"accessibleAccordion" | "adaptiveCardDesignerHost" | "adaptiveCardHost" |
"animatedDialog" | "Carousel" | "ChartControl" |
"ComboBoxListItemPicker" | "Dashboard" | "DateTimePicker" |
"DragDropFiles" | "DynamicForm" | "EnhancedThemeProvider" |
"FieldCollectionData" | "FieldPicker" | "FilePicker" |
export type ValidControls = "all" |
"accessibleAccordion" | "adaptiveCardDesignerHost" | "adaptiveCardHost" |
"animatedDialog" | "Carousel" | "ChartControl" |
"ComboBoxListItemPicker" | "Dashboard" | "DateTimePicker" |
"DragDropFiles" | "DynamicForm" | "EnhancedThemeProvider" |
"FieldCollectionData" | "FieldPicker" | "FilePicker" |
"FileTypeIcon" | "FolderExplorer" | "FolderPicker" |
"GridLayout" | "IconPicker" | "IFrameDialog" |
"IFramePanel" | "ListPicker" | "ListItemPicker" |
"IFramePanel" | "ListPicker" | "ListItemAttachments" | "ListItemPicker" |
"ListItemComments" | "ViewPicker" | "ListView" |
"LocationPicker" | "Map" | "ModernAudio" |
"ModernTaxonomyPicker" | "Pagination" | "PeoplePicker" |
Expand Down
2 changes: 2 additions & 0 deletions src/webparts/controlsTest/components/ControlsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
<div className={`${styles.row} ${styles.controlFiltersContainer}`}>
<PrimaryButton text="Open Web Part Settings" iconProps={{ iconName: 'Settings' }} onClick={this.props.onOpenPropertyPane} />
</div>
</div>
<div id="ListItemAttachmentsDiv" className={styles.container} hidden={!controlVisibility.ListItemAttachments}>
<ListItemAttachments listId='e7a3ef63-70f6-4cc1-b95c-1f9eb8af2c8c' context={this.props.context} />
</div>
<div id="WebPartTitleDiv" className={styles.container} hidden={!controlVisibility.WebPartTitle}>
Expand Down
24 changes: 12 additions & 12 deletions src/webparts/controlsTest/propertyPane/controls/ControlToggles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export class ControlToggles extends React.Component<IControlTogglesProps, IContr
return null;
}
return (
<Toggle
key={control}
label={this.getProperCase(control)}
<Toggle
key={control}
label={this.getProperCase(control)}
checked={this.props.controlVisibility && this.props.controlVisibility[control] || false}
onChange={(e, checked) => {
this.props.onChange(control, checked);
}}
}}
/>
);
}) }
Expand All @@ -48,15 +48,15 @@ export class ControlToggles extends React.Component<IControlTogglesProps, IContr

private getValidControls(): string[] {
const validControls: ValidControls[] = [
"all",
"accessibleAccordion", "adaptiveCardDesignerHost", "adaptiveCardHost",
"animatedDialog", "Carousel", "ChartControl",
"ComboBoxListItemPicker", "Dashboard", "DateTimePicker",
"DragDropFiles", "DynamicForm", "EnhancedThemeProvider",
"FieldCollectionData", "FieldPicker", "FilePicker",
"all",
"accessibleAccordion", "adaptiveCardDesignerHost", "adaptiveCardHost",
"animatedDialog", "Carousel", "ChartControl",
"ComboBoxListItemPicker", "Dashboard", "DateTimePicker",
"DragDropFiles", "DynamicForm", "EnhancedThemeProvider",
"FieldCollectionData", "FieldPicker", "FilePicker",
"FileTypeIcon", "FolderExplorer", "FolderPicker",
"GridLayout", "IconPicker", "IFrameDialog",
"IFramePanel", "ListPicker", "ListItemPicker",
"IFramePanel", "ListPicker", "ListItemAttachments","ListItemPicker",
"ListItemComments", "ViewPicker", "ListView",
"LocationPicker", "Map", "ModernAudio",
"ModernTaxonomyPicker", "Pagination", "PeoplePicker",
Expand All @@ -74,4 +74,4 @@ export class ControlToggles extends React.Component<IControlTogglesProps, IContr
name = name.replace(/^([a-z])/, (match, p1) => p1.toUpperCase());
return name;
}
}
}
Loading