feat: added a new property to hide/unhide webpart

feat: added a new FluentUI based css class to hide webpart
This commit is contained in:
babakdanyal 2023-06-27 14:00:00 +10:00
parent 8665d4665a
commit b7d34c459e
No known key found for this signature in database
28 changed files with 84 additions and 46 deletions

View File

@ -18,6 +18,7 @@ export interface IEnhancedPowerAppsWebPartProps {
height: number;
width: number;
aspectratio: '16:9' | '3:2' | '16:10' | '4:3' | 'Custom';
isWebPartHiddenOnSmallDevices: boolean;
themeValues: string[];
}
export default class EnhancedPowerAppsWebPart extends BaseClientSideWebPart<IEnhancedPowerAppsWebPartProps> {

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerAppsWebPart.d.ts","sourceRoot":"","sources":["../../../src/webparts/enhancedPowerApps/EnhancedPowerAppsWebPart.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,0BAA0B,EAK3B,MAAM,6BAA6B,CAAC;AAMrC;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;GAEG;AACH,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAG3B,MAAM,4BAA4B,CAAC;AAuBpC,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,GAAC,aAAa,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAC,KAAK,GAAC,OAAO,GAAC,KAAK,GAAC,QAAQ,CAAC;IACjD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,qBAAqB,CAAC,8BAA8B,CAAC;IAC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E,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,qBAAqB,CAAC,8BAA8B,CAAC;IACzG,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,aAAa,CAA6B;IAElD,SAAS,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1B,MAAM,IAAI,IAAI;IA6DrB,SAAS,CAAC,SAAS,IAAI,IAAI;uBAIb,WAAW,EAAI,OAAO;IAIpC,SAAS,CAAC,4BAA4B,IAAI,0BAA0B;uBA2ItD,kBAAkB,EAAI,0BAA0B;IAU9D,OAAO,CAAC,YAAY,CAEnB;IAED;;;;KAIC;IACD,OAAO,CAAC,wBAAwB;IAKhC;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAIjD"}

View File

@ -100,6 +100,7 @@ var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
height: clientHeight,
themeVariant: this._themeVariant,
border: this.properties.border,
isWebPartHiddenOnSmallDevices: this.properties.isWebPartHiddenOnSmallDevices,
themeValues: this.properties.themeValues
});
ReactDom.render(element, this.domElement);
@ -139,6 +140,9 @@ var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
PropertyPaneToggle('border', {
label: strings.BorderFieldLabel
}),
PropertyPaneToggle('isWebPartHiddenOnSmallDevices', {
label: strings.IsWebPartHiddenOnSmallDevicesFieldLabel
}),
PropertyPaneChoiceGroup('layout', {
label: strings.LayoutFieldLabel,
options: [
@ -191,7 +195,7 @@ var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
}),
this.properties.layout === "AspectRatio" && this.properties.aspectratio === "Custom" && PropertyPaneTextField('height', {
label: strings.HeightFieldLabel,
}),
})
]
},
{

View File

@ -21,6 +21,7 @@
"properties": {
"layout": 'AspectRatio',
"aspectratio": '16:9',
"isWebPartHiddenOnSmallDevices":false
}
}]
}

View File

@ -24,7 +24,7 @@ var EnhancedPowerApps = /** @class */ (function (_super) {
return _super !== null && _super.apply(this, arguments) || this;
}
EnhancedPowerApps.prototype.render = function () {
var _a = this.props, dynamicProp = _a.dynamicProp, themeVariant = _a.themeVariant, themeValues = _a.themeValues, appWebLink = _a.appWebLink, useDynamicProp = _a.useDynamicProp, dynamicPropName = _a.dynamicPropName, locale = _a.locale, border = _a.border, height = _a.height;
var _a = this.props, dynamicProp = _a.dynamicProp, themeVariant = _a.themeVariant, themeValues = _a.themeValues, appWebLink = _a.appWebLink, useDynamicProp = _a.useDynamicProp, dynamicPropName = _a.dynamicPropName, locale = _a.locale, border = _a.border, isWebPartHiddenOnSmallDevices = _a.isWebPartHiddenOnSmallDevices, height = _a.height;
// The only thing we need for this web part to be configured is an app link or app id
var needConfiguration = !appWebLink;
var semanticColors = themeVariant.semanticColors;
@ -48,7 +48,7 @@ var EnhancedPowerApps = /** @class */ (function (_super) {
}
// Build the frame url
var frameUrl = appUrl + "?source=SPClient-EnhancedPowerAppsWebPart&amp;locale=" + locale + "&amp;enableOnBehalfOf=true&amp;authMode=onbehalfof&amp;hideNavBar=true&amp;" + dynamicPropValue + themeParams + "&locale=" + locale;
return (React.createElement("div", { className: styles.enhancedPowerApps, style: needConfiguration ? { height: "315px" } : { height: height + "px" } },
return (React.createElement("div", { className: isWebPartHiddenOnSmallDevices ? styles.enhancedPowerApps && styles.hideOnMobileDevices : styles.enhancedPowerApps, style: needConfiguration ? { height: "315px" } : { height: height + "px" } },
needConfiguration &&
React.createElement(Placeholder, { iconName: 'PowerApps', iconText: strings.PlaceholderIconText, description: strings.PlaceholderDescription, buttonLabel: strings.PlaceholderButtonLabel, onConfigure: this.props.onConfigure }),
!needConfiguration &&

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerApps.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,i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EAAG,6BAA6B,CAAA,CAAC,CAAA,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC,mBAAmB,CAAA,CAAC,CAAA,MAAM,CAAC,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAC,MAAM,EAAC,OAAO,EAAC,CAAA,CAAC,CAAA,EAAC,MAAM,EAAI,MAAM,OAAI,EAAC;YAC/L,iBAAiB;gBACjB,oBAAC,WAAW,IACZ,QAAQ,EAAC,WAAW,EACpB,QAAQ,EAAE,OAAO,CAAC,mBAAmB,EACrC,WAAW,EAAE,OAAO,CAAC,sBAAsB,EAC3C,WAAW,EAAE,OAAO,CAAC,sBAAsB,EAC3C,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAI;YACtC,CAAC,iBAAiB;gBACnB,0CACC,IAAI,CAAC,KAAK,CAAC,UAAU;oBACvB,gCAAQ,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,IAAI,EAAC,KAAK,EAAC,sDAAsD,EAAC,OAAO,EAAC,gIAAgI,EAC3O,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EACvC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA,CAAC,CAAC,GAAG,GACpB,CAEN,CAEA,CACP,CAAC;IACJ,CAAC;IACH,wBAAC;AAAD,CAAC,AAnED,CAA+C,KAAK,CAAC,SAAS,GAmE7D"}

View File

@ -1,2 +1 @@
.enhancedPowerApps_466fc2fc{color:inherit}.enhancedPowerApps_466fc2fc span[class^=placeholderText_]{font-size:20px!important;font-weight:600!important;color:#323130}.enhancedPowerApps_466fc2fc span[class^=placeholderDescriptionText_]{color:#605e5c!important;margin:20px 0 28px;line-height:23px;font-size:16px!important}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpbGU6Ly8vd29ya3NwYWNlcy9zcC1kZXYtZngtd2VicGFydHMvc2FtcGxlcy9yZWFjdC1lbmhhbmNlZC1wb3dlcmFwcHMvc3JjL3dlYnBhcnRzL2VuaGFuY2VkUG93ZXJBcHBzL2NvbXBvbmVudHMvRW5oYW5jZWRQb3dlckFwcHMubW9kdWxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsNEJBQ0UsTUFBQSxRQU9BLDBEQUNFLFVBQUEsZUFDQSxZQUFBLGNBQ0EsTUFBQSxRQUdGLHFFQUNFLE1BQUEsa0JBQ0EsT0FBQSxLQUFBLEVBQUEsS0FDQSxZQUFBLEtBQ0EsVUFBQSJ9 */
.enhancedPowerApps_dc8a3c45{color:inherit}.enhancedPowerApps_dc8a3c45 span[class^=placeholderText_]{font-size:20px!important;font-weight:600!important;color:#323130}.enhancedPowerApps_dc8a3c45 span[class^=placeholderDescriptionText_]{color:#605e5c!important;margin:20px 0 28px;line-height:23px;font-size:16px!important}@media only screen and (max-width:639.99999px){.hideOnMobileDevices_dc8a3c45{display:none!important}}

View File

@ -1,5 +1,6 @@
declare const styles: {
enhancedPowerApps: string;
hideOnMobileDevices: string;
};
export default styles;
//# sourceMappingURL=EnhancedPowerApps.module.scss.d.ts.map

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerApps.module.scss.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.module.scss.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;CAEX,CAAC;AAEF,eAAe,MAAM,CAAC"}
{"version":3,"file":"EnhancedPowerApps.module.scss.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.module.scss.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;;CAGX,CAAC;AAEF,eAAe,MAAM,CAAC"}

View File

@ -1,7 +1,8 @@
/* tslint:disable */
require("./EnhancedPowerApps.module.css");
var styles = {
enhancedPowerApps: 'enhancedPowerApps_466fc2fc'
enhancedPowerApps: 'enhancedPowerApps_dc8a3c45',
hideOnMobileDevices: 'hideOnMobileDevices_dc8a3c45'
};
export default styles;
/* tslint:enable */

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerApps.module.scss.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.module.scss.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAC1C,IAAM,MAAM,GAAG;IACb,iBAAiB,EAAE,4BAA4B;CAChD,CAAC;AAEF,eAAe,MAAM,CAAC;AACtB,mBAAmB"}
{"version":3,"file":"EnhancedPowerApps.module.scss.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.module.scss.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAC1C,IAAM,MAAM,GAAG;IACb,iBAAiB,EAAE,4BAA4B;IAC/C,mBAAmB,EAAE,8BAA8B;CACpD,CAAC;AAEF,eAAe,MAAM,CAAC;AACtB,mBAAmB"}

View File

@ -41,6 +41,10 @@ export interface IEnhancedPowerAppsProps {
* Whether we show border or not
*/
border: boolean;
/**
* Whether we show webpart or not
*/
isWebPartHiddenOnSmallDevices: boolean;
/**
* Selected theme values to pass to Power Apps
*/

View File

@ -1 +1 @@
{"version":3,"file":"IEnhancedPowerAppsProps.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/IEnhancedPowerAppsProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,EAAE,cAAc,GAAG,SAAS,CAAC;IAEzC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}
{"version":3,"file":"IEnhancedPowerAppsProps.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/IEnhancedPowerAppsProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,EAAE,cAAc,GAAG,SAAS,CAAC;IAEzC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,6BAA6B,EAAE,OAAO,CAAC;IAEvC;;OAEG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}

View File

@ -26,6 +26,7 @@ define([], function() {
PlaceholderIconText: "Enhanced Microsoft Power Apps",
PropertyPaneDescription: "Add a custom business app by pasting its web link or ID below.",
BasicGroupName: "Basic Configuration",
AppWebLinkFieldLabel: "App web link or ID"
AppWebLinkFieldLabel: "App web link or ID",
IsWebPartHiddenOnSmallDevicesFieldLabel: "Hide webpart on mobile devices"
}
});

View File

@ -2939,6 +2939,14 @@
"tslint": "~5.12.1",
"tslint-microsoft-contrib": "~5.2.1",
"typescript": "~3.3.3"
},
"dependencies": {
"typescript": {
"version": "3.3.4000",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz",
"integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==",
"dev": true
}
}
},
"@microsoft/sp-build-core-tasks": {
@ -3715,16 +3723,6 @@
"msal": "1.4.13",
"msalLegacy": "npm:msal@1.4.12",
"tslib": "~1.10.0"
},
"dependencies": {
"msalLegacy": {
"version": "npm:msal@1.4.12",
"resolved": "https://registry.npmjs.org/msal/-/msal-1.4.12.tgz",
"integrity": "sha512-gjupwQ6nvNL6mZkl5NIXyUmZhTiEMRu5giNdgHMh8l5EPOnV2Xj6nukY1NIxFacSTkEYUSDB47Pej9GxDYf+1w==",
"requires": {
"tslib": "^1.9.3"
}
}
}
},
"@microsoft/sp-loader": {
@ -15970,6 +15968,14 @@
"tslib": "^1.9.3"
}
},
"msalLegacy": {
"version": "npm:msal@1.4.12",
"resolved": "https://registry.npmjs.org/msal/-/msal-1.4.12.tgz",
"integrity": "sha512-gjupwQ6nvNL6mZkl5NIXyUmZhTiEMRu5giNdgHMh8l5EPOnV2Xj6nukY1NIxFacSTkEYUSDB47Pej9GxDYf+1w==",
"requires": {
"tslib": "^1.9.3"
}
},
"multicast-dns": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz",
@ -18535,14 +18541,13 @@
"integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao="
},
"react": {
"version": "16.8.5",
"resolved": "https://registry.npmjs.org/react/-/react-16.8.5.tgz",
"integrity": "sha512-daCb9TD6FZGvJ3sg8da1tRAtIuw29PbKZW++NN4wqkbEvxL+bZpaaYb4xuftW/SpXmgacf1skXl/ddX6CdOlDw==",
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz",
"integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.13.5"
"prop-types": "^15.6.2"
}
},
"react-ace": {
@ -21744,9 +21749,9 @@
}
},
"typescript": {
"version": "3.3.4000",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz",
"integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==",
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
"dev": true
},
"ua-parser-js": {

View File

@ -1,6 +1,6 @@
{
"name": "react-enhanced-powerapps",
"version": "1.1.0",
"version": "1.2.0",
"private": true,
"main": "lib/index.js",
"engines": {
@ -21,12 +21,12 @@
"@microsoft/sp-webpart-base": "1.13.1",
"@pnp/spfx-controls-react": "1.19.0",
"@pnp/spfx-property-controls": "1.19.0",
"office-ui-fabric-react": "6.214.0",
"react": "16.8.5",
"react-dom": "16.8.5",
"lodash": ">=4.17.19",
"serialize-javascript": ">=2.1.1",
"lodash.template": ">=4.5.0"
"lodash.template": ">=4.5.0",
"office-ui-fabric-react": "6.214.0",
"react": "^16.13.1",
"react-dom": "16.8.5",
"serialize-javascript": ">=2.1.1"
},
"devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5",
@ -47,6 +47,7 @@
"stylelint-config-css-modules": "^2.2.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.18.0",
"typescript": "^3.9.10",
"webpack-bundle-analyzer": "^3.8.0"
}
}

View File

@ -21,6 +21,7 @@
"properties": {
"layout": 'AspectRatio',
"aspectratio": '16:9',
"isWebPartHiddenOnSmallDevices":false
}
}]
}

View File

@ -59,6 +59,7 @@ export interface IEnhancedPowerAppsWebPartProps {
height: number;
width: number;
aspectratio: '16:9'|'3:2'|'16:10'|'4:3'|'Custom';
isWebPartHiddenOnSmallDevices: boolean;
themeValues: string[];
}
@ -132,6 +133,7 @@ export default class EnhancedPowerAppsWebPart extends BaseClientSideWebPart<IEnh
height: clientHeight,
themeVariant: this._themeVariant,
border: this.properties.border,
isWebPartHiddenOnSmallDevices: this.properties.isWebPartHiddenOnSmallDevices,
themeValues: this.properties.themeValues
}
);
@ -172,6 +174,9 @@ export default class EnhancedPowerAppsWebPart extends BaseClientSideWebPart<IEnh
PropertyPaneToggle('border', {
label: strings.BorderFieldLabel
}),
PropertyPaneToggle('isWebPartHiddenOnSmallDevices', {
label: strings.IsWebPartHiddenOnSmallDevicesFieldLabel
}),
PropertyPaneChoiceGroup('layout', {
label: strings.LayoutFieldLabel,
options: [
@ -224,7 +229,7 @@ export default class EnhancedPowerAppsWebPart extends BaseClientSideWebPart<IEnh
}),
this.properties.layout === "AspectRatio" && this.properties.aspectratio === "Custom" && PropertyPaneTextField('height', {
label: strings.HeightFieldLabel,
}),
})
]
},
{

View File

@ -22,3 +22,9 @@
}
// END
}
.hideOnMobileDevices{
@include ms-screen-md-down {
display: none !important;
}
}

View File

@ -1,7 +1,8 @@
/* tslint:disable */
require("./EnhancedPowerApps.module.css");
const styles = {
enhancedPowerApps: 'enhancedPowerApps_466fc2fc'
enhancedPowerApps: 'enhancedPowerApps_dc8a3c45',
hideOnMobileDevices: 'hideOnMobileDevices_dc8a3c45'
};
export default styles;

View File

@ -26,6 +26,7 @@ export default class EnhancedPowerApps extends React.Component<IEnhancedPowerApp
dynamicPropName,
locale,
border,
isWebPartHiddenOnSmallDevices,
height
} = this.props;
@ -55,13 +56,11 @@ export default class EnhancedPowerApps extends React.Component<IEnhancedPowerApp
}
});
}
// Build the frame url
const frameUrl: string = `${appUrl}?source=SPClient-EnhancedPowerAppsWebPart&amp;locale=${locale}&amp;enableOnBehalfOf=true&amp;authMode=onbehalfof&amp;hideNavBar=true&amp;${dynamicPropValue}${themeParams}&locale=${locale}`;
return (
<div className={ styles.enhancedPowerApps } style={needConfiguration ? {height:`315px`}:{height:`${height}px`}}>
<div className={ isWebPartHiddenOnSmallDevices?styles.enhancedPowerApps && styles.hideOnMobileDevices:styles.enhancedPowerApps} style={needConfiguration ? {height:`315px`}:{height:`${height}px`}}>
{needConfiguration &&
<Placeholder
iconName='PowerApps'
@ -72,7 +71,8 @@ export default class EnhancedPowerApps extends React.Component<IEnhancedPowerApp
{!needConfiguration &&
<>
{ this.props.appWebLink &&
<iframe src={frameUrl} scrolling="no" allow="geolocation *; microphone *; camera *; fullscreen *;" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-forms allow-orientation-lock allow-downloads" width={this.props.width} height={height}
<iframe src={frameUrl} scrolling="no" allow="geolocation *; microphone *; camera *; fullscreen *;" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-forms allow-orientation-lock allow-downloads"
width={this.props.width} height={height}
frameBorder={border ? "1": "0"}
></iframe>
}

View File

@ -54,6 +54,11 @@ export interface IEnhancedPowerAppsProps {
*/
border: boolean;
/**
* Whether we show webpart or not
*/
isWebPartHiddenOnSmallDevices: boolean;
/**
* Selected theme values to pass to Power Apps
*/

View File

@ -26,6 +26,7 @@ define([], function() {
PlaceholderIconText: "Enhanced Microsoft Power Apps",
PropertyPaneDescription: "Add a custom business app by pasting its web link or ID below.",
BasicGroupName: "Basic Configuration",
AppWebLinkFieldLabel: "App web link or ID"
AppWebLinkFieldLabel: "App web link or ID",
IsWebPartHiddenOnSmallDevicesFieldLabel: "Hide webpart on mobile devices"
}
});

View File

@ -26,6 +26,7 @@ declare interface IEnhancedPowerAppsWebPartStrings {
PropertyPaneDescription: string;
BasicGroupName: string;
AppWebLinkFieldLabel: string;
IsWebPartHiddenOnSmallDevicesFieldLabel:string;
}
declare module 'EnhancedPowerAppsWebPartStrings' {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long