Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRO-2188 PRO-2213 PRO-2210 PRO-2208 Init #1

Merged
merged 23 commits into from
Oct 22, 2021
Merged

PRO-2188 PRO-2213 PRO-2210 PRO-2208 Init #1

merged 23 commits into from
Oct 22, 2021

Conversation

abea
Copy link
Contributor

@abea abea commented Oct 20, 2021

No description provided.

@abea abea requested a review from boutell October 20, 2021 22:41
@abea abea self-assigned this Oct 20, 2021
@@ -0,0 +1,130 @@
// http://talesofthefluxfox.com/2016/10/07/writing-to-xlsx-spreadsheets-in-node-js/

const ALPHA = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied verbatim from A2

const assert = require('assert');
const testUtil = require('apostrophe/test-lib/test');

describe('Pieces Exporter', function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add tests for tsv and excel before publishing

@abea abea changed the title Init PRO-2188 PRO-2213 PRO-2210 PRO-2208 Init Oct 21, 2021
@linear
Copy link

linear bot commented Oct 21, 2021

PRO-2188 As a developer, I can install and configure the Export module

This ticket is just to enable the support for installing and configuration the new export module. The actual export functionality is in subsequent tickets.

The module should support configuration for specific document types.

Acceptance criteria:

  • I can npm link the new export module and enable the module in my project.
  • I can configure the module to support specific document types.
  • When I start my project, my configuration is validated and I receive warnings if it's incorrect.

PRO-2213 Confirm the Job module works within the A3 context
PRO-2210 As a developer, I can configure fields to be omitted from my export

This feature exists in A2.

PRO-2208 As a developer, I can configure areas to export plaintext versus rich text

This is currently supported in A2.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
}
```

#### Export areas as plain text with `exportPlainText`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apostrophe convention elsewhere is that plaintext is one word and therefore notCamelCased.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So exportPlaintext would be correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plaintext seems to be an encryption term, not the opposite of rich text. I was going for readability and clarity here. I see we're using plaintext in core, but it seems less of an intentional convention than something that was never examined (since richtext isn't used).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shit, you're right.

It's not unexamined, it's more like misexamined, time has been put into it in the past, I'm surprised I never found that dictionary definition and said "ruh roh, I'm totally off base here." But... I didn't.

So I guess you should go ahead and do it correctly here, but we're stuck with it in the current way in core for 3.x.

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
lib/export.js Outdated Show resolved Hide resolved
lib/export.js Outdated
}
};

async function writeBatch (req, out, lastId = '', reporting, options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we're away from callback hell, I'm inclined to suggest this method doesn't need to be recursive anymore. Then it can be true to its name and just return true if it should be called again, and be awaited in a loop. Easier to understand.

lib/export.js Outdated

});

await self.writeBatch(req, out, '', reporting, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where that little while loop would go.

test/test.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
lib/export.js Outdated Show resolved Hide resolved
@abea abea requested a review from boutell October 21, 2021 20:46
@abea abea merged commit c776cbe into main Oct 22, 2021
@abea abea deleted the init branch October 22, 2021 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants