Skip to content

Cloning Rows #1697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
70999b1
disabled clone rows option for standard classes
sadakchap May 5, 2021
326b0e8
providing a way to edit clone rows on error 137
sadakchap May 5, 2021
d97e896
allowing user to clone rows for standard classes
sadakchap May 6, 2021
1783154
Merge branch 'master' of parse-community/parse-dashboard into edit-cl…
sadakchap May 11, 2021
92c7132
Merge branch 'master' of parse-community/parse-dashboard into edit-cl…
sadakchap May 17, 2021
59aeb63
checking dirty clone objects on failed clone
sadakchap May 17, 2021
9b3be18
giving option to clone or cancel per row for failed clone rows
sadakchap May 17, 2021
9705713
fixed wrapTop for data rows when edit clone row
sadakchap May 17, 2021
b7b7b93
showing modal Clone menu
sadakchap May 21, 2021
acc1c22
disabling other menu item on modal state
sadakchap May 21, 2021
2a4479a
clone rows for requried field
sadakchap May 27, 2021
53cd6e6
showing cloned rows for missing required field error
sadakchap Jun 2, 2021
4cb326d
removing username & authData for User class object
sadakchap Jun 25, 2021
be85c8e
removed null initialization var
sadakchap Jul 13, 2021
079f43f
removing username while cloning User obj
sadakchap Jul 20, 2021
5d1b9ff
added clone icon attribution note
sadakchap Jul 27, 2021
88a64e1
Merge branch 'master' of parse-community/parse-dashboard into edit-cl…
sadakchap Jul 27, 2021
5209ee6
added required placehlder text for edit clone rows
sadakchap Jul 27, 2021
b874314
clearing required field row after abort add
sadakchap Jul 27, 2021
6f04895
udpating config file
sadakchap Jul 27, 2021
846bca5
dynamic update required fields from BrowserRow new
sadakchap Jul 30, 2021
8a49c8b
remove requiredColumnFields state var from Browser
sadakchap Jul 30, 2021
b296eae
Update package-lock.json
mtrezza Aug 4, 2021
41425d3
Merge branch 'master' of github.com:parse-community/parse-dashboard i…
sadakchap Aug 4, 2021
5c5df3e
disabling all menu options on edit clone row modal state
sadakchap Aug 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default class BrowserCell extends Component {
//#endregion

render() {
let { type, value, hidden, width, current, onSelect, onEditChange, setCopyableValue, setRelation, onPointerClick, row, col, field, onEditSelectedRow, readonly, isRequired, markRequiredField } = this.props;
let { type, value, hidden, width, current, onSelect, onEditChange, setCopyableValue, setRelation, onPointerClick, row, col, field, onEditSelectedRow, readonly, isRequired, markRequiredFieldRow } = this.props;
let content = value;
let isNewRow = row < 0;
this.copyableValue = content;
Expand Down Expand Up @@ -333,7 +333,7 @@ export default class BrowserCell extends Component {
classes.push(styles.current);
}

if (markRequiredField && isRequired && !value) {
if (markRequiredFieldRow === row && isRequired && !value) {
classes.push(styles.required);
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/BrowserFilter/BrowserFilter.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export default class BrowserFilter extends React.Component {
if (this.props.filters.size) {
buttonStyle.push(styles.active);
}
if (this.props.disabled) {
buttonStyle.push(styles.disabled);
}
return (
<div className={styles.wrap}>
<div className={buttonStyle.join(' ')} onClick={this.toggle}>
Expand Down
9 changes: 9 additions & 0 deletions src/components/BrowserFilter/BrowserFilter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
&:hover svg {
fill: white;
}

&.disabled {
cursor: not-allowed;
color: #66637A;

&:hover svg {
fill: #66637A;
}
}
}

.entry.active {
Expand Down
19 changes: 16 additions & 3 deletions src/components/BrowserRow/BrowserRow.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,21 @@ export default class BrowserRow extends Component {
}

render() {
const { className, columns, currentCol, isUnique, obj, onPointerClick, order, readOnlyFields, row, rowWidth, selection, selectRow, setCopyableValue, setCurrent, setEditing, setRelation, onEditSelectedRow, setContextMenu, onFilterChange, markRequiredField, requiredColumnFields } = this.props;
const { className, columns, currentCol, isUnique, obj, onPointerClick, order, readOnlyFields, row, rowWidth, selection, selectRow, setCopyableValue, setCurrent, setEditing, setRelation, onEditSelectedRow, setContextMenu, onFilterChange, markRequiredFieldRow } = this.props;
let attributes = obj.attributes;
let requiredCols = [];
Object.entries(columns).reduce((acc, cur) => {
if (cur[1].required) {
acc.push(cur[0]);
}
return acc;
}, requiredCols);
// for dynamically changing required field on _User class
if (obj.className === '_User' && (obj.get('username') !== undefined || obj.get('password') !== undefined)) {
requiredCols = ['username', 'password'];
} else if (obj.className === '_User' && obj.get('authData') !== undefined) {
requiredCols = ['authData'];
}
return (
<div className={styles.tableRow} style={{ minWidth: rowWidth }}>
<span className={styles.checkCell}>
Expand Down Expand Up @@ -58,7 +71,7 @@ export default class BrowserRow extends Component {
hidden = true;
}
}
let isRequired = requiredColumnFields && requiredColumnFields.includes(name);
let isRequired = requiredCols.includes(name);
return (
<BrowserCell
key={name}
Expand All @@ -82,7 +95,7 @@ export default class BrowserRow extends Component {
value={attr}
hidden={hidden}
isRequired={isRequired}
markRequiredField={markRequiredField}
markRequiredFieldRow={markRequiredFieldRow}
setCopyableValue={setCopyableValue}
setContextMenu={setContextMenu}
onEditSelectedRow={onEditSelectedRow} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@ export default class ColumnsConfiguration extends React.Component {
}

render() {
const { handleColumnDragDrop, handleColumnsOrder, order } = this.props;
const [ title, entry ] = [styles.title, styles.entry ].map(className => (
const { handleColumnDragDrop, handleColumnsOrder, order, disabled } = this.props;
let [ title, entry ] = [styles.title, styles.entry ].map(className => (
<div className={className} onClick={this.toggle.bind(this)}>
<Icon name='manage-columns' width={14} height={14} />
<span>Manage Columns</span>
</div>
));
if (disabled) {
entry = <div className={styles.entry + ' ' + styles.disabled} onClick={null}>
<Icon name='manage-columns' width={14} height={14} />
<span>Manage Columns</span>
</div>;
}

let popover = null;
if (this.state.open) {
Expand Down
9 changes: 9 additions & 0 deletions src/components/ColumnsConfiguration/ColumnsConfiguration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
&:hover svg {
fill: white;
}

&.disabled {
cursor: not-allowed;
color: #66637A;

&:hover svg {
fill: #66637A;
}
}
}

.title {
Expand Down
Loading