From 6880744463a93a74ae2b0d7530760f560952104b Mon Sep 17 00:00:00 2001 From: floatingghost Date: Sun, 14 Aug 2022 23:16:07 +0000 Subject: [PATCH] display proxy correctly (#9) Reviewed-on: https://akkoma.dev/AkkomaGang/admin-fe/pulls/9 --- src/store/modules/normalizers.js | 2 +- src/views/settings/components/Inputs.vue | 1 - test/modules/normalizers/parseTuples.test.js | 14 -------------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index cb003a79..d9e0a0b8 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -107,7 +107,7 @@ export const parseTuples = (tuples, key) => { }, []) } else if (item.tuple[0] === ':prune') { accum[item.tuple[0]] = item.tuple[1] === ':disabled' ? [item.tuple[1]] : item.tuple[1].tuple - } else if (item.tuple[0] === ':proxy_url' || item.tuple[0] === ':sender') { + } else if (item.tuple[0] === ':sender') { accum[item.tuple[0]] = parseStringOrTupleValue(item.tuple[0], item.tuple[1]) } else if (item.tuple[0] === ':args') { accum[item.tuple[0]] = parseNonTuples(item.tuple[0], item.tuple[1]) diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index aa43bb1c..2325dce6 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -115,7 +115,6 @@ - diff --git a/test/modules/normalizers/parseTuples.test.js b/test/modules/normalizers/parseTuples.test.js index ff039135..73cb47f6 100644 --- a/test/modules/normalizers/parseTuples.test.js +++ b/test/modules/normalizers/parseTuples.test.js @@ -274,20 +274,6 @@ describe('Parse tuples', () => { expect(_.isEqual(expectedSenderString, parseTuples(senderString, ':welcome'))).toBeTruthy() }) - it('parses proxy_url', () => { - const proxyUrlNull = [{ tuple: [':proxy_url', null] }] - const proxyUrlTuple = [{ tuple: [':proxy_url', { tuple: [':socks5', ':localhost', 3090] }]}] - const proxyUrlString = [{ tuple: [':proxy_url', 'localhost:9020'] }] - - const expectedProxyUrlNull = { ':proxy_url': { socks5: false, host: null, port: null }} - const expectedProxyUrlTuple = { ':proxy_url': { socks5: true, host: ':localhost', port: 3090 }} - const expectedProxyUrlString = { ':proxy_url': { socks5: false, host: 'localhost', port: '9020' }} - - expect(_.isEqual(expectedProxyUrlNull, parseTuples(proxyUrlNull, ':http'))).toBeTruthy() - expect(_.isEqual(expectedProxyUrlTuple, parseTuples(proxyUrlTuple, ':http'))).toBeTruthy() - expect(_.isEqual(expectedProxyUrlString, parseTuples(proxyUrlString, ':http'))).toBeTruthy() - }) - it('parses args setting in Pleroma.Upload.Filter.Mogrify', () => { const tuples = [{ tuple: [':args', ['strip', '{ "implode", "1" }']]}] const expectedResult = { ':args': ['strip', '{ "implode", "1" }'] }