Skip to content

Commit 9a7a60f

Browse files
authored
feat: Add Parse Server version compatibility detection (#3004)
1 parent 98069a8 commit 9a7a60f

File tree

5 files changed

+66
-25
lines changed

5 files changed

+66
-25
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,14 @@ After starting the dashboard, you can visit http://localhost:4040 in your browse
123123
## Compatibility
124124

125125
### Parse Server
126-
Parse Dashboard is compatible with the following Parse Server versions.
126+
Parse Dashboard is compatible with the following versions of Parse Server.
127127

128-
| Parse Dashboard Version | Parse Server Version | Compatible |
129-
|-------------------------|----------------------|------------|
130-
| >=1.0 | >= 2.1.4 | ✅ Yes |
128+
| Parse Dashboard | Parse Server |
129+
|-----------------|------------------|
130+
| >= 1.0.0 | >= 2.1.4 < 7.0.0 |
131+
| >= 8.0.0 | >= 7.0.0 |
132+
133+
Parse Dashboard automatically checks the Parse Server version when connecting and displays a warning if the server version does not meet the minimum required version. The required Parse Server version is defined in the `supportedParseServerVersion` field in `package.json`.
131134

132135
### Node.js
133136
Parse Dashboard is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"Push Status Page",
2222
"Relation Editor"
2323
],
24+
"supportedParseServerVersion": ">=7.0.0",
2425
"keywords": [
2526
"parse",
2627
"dashboard"

src/dashboard/Apps/AppsIndex.react.js

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,32 @@ const AppCard = ({ app, icon }) => {
8282

8383
return (
8484
<li onClick={canBrowse} style={{ background: app.primaryBackgroundColor }}>
85-
<a className={styles.icon}>
86-
{icon ? (
87-
<img src={'appicons/' + icon} width={56} height={56} />
88-
) : (
89-
<Icon width={56} height={56} name="blank-app-outline" fill="#1E384D" />
90-
)}
91-
</a>
92-
<div className={styles.details}>
93-
<a className={styles.appname}>{app.name}</a>
94-
{versionMessage}
85+
<div className={styles.appCardContent}>
86+
<a className={styles.icon}>
87+
{icon ? (
88+
<img src={'appicons/' + icon} width={56} height={56} />
89+
) : (
90+
<Icon width={56} height={56} name="blank-app-outline" fill="#1E384D" />
91+
)}
92+
</a>
93+
<div className={styles.details}>
94+
<a className={styles.appname}>{app.name}</a>
95+
{versionMessage}
96+
</div>
97+
<CountsSection className={styles.glance} title="At a glance">
98+
<AppBadge production={app.production} />
99+
<Metric number={dash(app.users, prettyNumber(app.users))} label="total users" />
100+
<Metric
101+
number={dash(app.installations, prettyNumber(app.installations))}
102+
label="total installations"
103+
/>
104+
</CountsSection>
95105
</div>
96-
<CountsSection className={styles.glance} title="At a glance">
97-
<AppBadge production={app.production} />
98-
<Metric number={dash(app.users, prettyNumber(app.users))} label="total users" />
99-
<Metric
100-
number={dash(app.installations, prettyNumber(app.installations))}
101-
label="total installations"
102-
/>
103-
</CountsSection>
106+
{!app.serverInfo.error && app.serverInfo.versionWarning && (
107+
<div className={styles.versionWarning}>
108+
⚠️ {app.serverInfo.versionWarning}
109+
</div>
110+
)}
104111
</li>
105112
);
106113
};

src/dashboard/Apps/AppsIndex.scss

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,24 @@
103103
margin: 0 auto;
104104

105105
li {
106-
display: flex;
107106
cursor: pointer;
108107
background: #193040;
109108
border-radius: 5px;
110109
margin: 14px 0;
111-
padding: 0 9px;
112-
height: 74px;
110+
min-height: 74px;
113111

114112
&:hover{
115113
background: #172C3B;
116114
}
117115
}
118116
}
119117

118+
.appCardContent {
119+
display: flex;
120+
padding: 0 9px;
121+
min-height: 74px;
122+
}
123+
120124
.icon {
121125
display: block;
122126
float: left;
@@ -190,6 +194,17 @@
190194
@include ellipsis();
191195
}
192196

197+
.versionWarning {
198+
background: rgba(255, 152, 0, 0.15);
199+
border-top: 1px solid rgba(255, 152, 0, 0.3);
200+
color: #ff9800;
201+
font-size: 11px;
202+
padding: 8px 12px;
203+
line-height: 1.4;
204+
word-wrap: break-word;
205+
border-radius: 0 0 5px 5px;
206+
}
207+
193208
.edit {
194209
@include DosisFont;
195210
position: absolute;

src/dashboard/Dashboard.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ import { Helmet } from 'react-helmet';
5555
import Playground from './Data/Playground/Playground.react';
5656
import DashboardSettings from './Settings/DashboardSettings/DashboardSettings.react';
5757
import Security from './Settings/Security/Security.react';
58+
import semver from 'semver';
59+
import packageInfo from '../../package.json';
5860

5961
const ShowSchemaOverview = false; //In progress features. Change false to true to work on this feature.
6062

@@ -138,6 +140,19 @@ export default class Dashboard extends React.Component {
138140
.then(
139141
serverInfo => {
140142
app.serverInfo = serverInfo;
143+
144+
// Check Parse Server version compatibility
145+
const supportedVersion = packageInfo.supportedParseServerVersion;
146+
const serverVersion = serverInfo.parseServerVersion;
147+
148+
if (serverVersion && serverVersion !== 'unknown' && supportedVersion) {
149+
const cleanedVersion = semver.valid(semver.coerce(serverVersion));
150+
if (cleanedVersion && !semver.satisfies(cleanedVersion, supportedVersion)) {
151+
app.serverInfo.versionWarning =
152+
`Parse Server ${serverVersion} is not officially supported by this version of Parse Dashboard. You may encounter issues or reduced functionality. Supported Parse Server versions are ${supportedVersion}. Either upgrade Parse Server, or downgrade Parse Dashboard to a compatible version.`;
153+
}
154+
}
155+
141156
return app;
142157
},
143158
error => {

0 commit comments

Comments
 (0)