From 84f7ef71c144702f203ffdfa90bd6d19a58a97e7 Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Fri, 13 Nov 2020 18:42:51 +0100 Subject: [PATCH] More helpful UI if the database has changed plus ignore changes that are just white space or capitalisation --- thrimbletrimmer/scripts/IO.js | 3 ++- thrimshim/thrimshim/main.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/thrimbletrimmer/scripts/IO.js b/thrimbletrimmer/scripts/IO.js index 05054cc..574b063 100644 --- a/thrimbletrimmer/scripts/IO.js +++ b/thrimbletrimmer/scripts/IO.js @@ -288,7 +288,8 @@ thrimbletrimmerSubmit = function(state, override_changes=false) { var error = response.statusText + ": " + text; console.log(error); if (response.status == 409) { - if (confirm(text)) { + dialogue = text + "\nClick Ok to submit anyway; Click Cancel to return to editing" + if (confirm(dialogue)) { thrimbletrimmerSubmit(state, true); } else { diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index f099c26..32279e2 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -250,8 +250,8 @@ def update_row(ident, editor=None): for column in sheet_columns: if isinstance(old_row[column], datetime.datetime): old_row[column] = old_row[column].isoformat() - if new_row[column] != old_row[column]: - changes += '{}: Database: {} Thrimbletrimmer: {}\n'.format(column, old_row[column], new_row[column]) + if new_row[column].lower().strip() != old_row[column].lower().strip(): + changes += u'{}: {} \u2192 {}\n'.format(column, new_row[column], old_row[column]) if changes and not override_changes: return 'Sheet columns have changed since editing has begun. Please review changes\n' + changes, 409