Skip to content

Commit

Permalink
fix format and text
Browse files Browse the repository at this point in the history
  • Loading branch information
patelmilanun committed Jun 28, 2023
1 parent 11dd9a8 commit aefd794
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 74 deletions.
47 changes: 23 additions & 24 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import React, { Component } from 'react';
import styles from 'components/BrowserCell/BrowserCell.scss';
import baseStyles from 'stylesheets/base.scss';
import * as ColumnPreferences from 'lib/ColumnPreferences';
import ExecuteScriptDialog from 'dashboard/Data/Browser/ExecuteScriptDialog.react';
import labelStyles from 'components/Label/Label.scss';
import Modal from 'components/Modal/Modal.react';

export default class BrowserCell extends Component {
constructor() {
Expand Down Expand Up @@ -306,23 +307,15 @@ export default class BrowserCell extends Component {
}

async executeSript(script) {
try {
const object = Parse.Object.extend(
this.props.className
).createWithoutData(this.props.objectId);
const response = await Parse.Cloud.run(
script.cloudCodeFunction,
{ object: object.toPointer() },
{ useMasterKey: true }
);
this.props.showNote(
response || `${script.title} ran with object ${object.id}}`
);
this.props.onRefresh();
} catch (e) {
this.props.showNote(e.message, true);
console.log(`Could not run ${script.title}: ${e}`);
}
try {
const object = Parse.Object.extend(this.props.className).createWithoutData(this.props.objectId);
const response = await Parse.Cloud.run(script.cloudCodeFunction, {object: object.toPointer()}, {useMasterKey: true});
this.props.showNote(response || `Ran script "${script.title}" on "${this.props.className}" object "${object.id}".`);
this.props.onRefresh();
} catch (e) {
this.props.showNote(e.message, true);
console.log(`Could not run ${script.title}: ${e}`);
}
}

toggleExecuteScriptDialog(){
Expand Down Expand Up @@ -451,17 +444,23 @@ export default class BrowserCell extends Component {
let extras = null;
if (this.state.showExecuteScriptDialog)
extras = (
<ExecuteScriptDialog
className={this.selectedScript.className}
objectId={this.selectedScript.objectId}
scriptName={this.selectedScript.title}
type={this.selectedScript.confirmationDialogStyle}
<Modal
type={this.selectedScript.type === "info" ? Modal.Types.INFO : Modal.Types.DANGER}

Check failure on line 448 in src/components/BrowserCell/BrowserCell.react.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote
icon="warn-outline"
title={this.selectedScript.title}
subtitle="Confirm that you want to run this script."
confirmText="Continue"
cancelText="Cancel"
onCancel={() => this.toggleExecuteScriptDialog()}
onConfirm={() => {
this.executeSript(this.selectedScript);
this.toggleExecuteScriptDialog();
}}
/>
>
<div className={[labelStyles.label, labelStyles.text, styles.action].join(' ')}>
{`Do you want to run script "${this.selectedScript.title}" on "${this.selectedScript.className}" object "${this.selectedScript.objectId}"?`}
</div>
</Modal>
);

return <span
Expand Down
7 changes: 6 additions & 1 deletion src/components/BrowserCell/BrowserCell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@

.readonly {
color: #04263bd1;
}
}

.action {
padding: 28px;
border-style: solid;
}
36 changes: 0 additions & 36 deletions src/dashboard/Data/Browser/ExecuteScriptDialog.react.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/dashboard/Data/Browser/ExecuteScriptDialog.scss

This file was deleted.

0 comments on commit aefd794

Please sign in to comment.