Skip to content

Commit de3c4cf

Browse files
committed
Merge remote-tracking branch 'origin/master' into add-collaborator-permission
2 parents be44fe4 + c23f767 commit de3c4cf

File tree

10 files changed

+52
-14
lines changed

10 files changed

+52
-14
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.DS_Store
22
node_modules/
33
bundles/
4+
PIG/index.html
45
PIG/bundles/
6+
production/
7+
Parse-Dashboard/public/index.html
58
Parse-Dashboard/public/bundles/
69
npm-debug.log
710
.eslintcache

PIG/index.html renamed to PIG/index.template.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
<title>PIG Component Explorer</title>
44
<body>
55
<div id="browser_mount"></div>
6-
<script src="/bundles/PIG.bundle.js"></script>
76
</body>
87
</html>

Parse-Dashboard/app.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ module.exports = function(config, options) {
6060
// wait for app to mount in order to get mountpath
6161
app.on('mount', function() {
6262
const mountPath = getMount(app.mountpath);
63+
let dashboardUrl = '';
64+
let loginUrl = '';
65+
66+
// Reads files from public/bundles folder, looking for dashboard.<hash>.js and login.<hash>.js
67+
fs.readdir(path.join(__dirname, 'public', 'bundles'), function(err, items) {
68+
dashboardUrl = items.filter(file => file.indexOf('dashboard.') === 0)[0] || 'dashboard.bundle.js';
69+
loginUrl = items.filter(file => file.indexOf('login.') === 0)[0] || 'login.bundle.js';
70+
});
71+
6372
const users = config.users;
6473
const useEncryptedPasswords = config.useEncryptedPasswords ? true : false;
6574
const authInstance = new Authentication(users, useEncryptedPasswords, mountPath);
@@ -180,7 +189,6 @@ module.exports = function(config, options) {
180189
res.send(`<!DOCTYPE html>
181190
<head>
182191
<link rel="shortcut icon" type="image/x-icon" href="${mountPath}favicon.ico" />
183-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
184192
<base href="${mountPath}"/>
185193
<script>
186194
PARSE_DASHBOARD_PATH = "${mountPath}";
@@ -192,7 +200,7 @@ module.exports = function(config, options) {
192200
<div id="login_mount"></div>
193201
${errors}
194202
<script id="csrf" type="application/json">"${req.csrfToken()}"</script>
195-
<script src="${mountPath}bundles/login.bundle.js"></script>
203+
<script src="${mountPath}bundles/${loginUrl}"></script>
196204
</body>
197205
</html>
198206
`);
@@ -206,7 +214,6 @@ module.exports = function(config, options) {
206214
res.send(`<!DOCTYPE html>
207215
<head>
208216
<link rel="shortcut icon" type="image/x-icon" href="${mountPath}favicon.ico" />
209-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
210217
<base href="${mountPath}"/>
211218
<script>
212219
PARSE_DASHBOARD_PATH = "${mountPath}";
@@ -216,7 +223,7 @@ module.exports = function(config, options) {
216223
<title>Parse Dashboard</title>
217224
<body>
218225
<div id="browser_mount"></div>
219-
<script src="${mountPath}bundles/dashboard.bundle.js"></script>
226+
<script src="${mountPath}bundles/${dashboardUrl}"></script>
220227
<script src="https://static.back4app.com/back4app-navigation.bundle.js"></script>
221228
</body>
222229
</html>

Parse-Dashboard/index.html renamed to Parse-Dashboard/index.template.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
<base href="/"/>
55
<script>
66
PARSE_DASHBOARD_PATH = "/";
7-
console.log('hello')
87
</script>
98
<script src="https://static.back4app.com/back4app-navigation.bundle.js"></script>
10-
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">-->
119
</head>
1210
<html>
1311
<title>Parse Dashboard</title>
1412
<body>
1513
<div id="browser_mount"></div>
16-
<script src="/bundles/dashboard.bundle.js"></script>
1714
<script type="text/javascript">
1815
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
1916
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"cookie-session": "^2.0.0-alpha.1",
4343
"csurf": "^1.9.0",
4444
"express": "^4.13.4",
45+
"html-webpack-plugin": "^3.2.0",
4546
"jquery": "^3.2.1",
4647
"json-file-plus": "^3.2.0",
4748
"lodash": "^4.17.10",
@@ -78,7 +79,7 @@
7879
"js-beautify": "~1.6.14",
7980
"marked": "^0.3.5",
8081
"node-sass": "^4.5.3",
81-
"parse": "1.9.2",
82+
"parse": "git+https://github.com/back4app/Parse-SDK-JS.git",
8283
"prismjs": "~1.6.0",
8384
"react": "^15.0.1",
8485
"react-addons-test-utils": "^15.0.1",

src/dashboard/Settings/SecuritySettings.react.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ export default class SecuritySettings extends DashboardView {
101101
<Field
102102
label={<Label text='File key' description='Use this key when migrating to your own Parse Server to ensure your new server has access to existing files.' />}
103103
input={<KeyField name='File' hidden={true}>{currentApp.fileKey}</KeyField>} />
104-
<Field
105-
label={<Label text='Master key' description='Using this key overrides all permissions. Not usable on client SDKs. Keep it secret!' />}
106-
input={<KeyField name='Master' hidden={true}>{currentApp.masterKey}</KeyField>} />
104+
{(!currentApp.custom.isGDPR || currentApp.custom.forceShowGDPRFields) &&
105+
<Field
106+
label={<Label text='Master key' description='Using this key overrides all permissions. Not usable on client SDKs. Keep it secret!' />}
107+
input={<KeyField name='Master' hidden={true}>{currentApp.masterKey}</KeyField>} />
108+
}
107109
</Fieldset>
108110
{/*<Fieldset legend='Reset Master Key' description='Use this when your key has been compromised.'>*/}
109111
{/*<Field*/}

src/lib/ParseApp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export default class ParseApp {
4444
primaryBackgroundColor,
4545
secondaryBackgroundColor,
4646
supportedPushLocales,
47-
feedbackEmail
47+
feedbackEmail,
48+
custom
4849
}) {
4950
this.name = appName;
5051
this.feedbackEmail = feedbackEmail;
@@ -69,6 +70,7 @@ export default class ParseApp {
6970
this.primaryBackgroundColor=primaryBackgroundColor;
7071
this.secondaryBackgroundColor=secondaryBackgroundColor;
7172
this.supportedPushLocales = supportedPushLocales ? supportedPushLocales : [];
73+
this.custom = custom;
7274

7375
if(!supportedPushLocales) {
7476
console.warn(`Missing push locales for '` + appName + `', see this link for details on setting localizations up. https://github.com/parse-community/parse-dashboard#configuring-localized-push-notifications`);

webpack/PIG.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@
66
* the root directory of this source tree.
77
*/
88
var configuration = require('./base.config.js');
9+
var HtmlWebpackPlugin = require('html-webpack-plugin');
10+
var path = require('path');
911

1012
configuration.entry = {PIG: './parse-interface-guide/index.js'};
1113
configuration.output.path = require('path').resolve('./PIG/bundles');
14+
configuration.output.filename = "[name].[chunkhash].js";
15+
16+
configuration.plugins.push(
17+
new HtmlWebpackPlugin({
18+
template: '../PIG/index.template.html',
19+
filename: path.resolve('./PIG/index.html')
20+
}),
21+
);
1222

1323
module.exports = configuration;

webpack/build.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@
66
* the root directory of this source tree.
77
*/
88
var configuration = require('./base.config.js');
9+
var HtmlWebpackPlugin = require('html-webpack-plugin');
10+
var path = require('path');
911

1012
configuration.entry = {
1113
dashboard: './dashboard/index.js',
1214
login: './login/index.js'
1315
};
1416
configuration.output.path = require('path').resolve('./Parse-Dashboard/public/bundles');
17+
configuration.output.filename = "[name].[chunkhash].js";
18+
19+
configuration.plugins.push(
20+
new HtmlWebpackPlugin({
21+
template: '../Parse-Dashboard/index.template.html',
22+
filename: path.resolve('./Parse-Dashboard/public/index.html')
23+
})
24+
);
1525

1626
module.exports = configuration;

webpack/publish.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
* the root directory of this source tree.
77
*/
88
var configuration = require('./base.config.js');
9+
var HtmlWebpackPlugin = require('html-webpack-plugin');
10+
var path = require('path');
911

1012
configuration.entry = {
1113
dashboard: './dashboard/index.js',
1214
login: './login/index.js'
1315
};
14-
configuration.output.path = require('path').resolve('./Parse-Dashboard/public/bundles');
16+
configuration.output.path = path.resolve('./Parse-Dashboard/public/bundles');
17+
configuration.output.filename = "[name].[chunkhash].js";
1518

1619
var webpack = require('webpack');
1720

@@ -28,6 +31,10 @@ configuration.plugins.push(
2831
}
2932
}),
3033
new webpack.optimize.OccurrenceOrderPlugin(),
34+
new HtmlWebpackPlugin({
35+
template: '../Parse-Dashboard/index.template.html',
36+
filename: path.resolve('./Parse-Dashboard/public/index.html')
37+
}),
3138
function() {
3239
this.plugin('done', function(stats) {
3340
if (stats.compilation.errors && stats.compilation.errors.length) {

0 commit comments

Comments
 (0)