public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][RM-6047]: [Query Tool] dirty indicator stays active although all changes were undone
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin][RM-6047]: [Query Tool] dirty indicator stays active although all changes were undone
@ 2020-12-11 10:46 Nikhil Mohite <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Mohite @ 2020-12-11 10:46 UTC (permalink / raw)
To: pgadmin-hackers
Hi Team,
Please find the patch for RM-6047:
<https://redmine.postgresql.org/issues/6047; [Query Tool] dirty indicator
stays active although all changes were undone.
--
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*
Attachments:
[application/octet-stream] RM_6047.patch (2.3K, 3-RM_6047.patch)
download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index c8d3cbc..e2d7666 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -3772,6 +3772,7 @@ define('tools.querytool', [
.done(function(res) {
self.gridView.query_tool_obj.setValue(res);
self.gridView.current_file = e;
+ self.gridView.query_tool_obj.file_data = res;
self.setTitle(self.gridView.current_file.split('\\').pop().split('/').pop(), true);
self.trigger('pgadmin-sqleditor:loading-icon:hide');
// hide cursor
@@ -3806,6 +3807,7 @@ define('tools.querytool', [
'file_name': decodeURI(e),
'file_content': self.gridView.query_tool_obj.getValue(),
};
+ var file_data = self.gridView.query_tool_obj.getValue();
self.trigger(
'pgadmin-sqleditor:loading-icon:show',
gettext('Saving the queries in the file...')
@@ -3823,6 +3825,7 @@ define('tools.querytool', [
alertify.success(gettext('File saved successfully.'));
self.gridView.current_file = e;
self.setTitle(self.gridView.current_file.replace(/^.*[\\\/]/g, ''), true);
+ self.gridView.query_tool_obj.file_data = file_data;
// disable save button on file save
$('#btn-save-file').prop('disabled', true);
$('#btn-file-menu-save').css('display', 'none');
@@ -3881,6 +3884,18 @@ define('tools.querytool', [
$('#btn-save-file').prop('disabled', false);
$('#btn-file-menu-save').css('display', 'block');
$('#btn-file-menu-dropdown').prop('disabled', false);
+ } else {
+ if(self.gridView.current_file) {
+ if (self.gridView.query_tool_obj.file_data == self.gridView.query_tool_obj.getValue()) {
+ title = self.gridView.current_file.replace(/^.*[\\\/]/g, '');
+ is_dirty_editor = false;
+ } else {
+ title = self.gridView.current_file.replace(/^.*[\\\/]/g, '') + ' *';
+ is_dirty_editor = true;
+ }
+
+ self.setTitle(title, true, is_dirty_editor);
+ }
}
},
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin][RM-6047]: [Query Tool] dirty indicator stays active although all changes were undone
@ 2020-12-14 07:05 Akshay Joshi <[email protected]>
parent: Nikhil Mohite <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Akshay Joshi @ 2020-12-14 07:05 UTC (permalink / raw)
To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Fri, Dec 11, 2020 at 4:16 PM Nikhil Mohite <
[email protected]> wrote:
> Hi Team,
>
> Please find the patch for RM-6047:
> <https://redmine.postgresql.org/issues/6047; [Query Tool] dirty indicator
> stays active although all changes were undone.
>
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/;
> *Mob.No: +91-7798364578.*
>
--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-12-14 07:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 10:46 [pgAdmin][RM-6047]: [Query Tool] dirty indicator stays active although all changes were undone Nikhil Mohite <[email protected]>
2020-12-14 07:05 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox