From c7e9ccd318b46bfc1da2c6429747c46b1d5af588 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 17:05:15 +0100 Subject: [PATCH 1/6] add woodpecker config --- .woodpecker.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .woodpecker.yaml diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 000000000..1c308f7d4 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,46 @@ +pipeline: + lint: + when: + event: + - push + commands: + - yarn + - yarn lint + - yarn stylelint + + test: + when: + event: + - push + image: node:16 + commands: + - apt install firefox-esr -y --no-install-recommends + - yarn + - yarn unit + + build: + when: + event: + - tag + image: node:16 + commands: + - yarn + - yarn build + + release: + when: + event: + - tag + image: node:16 + secrets: + - SCW_ACCESS_KEY + - SCW_SECRET_KEY + - SCW_DEFAULT_ORGANIZATION_ID + commands: + - apt-get install -y rclone wget zip + - wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64 + - mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli + - chmod +x scaleway-cli + - ./scaleway-cli object config install type=rclone + - zip akkoma-fe.zip -r dist + - rclone copyto akkoma-fe.zip scaleway:akkoma-updates/frontend/akkoma-fe.zip From c3da5db3dddd5a0db1f69ea1a3061198439266f6 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 17:07:57 +0100 Subject: [PATCH 2/6] rename CI file --- .woodpecker.yaml => .woodpecker.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .woodpecker.yaml => .woodpecker.yml (100%) diff --git a/.woodpecker.yaml b/.woodpecker.yml similarity index 100% rename from .woodpecker.yaml rename to .woodpecker.yml From c30e11139dce6237a853db3399a907410765dafa Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 17:08:33 +0100 Subject: [PATCH 3/6] specify node --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1c308f7d4..c1ae23119 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,6 +3,7 @@ pipeline: when: event: - push + image: node:16 commands: - yarn - yarn lint From 079035670a623e4f260da1305117311ee7cfeaf6 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 17:10:36 +0100 Subject: [PATCH 4/6] update apt --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index c1ae23119..73665e81c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -15,6 +15,7 @@ pipeline: - push image: node:16 commands: + - apt update - apt install firefox-esr -y --no-install-recommends - yarn - yarn unit From 93bca5f8510ee037520fcb0b614521bf181c83c7 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 17:53:52 +0100 Subject: [PATCH 5/6] fix tests --- src/components/rich_content/rich_content.jsx | 20 ------------------- .../specs/components/rich_content.spec.js | 4 ++-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 4a31dbc5a..ca075270c 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -112,23 +112,6 @@ export default { } } - const renderLink = (attrs, children) => { - const updatedLink = attrs['href'].replace(/&/g, '&') - const updatedChildren = children.map(child => { - if (typeof child === 'string') { - return child.replace(attrs['href'], updatedLink) - } - if (child[0] === '') { - return - { child[1] } - - } - return child[1] - }) - return - { ...updatedChildren } - - } // Processor to use with html_tree_converter const processItem = (item, index, array, what) => { // Handle text nodes - just add emoji @@ -193,9 +176,6 @@ export default { return renderMention(attrs, children) } else { currentMentions = null - if (attrs['href']) { - return renderLink(attrs, children) - } break } case 'span': diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index a1299e6f2..ea26ee43a 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -44,12 +44,12 @@ describe('RichContent', () => { const html = [ p('Testing 'em all'), 'Testing 'em all', - 'http://example.com?a=1&b=2' + 'http://example.com?a=1' ].join('') const expected = [ p('Testing \'em all'), 'Testing \'em all', - 'http://example.com?a=1&b=2' + 'http://example.com?a=1' ].join('') const wrapper = shallowMount(RichContent, { global, From 01c4aec4f32c7257a7b5817c4c03ef3608712e64 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 18:01:22 +0100 Subject: [PATCH 6/6] run update first --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 73665e81c..c882fea9e 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -39,7 +39,7 @@ pipeline: - SCW_SECRET_KEY - SCW_DEFAULT_ORGANIZATION_ID commands: - - apt-get install -y rclone wget zip + - apt-get update && apt-get install -y rclone wget zip - wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64 - mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli - chmod +x scaleway-cli