Browse Source

simplenews subscribers migration ok, simplenews admin ok

Bachir Soussi Chiadmi 5 years ago
parent
commit
ace8df0aee
23 changed files with 286 additions and 34 deletions
  1. 1 1
      config/sync/migrate_plus.migration.d7_allpublicfiles.yml
  2. 1 1
      config/sync/migrate_plus.migration.d7_node_article.yml
  3. 1 1
      config/sync/migrate_plus.migration.d7_node_article_i18n.yml
  4. 1 1
      config/sync/migrate_plus.migration.d7_node_materiau.yml
  5. 1 1
      config/sync/migrate_plus.migration.d7_node_materiau_i18n.yml
  6. 1 1
      config/sync/migrate_plus.migration.d7_simplenews_nodes.yml
  7. 49 0
      config/sync/migrate_plus.migration.d7_simplenews_subscribers.yml
  8. 1 1
      config/sync/migrate_plus.migration.d7_taxonomy_term_company.yml
  9. 1 1
      config/sync/migrate_plus.migration.d7_taxonomy_term_showroom.yml
  10. 1 1
      config/sync/migrate_plus.migration.d7_taxonomy_term_tags.yml
  11. 1 1
      config/sync/migrate_plus.migration.d7_taxonomy_term_tags_i18n.yml
  12. 1 1
      config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus.yml
  13. 1 1
      config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus_i18n.yml
  14. 1 1
      config/sync/migrate_plus.migration.d7_user_profile.yml
  15. 1 1
      config/sync/migrate_plus.migration.d7_users.yml
  16. 1 1
      config/sync/migrate_plus.migration_group.d7_materio.yml
  17. 1 1
      config/sync/system.menu.editors.yml
  18. 7 0
      config/sync/user.role.admin.yml
  19. 93 16
      config/sync/views.view.simplenews_newsletters.yml
  20. 43 2
      config/sync/views.view.simplenews_subscribers.yml
  21. 6 0
      migrate-from-d7.sh
  22. 16 0
      web/modules/custom/editors_menus/editors_menus.links.menu.yml
  23. 56 0
      web/modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_simplenews_subscribers.yml

+ 1 - 1
config/sync/migrate_plus.migration.d7_allpublicfiles.yml

@@ -1,4 +1,4 @@
-uuid: 3430da79-cc12-48fc-91f1-acef3ea235d6
+uuid: 2344f826-c47e-4923-ad65-630295fb6719
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_node_article.yml

@@ -1,4 +1,4 @@
-uuid: 62c0cbbe-058f-4cfb-83dc-33ddd12c54a8
+uuid: e4ed115a-f6f6-484f-a07a-5fbc7338c034
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_node_article_i18n.yml

@@ -1,4 +1,4 @@
-uuid: 1c8c188b-7cb5-4062-ad62-e5eae3def31c
+uuid: 8c1bd1fc-a0fb-4bac-a7f8-9837c0eebdc4
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_node_materiau.yml

@@ -1,4 +1,4 @@
-uuid: 24a0d73a-bb5d-472d-9f45-3f9806834ece
+uuid: e1e2cfad-0d0d-4448-8dfb-b5e53b7d1a9f
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_node_materiau_i18n.yml

@@ -1,4 +1,4 @@
-uuid: 103478ec-9372-40a4-bd28-67f6b327776d
+uuid: 04688802-34d3-48a6-83ee-1b2b584e7ee8
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_simplenews_nodes.yml

@@ -1,4 +1,4 @@
-uuid: d2ee3a75-1c75-451b-8ee2-ba45ab6834da
+uuid: 3c3ccdd6-d1c4-41b7-bba0-aee4c6cedd92
 langcode: en
 status: true
 dependencies: {  }

+ 49 - 0
config/sync/migrate_plus.migration.d7_simplenews_subscribers.yml

@@ -0,0 +1,49 @@
+uuid: e96db13c-0d24-47c0-a7e7-8c5d60803cdc
+langcode: en
+status: true
+dependencies: {  }
+_core:
+  default_config_hash: b2MXWpch207TVNeTDT9MV-JYlCyRlkj64EIzLDHuwWo
+id: d7_simplenews_subscribers
+class: null
+field_plugin_method: null
+cck_plugin_method: null
+migration_tags:
+  - 'Drupal 7'
+  - Content
+  - Materio
+migration_group: d7_materio
+label: 'Simplenews subscribers'
+source:
+  plugin: simplenews_subscriber
+process:
+  id: snid
+  status: activated
+  mail: mail
+  uid:
+    plugin: migration
+    migration: d7_users
+    source: uid
+  langcode: language
+  changes: changes
+  created: created
+  subscriptions:
+    plugin: iterator
+    source: subscriptions
+    process:
+      target_id:
+        plugin: static_map
+        source: newsletter_id
+        map:
+          6585: test
+          6374: ze_daily_materio_
+          6274: materio_newsletter
+          7881: companies
+      status: status
+      timestamp: timestamp
+      source: source
+destination:
+  plugin: 'entity:simplenews_subscriber'
+migration_dependencies:
+  required:
+    - d7_users

+ 1 - 1
config/sync/migrate_plus.migration.d7_taxonomy_term_company.yml

@@ -1,4 +1,4 @@
-uuid: fb66841a-8bd9-410b-a61d-eba0efbe2589
+uuid: bc633efe-715f-4ea0-b4f3-ea0b229249ce
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_taxonomy_term_showroom.yml

@@ -1,4 +1,4 @@
-uuid: e98881d9-6886-44cb-aa4c-448e7ab54427
+uuid: 4af34119-1c2f-4796-87f0-8fbab165d111
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_taxonomy_term_tags.yml

@@ -1,4 +1,4 @@
-uuid: 28abdd1f-09e5-449d-b7ca-6cfafab42011
+uuid: b1fd039c-4272-43bb-9fa6-478fdc950fc7
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_taxonomy_term_tags_i18n.yml

@@ -1,4 +1,4 @@
-uuid: db84d816-e6ab-4f1d-9870-915a8e769cb9
+uuid: cff5d663-2ca0-436a-9676-dd6d3bb0ca11
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus.yml

@@ -1,4 +1,4 @@
-uuid: 88ec814e-8ff4-40e1-92b6-5ce2f5652cfc
+uuid: 2ba08bea-0803-4f85-8950-82ae27939d20
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_taxonomy_term_thesaurus_i18n.yml

@@ -1,4 +1,4 @@
-uuid: 00905a42-742e-430d-bcdc-ce3f3ae5c526
+uuid: 0bcd4689-eeac-4ff3-8a45-b248f8cf597a
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration.d7_user_profile.yml

@@ -1,4 +1,4 @@
-uuid: 06e1a8cb-0843-4b5e-b771-f8faa87e23f3
+uuid: 8988f760-b08e-44eb-a4f1-3b13cf5456e3
 langcode: en
 status: true
 dependencies:

+ 1 - 1
config/sync/migrate_plus.migration.d7_users.yml

@@ -1,4 +1,4 @@
-uuid: 338268b0-bcce-449b-91e2-778d2ae1b77c
+uuid: 8fe4d9e7-41f3-4010-9347-6bfd2a7317dc
 langcode: en
 status: true
 dependencies: {  }

+ 1 - 1
config/sync/migrate_plus.migration_group.d7_materio.yml

@@ -1,4 +1,4 @@
-uuid: 5b4b459f-6dc1-4dc6-a5be-784890476b1f
+uuid: 1e79a6e8-ab3a-4873-bf4c-a96d82faa13e
 langcode: en
 status: true
 dependencies:

+ 1 - 1
config/sync/system.menu.editors.yml

@@ -1,4 +1,4 @@
-uuid: 15d9ad1e-fea7-4cf6-a72e-c1a43fe3a702
+uuid: 95f09cc4-4b91-4d65-9519-22da7783121b
 langcode: und
 status: true
 dependencies: {  }

+ 7 - 0
config/sync/user.role.admin.yml

@@ -17,7 +17,9 @@ permissions:
   - 'access site in maintenance mode'
   - 'access synonyms entity autocomplete'
   - 'access toolbar'
+  - 'administer newsletters'
   - 'administer productions menu items'
+  - 'administer simplenews subscriptions'
   - 'administer synonyms'
   - 'administer users'
   - 'break content lock'
@@ -33,6 +35,7 @@ permissions:
   - 'create materiau content'
   - 'create migration workflow_transition'
   - 'create page content'
+  - 'create simplenews_issue content'
   - 'create terms in collectionneurs'
   - 'create terms in company'
   - 'create terms in entrees'
@@ -60,6 +63,7 @@ permissions:
   - 'edit any evenement content'
   - 'edit any materiau content'
   - 'edit any page content'
+  - 'edit any simplenews_issue content'
   - 'edit any static content'
   - 'edit any thematique content'
   - 'edit own enregistrement content'
@@ -96,10 +100,12 @@ permissions:
   - 'revert evenement revisions'
   - 'revert materiau revisions'
   - 'revert page revisions'
+  - 'revert simplenews_issue revisions'
   - 'revert static revisions'
   - 'revert thematique revisions'
   - 'schedule corpus_documents workflow_transition'
   - 'schedule generique workflow_transition'
+  - 'send newsletter'
   - 'translate company taxonomy_term'
   - 'translate enregistrement node'
   - 'translate entrees taxonomy_term'
@@ -127,6 +133,7 @@ permissions:
   - 'view member profile'
   - 'view page revisions'
   - 'view profile'
+  - 'view simplenews_issue revisions'
   - 'view static revisions'
   - 'view the administration theme'
   - 'view thematique revisions'

+ 93 - 16
config/sync/views.view.simplenews_newsletters.yml

@@ -6,6 +6,7 @@ dependencies:
     - field.storage.node.simplenews_issue
   module:
     - node
+    - pagerer
     - simplenews
     - user
 _core:
@@ -51,26 +52,21 @@ display:
           sort_asc_label: Asc
           sort_desc_label: Desc
       pager:
-        type: full
+        type: pagerer
         options:
-          items_per_page: 10
+          preset: default
+          items_per_page: 50
           offset: 0
-          id: 0
-          total_pages: null
+          id: '0'
+          total_pages: ''
           expose:
-            items_per_page: false
+            items_per_page: 0
             items_per_page_label: 'Items per page'
             items_per_page_options: '5, 10, 25, 50'
-            items_per_page_options_all: false
+            items_per_page_options_all: 0
             items_per_page_options_all_label: '- All -'
-            offset: false
+            offset: 0
             offset_label: Offset
-          tags:
-            previous: '‹ previous'
-            next: 'next ›'
-            first: '« first'
-            last: 'last »'
-          quantity: 9
       style:
         type: table
       row:
@@ -234,7 +230,7 @@ display:
           click_sort_column: target_id
           type: entity_reference_label
           settings:
-            link: true
+            link: false
           group_column: ''
           group_columns: {  }
           group_rows: true
@@ -361,6 +357,22 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
+          click_sort_column: value
+          type: timestamp
+          settings:
+            date_format: html_date
+            custom_date_format: ''
+            timezone: ''
+          group_column: value
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: separator
+          separator: ', '
+          field_api_classes: 0
           date_format: short
           custom_date_format: ''
           timezone: ''
@@ -506,6 +518,56 @@ display:
             default_group_multiple: {  }
             group_items: {  }
           plugin_id: in_operator
+        title:
+          id: title
+          table: node_field_data
+          field: title
+          relationship: none
+          group_type: group
+          admin_label: ''
+          operator: contains
+          value: ''
+          group: 1
+          exposed: true
+          expose:
+            operator_id: title_op
+            label: Title
+            description: ''
+            use_operator: false
+            operator: title_op
+            identifier: title
+            required: false
+            remember: false
+            multiple: false
+            remember_roles:
+              authenticated: authenticated
+              unverified: '0'
+              anonymous: '0'
+              free_user: '0'
+              contact_company: '0'
+              alpha_testeur: '0'
+              student: '0'
+              adherent: '0'
+              translator: '0'
+              admin_showroom: '0'
+              admin: '0'
+              root: '0'
+            placeholder: ''
+          is_grouped: false
+          group_info:
+            label: ''
+            description: ''
+            identifier: ''
+            optional: true
+            widget: select
+            multiple: false
+            remember: false
+            default_group: All
+            default_group_multiple: {  }
+            group_items: {  }
+          entity_type: node
+          entity_field: title
+          plugin_id: string
         simplenews_issue_target_id_1:
           id: simplenews_issue_target_id_1
           table: node__simplenews_issue
@@ -562,7 +624,17 @@ display:
             label: ''
           granularity: second
       title: Newsletters
-      header: {  }
+      header:
+        result:
+          id: result
+          table: views
+          field: result
+          relationship: none
+          group_type: group
+          admin_label: ''
+          empty: false
+          content: '@label displaying @start - @end of <strong>@total</strong> | page @current_page/@page_count'
+          plugin_id: result
       footer: {  }
       empty:
         area:
@@ -580,7 +652,12 @@ display:
           plugin_id: text
       relationships: {  }
       arguments: {  }
-      display_extenders: {  }
+      display_extenders:
+        views_ef_fieldset: {  }
+      filter_groups:
+        operator: AND
+        groups:
+          1: AND
     cache_metadata:
       contexts:
         - 'languages:language_content'

+ 43 - 2
config/sync/views.view.simplenews_subscribers.yml

@@ -340,6 +340,22 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
+          click_sort_column: value
+          type: timestamp
+          settings:
+            date_format: html_date
+            custom_date_format: ''
+            timezone: ''
+          group_column: value
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: separator
+          separator: ', '
+          field_api_classes: 0
           date_format: fallback
           custom_date_format: ''
           timezone: ''
@@ -557,9 +573,34 @@ display:
             default_group_multiple: {  }
             group_items: {  }
           plugin_id: in_operator
-      sorts: {  }
+      sorts:
+        created:
+          id: created
+          table: simplenews_subscriber
+          field: created
+          relationship: none
+          group_type: group
+          admin_label: ''
+          order: DESC
+          exposed: false
+          expose:
+            label: ''
+          granularity: second
+          entity_type: simplenews_subscriber
+          entity_field: created
+          plugin_id: date
       title: Subscribers
-      header: {  }
+      header:
+        result:
+          id: result
+          table: views
+          field: result
+          relationship: none
+          group_type: group
+          admin_label: ''
+          empty: false
+          content: '@label displaying @start - @end of <strong>@total</strong> | page @current_page/@page_count'
+          plugin_id: result
       footer: {  }
       empty:
         area:

+ 6 - 0
migrate-from-d7.sh

@@ -58,3 +58,9 @@ drush mim d7_node_article --feedback="100"
 echo " "
 drush mim d7_node_article_i18n --feedback="100"
 sleep 5
+
+echo " "
+echo "Migrating simplenews"
+drush mim d7_simplenews_nodes --feedback="200"
+drush mim d7_simplenews_subscribers --feedback="1000"
+sleep 5

+ 16 - 0
web/modules/custom/editors_menus/editors_menus.links.menu.yml

@@ -38,6 +38,14 @@ editors_menus.showrooms:
   menu_name: editors
   weight: 4
 
+editors_menus.newsletters:
+  title: Newsletters
+  description: ''
+  parent: editors_menus.contents
+  route_name: view.simplenews_newsletters.page_1
+  menu_name: editors
+  weight: 5
+
 editors_menus.users:
   title: Users
   description: ''
@@ -45,3 +53,11 @@ editors_menus.users:
   route_name: view.admin_users.page_1
   menu_name: editors
   weight: 1
+
+editors_menus.subscribers:
+  title: Simplenews Subscribers
+  description: ''
+  parent: editors_menus.users
+  route_name: view.simplenews_subscribers.page_1
+  menu_name: editors
+  weight: 2

+ 56 - 0
web/modules/custom/materio_migrate/config/install/migrate_plus.migration.d7_simplenews_subscribers.yml

@@ -0,0 +1,56 @@
+id: d7_simplenews_subscribers
+migration_group: d7_materio
+dependencies:
+  # config:
+  #   - migrate.migration.d7_simplenews_newsletter
+  module:
+    - migrate_drupal
+    - simplenews
+label: Simplenews subscribers
+migration_tags:
+  - Drupal 7
+  - Content
+  - Materio
+
+source:
+  plugin: simplenews_subscriber
+
+process:
+  id: snid
+  status: activated
+  mail: mail
+  # uid: uid
+  uid:
+    plugin: migration
+    migration: d7_users
+    source: uid
+
+  langcode: language
+  changes: changes
+  created: created
+
+  subscriptions:
+    plugin: iterator
+    source: subscriptions
+    process:
+      target_id:
+        plugin: static_map
+        source: newsletter_id
+        map:
+          6585: "test"
+          6374: "ze_daily_materio_"
+          6274: "materio_newsletter"
+          7881: "companies"
+        # plugin: migration
+        # migration: d7_simplenews_newsletter
+        # source: newsletter_id
+      status: status
+      timestamp: timestamp
+      source: source
+
+destination:
+  plugin: entity:simplenews_subscriber
+
+migration_dependencies:
+  required:
+    - d7_users