From ba86029e6196efd035e3fba9270f3a45f03298a4 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 25 Sep 2022 10:53:54 +0200 Subject: [PATCH] chore(plugin-theme): Disable paperless for now --- plugins/plugin-theme/src/index.mjs | 7 +++++-- plugins/plugin-theme/tests/plugin.test.mjs | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/plugin-theme/src/index.mjs b/plugins/plugin-theme/src/index.mjs index bea6eca58ce..18813f91156 100644 --- a/plugins/plugin-theme/src/index.mjs +++ b/plugins/plugin-theme/src/index.mjs @@ -31,13 +31,15 @@ export const plugin = { svg.style += sample svg.style += paperless svg.style += buildStylesheet(svg.pattern.settings.scale, data.stripped) - if (svg.pattern.settings.paperless) { + // FIXME : Re-implement this for v3 + /* + if (svg.pattern.settings[0].paperless) { svg.pattern.settings.units === 'imperial' ? (svg.defs += grid.imperial) : (svg.defs += grid.metric) for (const key in svg.pattern.parts) { const part = svg.pattern.parts[key] - if (!part.hidden && svg.pattern.needs(key)) { + if (!part.hidden && svg.pattern.__needs(key)) { let anchor = new svg.pattern.Point(0, 0) if (typeof part.points.gridAnchor !== 'undefined') anchor = part.points.gridAnchor else if (typeof part.points.anchor !== 'undefined') anchor = part.points.anchor @@ -55,6 +57,7 @@ export const plugin = { } } } + */ } }, }, diff --git a/plugins/plugin-theme/tests/plugin.test.mjs b/plugins/plugin-theme/tests/plugin.test.mjs index 5dfdbe63148..f4099f957f3 100644 --- a/plugins/plugin-theme/tests/plugin.test.mjs +++ b/plugins/plugin-theme/tests/plugin.test.mjs @@ -13,9 +13,11 @@ describe('Theme Plugin Tests', () => { expect(pattern.svg.style).to.contain('svg.freesewing') }) + /* + * FIXME: Re-implement this for v3 it('Should load the metric grid for paperless', () => { - expect(pattern.svg.defs).to.contain('gridline-xs') - expect(pattern.svg.defs).to.contain('M 10 0 L 10 100 M 20 0 L 20') + expect(pattern.svg.head).to.contain('gridline-xs') + expect(pattern.svg.head).to.contain('M 10 0 L 10 100 M 20 0 L 20') }) it('Should load the imperial grid for paperless', () => { @@ -33,6 +35,7 @@ describe('Theme Plugin Tests', () => { expect(pattern.svg.style).to.contain('svg.freesewing .text-xxl {\n font-size: 24px;') }) + */ it('Should round after applying scale.', () => { pattern.settings.scale = 1 / 3