mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Incorporated review comments. #5647
This commit is contained in:
parent
18a7e85c6a
commit
33aea87dea
@ -438,8 +438,7 @@ class TableView(BaseTableView, DataTypeReader, SchemaDiffTableCompare):
|
|||||||
icon=icon,
|
icon=icon,
|
||||||
tigger_count=row['triggercount'],
|
tigger_count=row['triggercount'],
|
||||||
has_enable_triggers=row['has_enable_triggers'],
|
has_enable_triggers=row['has_enable_triggers'],
|
||||||
is_partitioned=self.is_table_partitioned(row),
|
is_partitioned=self.is_table_partitioned(row)
|
||||||
rows_cnt=0
|
|
||||||
))
|
))
|
||||||
|
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
|
@ -279,7 +279,7 @@ define('pgadmin.node.table', [
|
|||||||
type:'GET',
|
type:'GET',
|
||||||
})
|
})
|
||||||
.done(function(res) {
|
.done(function(res) {
|
||||||
Notify.success(res.info, undefined, true);
|
Notify.success(res.info, null);
|
||||||
d.rows_cnt = res.data.total_rows;
|
d.rows_cnt = res.data.total_rows;
|
||||||
t.unload(i);
|
t.unload(i);
|
||||||
t.setInode(i);
|
t.setInode(i);
|
||||||
|
@ -34,6 +34,7 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo
|
|||||||
let isDirty = false; // usefull for warnings
|
let isDirty = false; // usefull for warnings
|
||||||
let warnOnCloseFlag = true;
|
let warnOnCloseFlag = true;
|
||||||
const confirmOnCloseReset = pgAdmin.Browser.get_preferences_for_module('browser').confirm_on_properties_close;
|
const confirmOnCloseReset = pgAdmin.Browser.get_preferences_for_module('browser').confirm_on_properties_close;
|
||||||
|
let updatedData = ['table', 'partition'].includes(nodeType) && !_.isEmpty(itemNodeData.rows_cnt) ? {rows_cnt: itemNodeData.rows_cnt} : undefined;
|
||||||
|
|
||||||
let onError = (err)=> {
|
let onError = (err)=> {
|
||||||
if(err.response){
|
if(err.response){
|
||||||
@ -210,7 +211,7 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo
|
|||||||
key={itemNodeData?._id}
|
key={itemNodeData?._id}
|
||||||
formType={formType}
|
formType={formType}
|
||||||
getInitData={initData}
|
getInitData={initData}
|
||||||
updatedData={{rows_cnt: itemNodeData?.rows_cnt}}
|
updatedData={updatedData}
|
||||||
schema={schema}
|
schema={schema}
|
||||||
viewHelperProps={viewHelperProps}
|
viewHelperProps={viewHelperProps}
|
||||||
onSave={onSaveClick}
|
onSave={onSaveClick}
|
||||||
|
@ -882,7 +882,10 @@ function SchemaPropertiesView({
|
|||||||
data = data || {};
|
data = data || {};
|
||||||
schema.initialise(data);
|
schema.initialise(data);
|
||||||
if(checkIsMounted()) {
|
if(checkIsMounted()) {
|
||||||
setOrigData(data || {});
|
setOrigData({
|
||||||
|
...data,
|
||||||
|
...updatedData
|
||||||
|
});
|
||||||
setLoaderText('');
|
setLoaderText('');
|
||||||
}
|
}
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
|
@ -26,7 +26,6 @@ import pgWindow from 'sources/window';
|
|||||||
import ModalProvider, { useModal } from './ModalProvider';
|
import ModalProvider, { useModal } from './ModalProvider';
|
||||||
|
|
||||||
const AUTO_HIDE_DURATION = 3000; // In milliseconds
|
const AUTO_HIDE_DURATION = 3000; // In milliseconds
|
||||||
const PERSIST_SNACK_BAR = false; // Snackbar stays on the screen, unless it is dismissed
|
|
||||||
|
|
||||||
let snackbarRef;
|
let snackbarRef;
|
||||||
let notifierInitialized = false;
|
let notifierInitialized = false;
|
||||||
@ -120,35 +119,34 @@ AlertContent.propTypes = {
|
|||||||
|
|
||||||
|
|
||||||
let Notifier = {
|
let Notifier = {
|
||||||
success(msg, autoHideDuration = AUTO_HIDE_DURATION, persist = PERSIST_SNACK_BAR) {
|
success(msg, autoHideDuration = AUTO_HIDE_DURATION) {
|
||||||
this._callNotify(msg, MESSAGE_TYPE.SUCCESS, autoHideDuration, persist);
|
this._callNotify(msg, MESSAGE_TYPE.SUCCESS, autoHideDuration);
|
||||||
},
|
},
|
||||||
warning(msg, autoHideDuration = AUTO_HIDE_DURATION, persist = PERSIST_SNACK_BAR) {
|
warning(msg, autoHideDuration = AUTO_HIDE_DURATION) {
|
||||||
this._callNotify(msg, MESSAGE_TYPE.WARNING, autoHideDuration, persist);
|
this._callNotify(msg, MESSAGE_TYPE.WARNING, autoHideDuration);
|
||||||
},
|
},
|
||||||
info(msg, autoHideDuration = AUTO_HIDE_DURATION, persist = PERSIST_SNACK_BAR) {
|
info(msg, autoHideDuration = AUTO_HIDE_DURATION) {
|
||||||
this._callNotify(msg, MESSAGE_TYPE.INFO, autoHideDuration, persist);
|
this._callNotify(msg, MESSAGE_TYPE.INFO, autoHideDuration);
|
||||||
},
|
},
|
||||||
error(msg, autoHideDuration = AUTO_HIDE_DURATION, persist = PERSIST_SNACK_BAR) {
|
error(msg, autoHideDuration = AUTO_HIDE_DURATION) {
|
||||||
this._callNotify(msg, MESSAGE_TYPE.ERROR, autoHideDuration, persist);
|
this._callNotify(msg, MESSAGE_TYPE.ERROR, autoHideDuration);
|
||||||
},
|
},
|
||||||
notify(content, autoHideDuration, persist) {
|
notify(content, autoHideDuration) {
|
||||||
if (content) {
|
if (content) {
|
||||||
if(!notifierInitialized) {
|
if(!notifierInitialized) {
|
||||||
initializeNotifier();
|
initializeNotifier();
|
||||||
}
|
}
|
||||||
let options = {autoHideDuration, content:(key) => (
|
let options = {autoHideDuration, content:(key) => (
|
||||||
<FinalNotifyContent>{React.cloneElement(content, {onClose:()=>{snackbarRef.closeSnackbar(key);}})}</FinalNotifyContent>
|
<FinalNotifyContent>{React.cloneElement(content, {onClose:()=>{snackbarRef.closeSnackbar(key);}})}</FinalNotifyContent>
|
||||||
), persist};
|
)};
|
||||||
options.content.displayName = 'content';
|
options.content.displayName = 'content';
|
||||||
snackbarRef.enqueueSnackbar(null, options);
|
snackbarRef.enqueueSnackbar(null, options);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_callNotify(msg, type, autoHideDuration, persist) {
|
_callNotify(msg, type, autoHideDuration) {
|
||||||
this.notify(
|
this.notify(
|
||||||
<NotifierMessage style={{maxWidth: '50vw'}} type={type} message={msg} closable={true} />,
|
<NotifierMessage style={{maxWidth: '50vw'}} type={type} message={msg} closable={true} />,
|
||||||
autoHideDuration,
|
autoHideDuration
|
||||||
persist
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user