New: Display the number of data to migrate

Several fixes following the code review:
- For styles we use Stylus. (http://stylus-lang.com/)
  In Stylus styles curly brackets and terminating semicolons are unnecessary. Indentation is sufficient to denote blocks of styles
  You can also use variables to avoid duplication (e.g. mentioning the same color multiple times)
  Vendor prefixes are not necessary. We use the Nib mixin for Stylus to handle those (http://tj.github.io/nib/)
  => DONE

- `admin.js` bundle is included on all admin pages, so we need to ensure that migration fires only on the migration page and nowhere else.
  You can even create a separate bundle only for migration files, as they won't be necessary on other admin pages.
  => DONE

- MP2MigratorAPI => MP2Migrator endpoint would be just as fine
  => DONE

- For storing migration files, you can use the `Env::$temp_path` path
  => DONE

- `proposeMigration()` the method name disagrees with the comment.
  Comment suggests it tests if migration can be or should be performed
  Method name suggests that it proposes doing the migration (to the user?) - not very clear
  => DONE: the new name is isMigrationNeeded()

  And not only does it test, it may also update the `mailpoet_migration_complete` option, which is confusing and is an unexpected side-effect.
  => DONE

  The migration class itself `MP2Migrator` shouldn't even care about _GET, _REQUEST or _POST arguments. It should only work with what is passed to it.
  => DONE

- In views, please make sure all human-friendly texts use WP's gettext functions for translations (e.g. __('text'))
=> DONE
This commit is contained in:
fred
2017-04-18 19:15:12 +02:00
parent a1ea56f505
commit c984ac7a66
7 changed files with 203 additions and 69 deletions

View File

@ -159,8 +159,7 @@ config.push(_.extend({}, baseConfig, {
'settings/tabs.js',
'subscribers/importExport/import.js',
'subscribers/importExport/export.js',
'helpscout',
'mp2migrator.js'
'helpscout'
],
form_editor: [
'form_editor/form_editor.js',
@ -239,6 +238,19 @@ config.push(_.extend({}, baseConfig, {
}
}));
// mp2migrator
config.push(_.extend({}, baseConfig, {
name: 'mp2migrator',
entry: {
mp2migrator: [
'mp2migrator.js'
]
},
externals: {
'jquery': 'jQuery'
}
}));
// Test
config.push(_.extend({}, baseConfig, {
name: 'test',