Skip to content

Commit

Permalink
Merge branch 'alpha' into bug/2638
Browse files Browse the repository at this point in the history
  • Loading branch information
vardhan0604 authored Jan 28, 2025
2 parents 77d9536 + fc02897 commit 124d3d3
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 35 deletions.
14 changes: 14 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [6.0.0-alpha.21](https://github.com/ParsePlatform/parse-dashboard/compare/6.0.0-alpha.20...6.0.0-alpha.21) (2025-01-24)


### Bug Fixes

* Info panel not showing when some apps miss infoPanel config ([#2627](https://github.com/ParsePlatform/parse-dashboard/issues/2627)) ([539e883](https://github.com/ParsePlatform/parse-dashboard/commit/539e88348721bc100a80ae00de81a921bc2c53d4))

# [6.0.0-alpha.20](https://github.com/ParsePlatform/parse-dashboard/compare/6.0.0-alpha.19...6.0.0-alpha.20) (2024-11-19)


### Bug Fixes

* Security upgrade cross-spawn from 7.0.3 to 7.0.6 ([#2629](https://github.com/ParsePlatform/parse-dashboard/issues/2629)) ([47a43e0](https://github.com/ParsePlatform/parse-dashboard/commit/47a43e0ac5d55fc9e214079895f71af7c7e3c350))

# [6.0.0-alpha.19](https://github.com/ParsePlatform/parse-dashboard/compare/6.0.0-alpha.18...6.0.0-alpha.19) (2024-10-16)


Expand Down
32 changes: 17 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-dashboard",
"version": "6.0.0-alpha.19",
"version": "6.0.0-alpha.21",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-dashboard"
Expand Down Expand Up @@ -45,7 +45,7 @@
"copy-to-clipboard": "3.3.2",
"core-js": "3.28.0",
"csurf": "1.11.0",
"express": "4.21.1",
"express": "4.21.2",
"graphiql": "2.0.8",
"graphql": "16.8.1",
"immutable": "4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export default class BrowserCell extends Component {
this.props.setShowAggregatedData(true);
this.props.setSelectedObjectId(this.props.objectId);
if (this.props.isPanelVisible) {
this.props.callCloudFunction(this.props.objectId, this.props.className);
this.props.callCloudFunction(this.props.objectId, this.props.className, this.props.appId);
}
}

Expand Down Expand Up @@ -649,7 +649,7 @@ export default class BrowserCell extends Component {
isPanelVisible &&
((e.shiftKey && !this.props.firstSelectedCell) || !e.shiftKey)
) {
callCloudFunction(this.props.objectId, this.props.className);
callCloudFunction(this.props.objectId, this.props.className, this.props.appId);
}
}
handleCellClick(e, row, col);
Expand Down
8 changes: 4 additions & 4 deletions src/components/Toolbar/Toolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useNavigate, useNavigationType, NavigationType } from 'react-router-dom

const POPOVER_CONTENT_ID = 'toolbarStatsPopover';

const Stats = ({ data, classwiseCloudFunctions, className }) => {
const Stats = ({ data, classwiseCloudFunctions, className, appId , appName}) => {
const [selected, setSelected] = React.useState(null);
const [open, setOpen] = React.useState(false);
const buttonRef = React.useRef();
Expand Down Expand Up @@ -98,7 +98,7 @@ const Stats = ({ data, classwiseCloudFunctions, className }) => {
setSelected(statsOptions[0]);
}, []);

const rightMarginStyle = classwiseCloudFunctions && classwiseCloudFunctions[className] ? '120px' : 'initial';
const rightMarginStyle = classwiseCloudFunctions && classwiseCloudFunctions[`${appId}${appName}`] && classwiseCloudFunctions[`${appId}${appName}`][className] ? '120px' : 'initial';

return (
<>
Expand Down Expand Up @@ -140,9 +140,9 @@ const Toolbar = props => {
</div>
</div>
</div>
{props?.selectedData?.length ? <Stats data={props.selectedData} classwiseCloudFunctions={props.classwiseCloudFunctions} className={props.className} /> : null}
{props?.selectedData?.length ? <Stats data={props.selectedData} classwiseCloudFunctions={props.classwiseCloudFunctions} className={props.className} appId={props.appId} appName={props.appName}/> : null}
<div className={styles.actions}>{props.children}</div>
{props.classwiseCloudFunctions && props.classwiseCloudFunctions[props.className] && (
{props.classwiseCloudFunctions && props.classwiseCloudFunctions[`${props.appId}${props.appName}`] && props.classwiseCloudFunctions[`${props.appId}${props.appName}`][props.className] && (
<button
onClick={props.togglePanel}
className={styles.btn}
Expand Down
17 changes: 10 additions & 7 deletions src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ class Browser extends DashboardView {
});
}

fetchAggregationPanelData(objectId, className) {
fetchAggregationPanelData(objectId, className, appId) {
this.setState({
isLoading: true,
});
const params = {
objectId: objectId,
};
const cloudCodeFunction = this.state.classwiseCloudFunctions[className][0].cloudCodeFunction;

const appName = this.props.params.appId;
const cloudCodeFunction = this.state.classwiseCloudFunctions[`${appId}${appName}`]?.[className][0].cloudCodeFunction;
Parse.Cloud.run(cloudCodeFunction, params).then(
result => {
if (result && result.panel && result.panel && result.panel.segments) {
Expand Down Expand Up @@ -326,12 +326,14 @@ class Browser extends DashboardView {
classAndCloudFuntionMap(data) {
const classMap = {};
data.apps.forEach(app => {
app.infoPanel.forEach(panel => {
const appName = app.appName;
classMap[`${app.appId}${appName}`] = {};
app.infoPanel && app.infoPanel.forEach(panel => {
panel.classes.forEach(className => {
if (!classMap[className]) {
classMap[className] = [];
if (!classMap[`${app.appId}${appName}`][className]) {
classMap[`${app.appId}${appName}`][className] = [];
}
classMap[className].push({
classMap[`${app.appId}${appName}`][className].push({
title: panel.title,
cloudCodeFunction: panel.cloudCodeFunction,
classes: panel.classes,
Expand Down Expand Up @@ -2064,6 +2066,7 @@ class Browser extends DashboardView {
setAggregationPanelData={this.setAggregationPanelData}
setErrorAggregatedData={this.setErrorAggregatedData}
errorAggregatedData={this.state.errorAggregatedData}
appName = {this.props.params.appId}
/>
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/dashboard/Data/Browser/BrowserToolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const BrowserToolbar = ({

togglePanel,
isPanelVisible,
classwiseCloudFunctions
classwiseCloudFunctions,
appId,
appName
}) => {
const selectionLength = Object.keys(selection).length;
const isPendingEditCloneRows = editCloneRows && editCloneRows.length > 0;
Expand Down Expand Up @@ -276,6 +278,8 @@ const BrowserToolbar = ({
togglePanel={togglePanel}
isPanelVisible={isPanelVisible}
classwiseCloudFunctions={classwiseCloudFunctions}
appId={appId}
appName = {appName}
>
{onAddRow && (
<a className={classes.join(' ')} onClick={onClick}>
Expand Down
10 changes: 6 additions & 4 deletions src/dashboard/Data/Browser/DataBrowser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class DataBrowser extends React.Component {
this.setState({ order });
}
if (props && props.className) {
if (!props.classwiseCloudFunctions[props.className]) {
if (!props.classwiseCloudFunctions?.[`${props.app.applicationId}${props.appName}`]?.[props.className]) {
this.setState({ isPanelVisible: false });
this.setState({ selectedObjectId: undefined });
}
Expand Down Expand Up @@ -198,7 +198,7 @@ export default class DataBrowser extends React.Component {
if(this.props.errorAggregatedData != {}){
this.props.setErrorAggregatedData({});
}
this.props.callCloudFunction(this.state.selectedObjectId, this.props.className);
this.props.callCloudFunction(this.state.selectedObjectId, this.props.className,this.props.app.applicationId);
}
}

Expand Down Expand Up @@ -364,7 +364,7 @@ export default class DataBrowser extends React.Component {
showAggregatedData:true
})
if(prevObjectID !== this.state.selectedObjectId && this.state.isPanelVisible){
this.props.callCloudFunction(this.state.selectedObjectId,this.props.className)
this.props.callCloudFunction(this.state.selectedObjectId,this.props.className,this.props.app.applicationId)
}
e.preventDefault();
break;
Expand Down Expand Up @@ -405,7 +405,7 @@ export default class DataBrowser extends React.Component {
showAggregatedData: true,
});
if (prevObjectID !== this.state.selectedObjectId && this.state.isPanelVisible) {
this.props.callCloudFunction(this.state.selectedObjectId, this.props.className);
this.props.callCloudFunction(this.state.selectedObjectId, this.props.className,this.props.app.applicationId);
}

e.preventDefault();
Expand Down Expand Up @@ -642,6 +642,8 @@ export default class DataBrowser extends React.Component {
allClassesSchema={this.state.allClassesSchema}
togglePanel={this.togglePanelVisibility}
isPanelVisible={this.state.isPanelVisible}
appId={this.props.app.applicationId}
appName = {this.props.appName}
{...other}
/>

Expand Down

0 comments on commit 124d3d3

Please sign in to comment.