Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 109ebcc

Browse files
committed
adapt nova:debug to Apollo version + link to docs
1 parent c33ebd5 commit 109ebcc

3 files changed

Lines changed: 36 additions & 47 deletions

File tree

packages/nova-debug/lib/components/Cheatsheet.jsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Comments from "meteor/nova:comments";
44
import Users from 'meteor/nova:users';
55
import { Callbacks, Utils, registerComponent } from 'meteor/nova:core';
66

7-
const methodList = Meteor.isServer ? Meteor.server.method_handlers : Meteor.connection._methodHandlers;
87

98
const renderFunction = (func, name) => {
109
const s = func.toString();
@@ -48,10 +47,6 @@ const Cheatsheet = props => {
4847
<ul>
4948
{_.map(Users.is, renderFunction)}
5049
</ul>
51-
<h3>Methods</h3>
52-
<ul>
53-
{_.map(methodList, (item, key) => (key.indexOf("users.") !== -1 ? renderFunction(item, key) : null))}
54-
</ul>
5550
</div>
5651

5752
<div className="cheatsheet-block">
@@ -60,10 +55,6 @@ const Cheatsheet = props => {
6055
<ul>
6156
{_.map(Posts, (item, key) => (key[0] !== "_" ? renderFunction(item, key) : null) )}
6257
</ul>
63-
<h3>Methods</h3>
64-
<ul>
65-
{_.map(methodList, (item, key) => (key.indexOf("posts.") !== -1 ? renderFunction(item, key) : null))}
66-
</ul>
6758
</div>
6859

6960
<div className="cheatsheet-block">
@@ -72,10 +63,6 @@ const Cheatsheet = props => {
7263
<ul>
7364
{_.map(Comments, (item, key) => (key[0] !== "_" ? renderFunction(item, key) : null) )}
7465
</ul>
75-
<h3>Methods</h3>
76-
<ul>
77-
{_.map(methodList, (item, key) => (key.indexOf("comments.") !== -1 ? renderFunction(item, key) : null))}
78-
</ul>
7966
</div>
8067

8168
<div className="cheatsheet-block">

packages/nova-debug/lib/components/Groups.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Group = ({name, actions}) => {
66
return (
77
<tr>
88
<td>{name}</td>
9-
<td><ul>{actions.map(action => <li><code>{action}</code></li>)}</ul></td>
9+
<td><ul>{actions.map((action, index) => <li key={index}><code>{action}</code></li>)}</ul></td>
1010
</tr>
1111
)
1212
}
Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
import React from 'react';
2-
import { getSetting, registerComponent } from 'meteor/nova:core';
2+
import { FormattedMessage } from 'react-intl';
3+
import { getSetting, registerComponent, Components } from 'meteor/nova:core';
34

4-
const renderSetting = (field, key) => {
5-
return (
6-
<tr key={key}>
7-
<td><code>{key}</code></td>
8-
<td>{field.type && field.type.name}</td>
9-
<td>{field.private ? <span className="private">private</span> : getSetting(key)}</td>
10-
<td>{field.defaultValue && field.defaultValue.toString()}</td>
11-
<td>{field.form && field.form.instructions}</td>
12-
</tr>
13-
)
14-
}
5+
const renderSetting = key => (
6+
<tr key={key}>
7+
<td><code>{key}</code></td>
8+
<td>{JSON.stringify(getSetting(key))}</td>
9+
</tr>
10+
);
1511

1612
const Settings = props => {
13+
14+
const publicSettings = Meteor.settings.public;
15+
1716
return (
18-
<div className="settings">
19-
<h1>Settings</h1>
20-
21-
<div className="settings-wrapper">
17+
<Components.ShowIf check={user => user && user.isAdmin} failureComponent={<FormattedMessage id="app.noPermission" />}>
18+
<div className="settings">
19+
20+
<h1>Public settings</h1>
21+
22+
<div>To access your private settings, have a look at your <code>settings.json</code> file.</div>
23+
24+
<div>More info about settings <a href="http://nova-docs.telescopeapp.org/settings.html">in the docs</a></div>
25+
26+
<div className="settings-wrapper">
2227

23-
<table className="table">
24-
<thead>
25-
<tr>
26-
<td>Name</td>
27-
<td>Type</td>
28-
<td>Value</td>
29-
<td>Default</td>
30-
<td>Description</td>
31-
</tr>
32-
</thead>
33-
<tbody>
34-
{_.map(_.omit(Meteor.settings, (value, key) => key.indexOf("$") >= 0), renderSetting)}
35-
</tbody>
36-
</table>
28+
<table className="table">
29+
<thead>
30+
<tr>
31+
<td>Name</td>
32+
<td>Value</td>
33+
</tr>
34+
</thead>
35+
<tbody>
36+
{Object.keys(publicSettings).filter(key => !Array.isArray(publicSettings[key])).map(renderSetting)}
37+
</tbody>
38+
</table>
3739

40+
</div>
3841
</div>
39-
40-
</div>
41-
)
42+
</Components.ShowIf>
43+
);
4244
}
4345

4446
registerComponent('Settings', Settings);

0 commit comments

Comments
 (0)