Merge pull request #1311 from joelfmrodrigues/workbench-full-width

This commit is contained in:
Hugo Bernier 2020-06-07 12:03:13 -04:00 committed by GitHub
commit 0fb657b081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7320 additions and 6101 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
"properties": {
"requiresPageRefresh": false,
"customWorkbenchStyles": true,
"customWorkbenchStylesFullWidth": false,
"previewMode": true
}
}]

View File

@ -8,6 +8,7 @@ import * as strings from 'WorkbenchCustomizerWebPartStrings';
export interface IWorkbenchCustomizerWebPartProps {
requiresPageRefresh: boolean;
customWorkbenchStyles: boolean;
customWorkbenchStylesFullWidth: boolean;
previewMode: boolean;
}
@ -26,6 +27,10 @@ export default class WorkbenchCustomizerWebPart extends BaseClientSideWebPart<IW
await import('./styles/customWorkbenchStyles.module.scss');
}
if (this.properties.customWorkbenchStyles && this.properties.customWorkbenchStylesFullWidth) {
await import('./styles/customWorkbenchStylesFullWidth.module.scss');
}
if (this.properties.previewMode) {
const previewBtn = document.getElementsByName("Preview")[0];
previewBtn.click();
@ -68,6 +73,10 @@ export default class WorkbenchCustomizerWebPart extends BaseClientSideWebPart<IW
PropertyPaneToggle('customWorkbenchStyles', {
label: strings.CustomWorkbenchStylesFieldLabel
}),
PropertyPaneToggle('customWorkbenchStylesFullWidth', {
label: strings.customWorkbenchStylesFullWidthFieldLabel,
disabled: !this.properties.customWorkbenchStyles
}),
PropertyPaneToggle('previewMode', {
label: strings.PreviewModeFieldLabel
})

View File

@ -1,8 +1,9 @@
define([], function() {
return {
"PropertyPaneDescription": "Description",
"PropertyPaneDescription": "Web part that can customize the behaviour of the workbench page to work around some of the existing limitations. It's recommended that you refresh the page after changing web part properties.",
"BasicGroupName": "Configuration",
"CustomWorkbenchStylesFieldLabel": "Enable custom styles for Workbench",
"customWorkbenchStylesFullWidthFieldLabel": "Enable custom styles for full-width",
"PreviewModeFieldLabel": "Enable Preview mode by default",
}
});

View File

@ -2,6 +2,7 @@ declare interface IWorkbenchCustomizerWebPartStrings {
PropertyPaneDescription: string;
BasicGroupName: string;
CustomWorkbenchStylesFieldLabel: string;
customWorkbenchStylesFullWidthFieldLabel: string;
PreviewModeFieldLabel: string;
}

View File

@ -1,5 +1,4 @@
:global #workbenchPageContent {
// max-width: 1316px;
max-width: 100%;
left: 0;
right: 0;

View File

@ -0,0 +1,24 @@
:global #workbenchPageContent {
& > div {
& > div {
& > div {
.CanvasComponent {
.CanvasZone {
max-width: 100%;
padding-left: 0;
padding-right: 0;
.CanvasSection {
padding-left: 0;
padding-right: 0;
.ControlZone {
padding: 0;
}
}
}
}
}
}
}
}