New project structure

Beta of extract.js for extracting english locale
This commit is contained in:
Tomas Bures 2018-11-18 15:38:52 +01:00
parent e18d2b2f84
commit 2edbd67205
247 changed files with 6405 additions and 4237 deletions

View file

@ -1,6 +1,6 @@
{
"name": "mailtrain-client",
"version": "1.0.0",
"version": "2.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -5319,7 +5319,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "mailtrain-client",
"version": "1.0.0",
"version": "2.0.0",
"description": "Self hosted email newsletter app - client components",
"main": "index.js",
"scripts": {
@ -11,7 +11,6 @@
"type": "git",
"url": "git://github.com/Mailtrain-org/mailtrain.git"
},
"author": "",
"license": "GPL-3.0",
"homepage": "https://mailtrain.org/",
"dependencies": {

View file

@ -43,9 +43,9 @@ export function getMailerTypes(t) {
function validateNumber(state, field, label, emptyAllowed = false) {
const value = state.getIn([field, 'value']);
if (typeof value === 'string' && value.trim() === '' && !emptyAllowed) { // After load, the numerical values can be still numbers
state.setIn([field, 'error'], t(`${label} must not be empty`));
state.setIn([field, 'error'], t('{{label}} must not be empty', {label}));
} else if (isNaN(value)) {
state.setIn([field, 'error'], t(`${label} must be a number`));
state.setIn([field, 'error'], t('{{label}} must be a number', {label}));
} else {
state.setIn([field, 'error'], null);
}

View file

@ -578,6 +578,9 @@ export function getEditForm(owner, typeKey, prefix = '') {
{owner.templateTypes[typeKey].getHTMLEditor(owner)}
<ACEEditor id={prefix + 'text'} height="400px" mode="text" label={t('Template content (plain text)')} help={<Trans>To extract the text from HTML click <ActionLink onClickAsync={::owner.extractPlainText}>here</ActionLink>. Please note that your existing plaintext in the field above will be overwritten. This feature uses the <a href="http://premailer.dialect.ca/api">Premailer API</a>, a third party service. Their Terms of Service and Privacy Policy apply.</Trans>}/>
/*prefix:helpers*/<Trans i18nKey="userMessagesUnread" count={count}>
Hello <strong title={t('nameTitle')}>{{name}}</strong>, you have {{count}} unread message. <Link to="/msgs">Go to messages</Link>.
</Trans>
</div>;
}