From 09102047c17116aedf3692755f095776cd5577ce Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 28 Mar 2021 00:28:07 +0300 Subject: [PATCH] [DE mobile] load private functions patch --- apps/documenteditor/mobile/src/controller/Main.jsx | 3 +++ apps/documenteditor/mobile/src/lib/patch.jsx | 10 ++++++++++ vendor/framework7-react/build/webpack.config.js | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 apps/documenteditor/mobile/src/lib/patch.jsx diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 564edf439..53d23e567 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -13,6 +13,8 @@ import { ViewCommentsController } from "../../../../common/mobile/lib/controller/collaboration/Comments"; +import patch from '../lib/patch' + @inject( "storeAppOptions", "storeDocumentSettings", @@ -56,6 +58,7 @@ class MainController extends Component { }; const loadConfig = data => { + patch.isSupportEditFeature(); console.log('load config'); this.editorConfig = Object.assign({}, this.editorConfig, data.config); diff --git a/apps/documenteditor/mobile/src/lib/patch.jsx b/apps/documenteditor/mobile/src/lib/patch.jsx new file mode 100644 index 000000000..89603acd7 --- /dev/null +++ b/apps/documenteditor/mobile/src/lib/patch.jsx @@ -0,0 +1,10 @@ + +const patch = () => { + return null +}; + +patch.isSupportEditFeature = () => { + return false +}; + +export default patch; diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js index ae3ee3a13..ea3bc262f 100644 --- a/vendor/framework7-react/build/webpack.config.js +++ b/vendor/framework7-react/build/webpack.config.js @@ -7,6 +7,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const WorkboxPlugin = require('workbox-webpack-plugin'); +const fs = require('fs') const path = require('path'); @@ -18,6 +19,7 @@ const env = process.env.NODE_ENV || 'development'; const target = process.env.TARGET || 'web'; const editor = process.env.TARGET_EDITOR == 'cell' ? 'spreadsheeteditor' : process.env.TARGET_EDITOR == 'slide' ? 'presentationeditor' : 'documenteditor'; +const targetPatch = process.env.TARGET_EDITOR || 'word'; module.exports = { mode: env, @@ -206,5 +208,10 @@ module.exports = { }, ], }), + new webpack.NormalModuleReplacementPlugin( + /\.{2}\/lib\/patch/, + resource => fs.existsSync(`../../../web-apps-mobile/${targetPatch}/patch.jsx`) ? + resource.request = `../../../../../../web-apps-mobile/${targetPatch}/patch.jsx` : resource + ), ], }; \ No newline at end of file