mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix multiple Query Tool, ERD title related issues.
This commit is contained in:
parent
de7eb73867
commit
4676961fc4
@ -21,7 +21,7 @@ import CustomPropTypes from '../custom_prop_types';
|
|||||||
import { SelectRefresh } from '../components/SelectRefresh';
|
import { SelectRefresh } from '../components/SelectRefresh';
|
||||||
|
|
||||||
/* Control mapping for form view */
|
/* Control mapping for form view */
|
||||||
function MappedFormControlBase({ type, value, id, onChange, className, visible, inputRef, noLabel, onClick, ...props }) {
|
function MappedFormControlBase({ type, value, id, onChange, className, visible, inputRef, noLabel, onClick, withContainer, controlGridBasis, ...props }) {
|
||||||
const name = id;
|
const name = id;
|
||||||
const onTextChange = useCallback((e) => {
|
const onTextChange = useCallback((e) => {
|
||||||
let val = e;
|
let val = e;
|
||||||
@ -61,6 +61,7 @@ function MappedFormControlBase({ type, value, id, onChange, className, visible,
|
|||||||
case 'switch':
|
case 'switch':
|
||||||
return <FormInputSwitch name={name} value={value}
|
return <FormInputSwitch name={name} value={value}
|
||||||
onChange={(e) => onTextChange(e.target.checked, e.target.name)} className={className}
|
onChange={(e) => onTextChange(e.target.checked, e.target.name)} className={className}
|
||||||
|
withContainer={withContainer} controlGridBasis={controlGridBasis}
|
||||||
{...props} />;
|
{...props} />;
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
return <FormInputCheckbox name={name} value={value}
|
return <FormInputCheckbox name={name} value={value}
|
||||||
@ -106,7 +107,9 @@ MappedFormControlBase.propTypes = {
|
|||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
inputRef: CustomPropTypes.ref,
|
inputRef: CustomPropTypes.ref,
|
||||||
noLabel: PropTypes.bool,
|
noLabel: PropTypes.bool,
|
||||||
onClick: PropTypes.func
|
onClick: PropTypes.func,
|
||||||
|
withContainer: PropTypes.bool,
|
||||||
|
controlGridBasis: PropTypes.number
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Control mapping for grid cell view */
|
/* Control mapping for grid cell view */
|
||||||
|
@ -1042,11 +1042,10 @@ InputColor.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function FormInputColor({
|
export function FormInputColor({
|
||||||
hasError, required, className, label, helpMessage, testcid, withContainer, controlGridBasis, ...props }) {
|
hasError, required, className, label, helpMessage, testcid, ...props }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormInput required={required} label={label} error={hasError} className={className} helpMessage={helpMessage} testcid={testcid}
|
<FormInput required={required} label={label} error={hasError} className={className} helpMessage={helpMessage} testcid={testcid}>
|
||||||
withContainer={withContainer} controlGridBasis={controlGridBasis}>
|
|
||||||
<InputColor {...props} />
|
<InputColor {...props} />
|
||||||
</FormInput>
|
</FormInput>
|
||||||
);
|
);
|
||||||
@ -1057,9 +1056,7 @@ FormInputColor.propTypes = {
|
|||||||
className: CustomPropTypes.className,
|
className: CustomPropTypes.className,
|
||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
helpMessage: PropTypes.string,
|
helpMessage: PropTypes.string,
|
||||||
testcid: PropTypes.string,
|
testcid: PropTypes.string
|
||||||
withContainer: PropTypes.bool,
|
|
||||||
controlGridBasis: PropTypes.number,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function PlainString({ controlProps, value }) {
|
export function PlainString({ controlProps, value }) {
|
||||||
|
@ -961,7 +961,7 @@ class ERDTool extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Box ref={this.containerRef} height="100%">
|
<Box ref={this.containerRef} height="100%">
|
||||||
<ConnectionBar status={this.state.conn_status} bgcolor={this.props.params.bgcolor}
|
<ConnectionBar status={this.state.conn_status} bgcolor={this.props.params.bgcolor}
|
||||||
fgcolor={this.props.params.fgcolor} title={this.props.params.title}/>
|
fgcolor={this.props.params.fgcolor} title={_.unescape(this.props.params.title)}/>
|
||||||
<MainToolBar preferences={this.state.preferences} eventBus={this.eventBus}
|
<MainToolBar preferences={this.state.preferences} eventBus={this.eventBus}
|
||||||
fillColor={this.state.fill_color} textColor={this.state.text_color}
|
fillColor={this.state.fill_color} textColor={this.state.text_color}
|
||||||
notation={this.state.cardinality_notation} onNotationChange={this.onNotationChange}
|
notation={this.state.cardinality_notation} onNotationChange={this.onNotationChange}
|
||||||
|
@ -331,7 +331,7 @@ export default class SQLEditor {
|
|||||||
queryToolForm +=`
|
queryToolForm +=`
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("title").value = "${_.escape(panel_title.replace('\\', '\\\\'))}";
|
document.getElementById("title").value = "${_.escape(panel_title)}";
|
||||||
document.getElementById("queryToolForm").submit();
|
document.getElementById("queryToolForm").submit();
|
||||||
</script>
|
</script>
|
||||||
`;
|
`;
|
||||||
|
@ -95,6 +95,7 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
|
|||||||
connection_status_msg: '',
|
connection_status_msg: '',
|
||||||
params: {
|
params: {
|
||||||
...params,
|
...params,
|
||||||
|
title: _.unescape(params.title),
|
||||||
is_query_tool: params.is_query_tool == 'true' ? true : false,
|
is_query_tool: params.is_query_tool == 'true' ? true : false,
|
||||||
node_name: retrieveNodeName(selectedNodeInfo),
|
node_name: retrieveNodeName(selectedNodeInfo),
|
||||||
},
|
},
|
||||||
@ -684,6 +685,7 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
|
|||||||
database: {
|
database: {
|
||||||
_id: selectedConn.did,
|
_id: selectedConn.did,
|
||||||
label: selectedConn.database_name,
|
label: selectedConn.database_name,
|
||||||
|
_label: selectedConn.database_name,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import Notify from '../../../../static/js/helpers/Notifier';
|
|||||||
const pgAdmin = pgWindow.pgAdmin;
|
const pgAdmin = pgWindow.pgAdmin;
|
||||||
|
|
||||||
export function getDatabaseLabel(parentData) {
|
export function getDatabaseLabel(parentData) {
|
||||||
return parentData.database ? parentData.database.label
|
return parentData.database ? parentData.database._label
|
||||||
: parentData.server?.db;
|
: parentData.server?.db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user