2
0
Fork 0

Compare commits

..

3 commits

Author SHA1 Message Date
Lance Edgar a54cfb46a7 fix: avoid exit prompt for configure when removing settings 2024-08-28 20:02:31 -05:00
Lance Edgar 749882671f fix: freeze default versions for buefy, vue-resource
needed for sanity
2024-08-28 19:51:55 -05:00
Lance Edgar 29a0d6ba24 fix: stop auto-trim for feedback message, user name
it's a good idea perhaps, but annoying
2024-08-28 19:34:14 -05:00
4 changed files with 15 additions and 15 deletions

View file

@ -452,7 +452,7 @@
<b-field label="User Name" <b-field label="User Name"
:type="userName && userName.trim() ? null : 'is-danger'"> :type="userName && userName.trim() ? null : 'is-danger'">
<b-input v-model.trim="userName" <b-input v-model="userName"
% if request.user: % if request.user:
disabled disabled
% endif % endif
@ -467,7 +467,7 @@
<b-field label="Message" <b-field label="Message"
:type="message && message.trim() ? null : 'is-danger'"> :type="message && message.trim() ? null : 'is-danger'">
<b-input type="textarea" <b-input type="textarea"
v-model.trim="message" v-model="message"
ref="textarea" /> ref="textarea" />
</b-field> </b-field>
</section> </section>
@ -530,7 +530,7 @@
return { return {
referrer: this.referrer, referrer: this.referrer,
user_uuid: this.userUUID, user_uuid: this.userUUID,
user_name: this.userName, user_name: this.userName.trim(),
message: this.message.trim(), message: this.message.trim(),
...this.getExtraParams(), ...this.getExtraParams(),
} }

View file

@ -190,7 +190,7 @@
// cf. https://stackoverflow.com/a/56551646 // cf. https://stackoverflow.com/a/56551646
ThisPage.methods.beforeWindowUnload = function(e) { ThisPage.methods.beforeWindowUnload = function(e) {
if (this.settingsNeedSaved && !this.savingSettings && !this.undoChanges) { if (this.settingsNeedSaved && !this.savingSettings && !this.undoChanges && !this.purgingSettings) {
e.preventDefault() e.preventDefault()
e.returnValue = '' e.returnValue = ''
} }

View file

@ -210,7 +210,7 @@ def get_libver(
DeprecationWarning) DeprecationWarning)
return version return version
if not configured_only: if not configured_only:
return 'latest' return '0.9.25'
elif key == 'buefy.css': elif key == 'buefy.css':
# nb. this always returns something # nb. this always returns something
@ -232,7 +232,7 @@ def get_libver(
elif key == 'vue_resource': elif key == 'vue_resource':
if not configured_only: if not configured_only:
return 'latest' return '1.5.3'
elif key == 'fontawesome': elif key == 'fontawesome':
if not configured_only: if not configured_only:

View file

@ -60,7 +60,7 @@ class TestGetLibVer(TestCase):
def test_buefy_default(self): def test_buefy_default(self):
version = mod.get_libver(self.request, 'buefy') version = mod.get_libver(self.request, 'buefy')
self.assertEqual(version, 'latest') self.assertEqual(version, '0.9.25')
def test_buefy_custom_old(self): def test_buefy_custom_old(self):
self.config.setdefault('wuttaweb.buefy_version', '0.9.29') self.config.setdefault('wuttaweb.buefy_version', '0.9.29')
@ -84,11 +84,11 @@ class TestGetLibVer(TestCase):
def test_buefy_default_only(self): def test_buefy_default_only(self):
self.config.setdefault('wuttaweb.libver.buefy', '0.9.29') self.config.setdefault('wuttaweb.libver.buefy', '0.9.29')
version = mod.get_libver(self.request, 'buefy', default_only=True) version = mod.get_libver(self.request, 'buefy', default_only=True)
self.assertEqual(version, 'latest') self.assertEqual(version, '0.9.25')
def test_buefy_css_default(self): def test_buefy_css_default(self):
version = mod.get_libver(self.request, 'buefy.css') version = mod.get_libver(self.request, 'buefy.css')
self.assertEqual(version, 'latest') self.assertEqual(version, '0.9.25')
def test_buefy_css_custom_old(self): def test_buefy_css_custom_old(self):
# nb. this uses same setting as buefy (js) # nb. this uses same setting as buefy (js)
@ -109,7 +109,7 @@ class TestGetLibVer(TestCase):
def test_buefy_css_default_only(self): def test_buefy_css_default_only(self):
self.config.setdefault('wuttaweb.libver.buefy', '0.9.29') self.config.setdefault('wuttaweb.libver.buefy', '0.9.29')
version = mod.get_libver(self.request, 'buefy.css', default_only=True) version = mod.get_libver(self.request, 'buefy.css', default_only=True)
self.assertEqual(version, 'latest') self.assertEqual(version, '0.9.25')
def test_vue_default(self): def test_vue_default(self):
version = mod.get_libver(self.request, 'vue') version = mod.get_libver(self.request, 'vue')
@ -136,7 +136,7 @@ class TestGetLibVer(TestCase):
def test_vue_resource_default(self): def test_vue_resource_default(self):
version = mod.get_libver(self.request, 'vue_resource') version = mod.get_libver(self.request, 'vue_resource')
self.assertEqual(version, 'latest') self.assertEqual(version, '1.5.3')
def test_vue_resource_custom(self): def test_vue_resource_custom(self):
self.config.setdefault('wuttaweb.libver.vue_resource', '1.5.3') self.config.setdefault('wuttaweb.libver.vue_resource', '1.5.3')
@ -247,7 +247,7 @@ class TestGetLibUrl(TestCase):
def test_buefy_default(self): def test_buefy_default(self):
url = mod.get_liburl(self.request, 'buefy') url = mod.get_liburl(self.request, 'buefy')
self.assertEqual(url, 'https://unpkg.com/buefy@latest/dist/buefy.min.js') self.assertEqual(url, 'https://unpkg.com/buefy@0.9.25/dist/buefy.min.js')
def test_buefy_custom(self): def test_buefy_custom(self):
self.config.setdefault('wuttaweb.liburl.buefy', '/lib/buefy.js') self.config.setdefault('wuttaweb.liburl.buefy', '/lib/buefy.js')
@ -262,7 +262,7 @@ class TestGetLibUrl(TestCase):
def test_buefy_default_only(self): def test_buefy_default_only(self):
self.config.setdefault('wuttaweb.liburl.buefy', '/lib/buefy.js') self.config.setdefault('wuttaweb.liburl.buefy', '/lib/buefy.js')
url = mod.get_liburl(self.request, 'buefy', default_only=True) url = mod.get_liburl(self.request, 'buefy', default_only=True)
self.assertEqual(url, 'https://unpkg.com/buefy@latest/dist/buefy.min.js') self.assertEqual(url, 'https://unpkg.com/buefy@0.9.25/dist/buefy.min.js')
def test_buefy_configured_only(self): def test_buefy_configured_only(self):
url = mod.get_liburl(self.request, 'buefy', configured_only=True) url = mod.get_liburl(self.request, 'buefy', configured_only=True)
@ -281,7 +281,7 @@ class TestGetLibUrl(TestCase):
def test_buefy_css_default(self): def test_buefy_css_default(self):
url = mod.get_liburl(self.request, 'buefy.css') url = mod.get_liburl(self.request, 'buefy.css')
self.assertEqual(url, 'https://unpkg.com/buefy@latest/dist/buefy.min.css') self.assertEqual(url, 'https://unpkg.com/buefy@0.9.25/dist/buefy.min.css')
def test_buefy_css_custom(self): def test_buefy_css_custom(self):
self.config.setdefault('wuttaweb.liburl.buefy.css', '/lib/buefy.css') self.config.setdefault('wuttaweb.liburl.buefy.css', '/lib/buefy.css')
@ -309,7 +309,7 @@ class TestGetLibUrl(TestCase):
def test_vue_resource_default(self): def test_vue_resource_default(self):
url = mod.get_liburl(self.request, 'vue_resource') url = mod.get_liburl(self.request, 'vue_resource')
self.assertEqual(url, 'https://cdn.jsdelivr.net/npm/vue-resource@latest') self.assertEqual(url, 'https://cdn.jsdelivr.net/npm/vue-resource@1.5.3')
def test_vue_resource_custom(self): def test_vue_resource_custom(self):
self.config.setdefault('wuttaweb.liburl.vue_resource', '/lib/vue-resource.js') self.config.setdefault('wuttaweb.liburl.vue_resource', '/lib/vue-resource.js')