Skip to content

Commit

Permalink
UHF-9937: Remove deriver
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Dec 2, 2024
1 parent 598cd03 commit 3146b86
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 33 deletions.
8 changes: 4 additions & 4 deletions docker/openshift/crons/migrate-helbit-data.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash

migrations=(
"helfi_rekry_images:all"
"helfi_rekry_videos:all"
"helfi_rekry_images"
"helfi_rekry_videos"
"helfi_rekry_task_areas:fi"
"helfi_rekry_task_areas:sv"
"helfi_rekry_task_areas:en"
"helfi_rekry_organizations:fi"
"helfi_rekry_organizations:sv"
"helfi_rekry_organizations:en"
"helfi_rekry_employments:all"
"helfi_rekry_employment_types:all"
"helfi_rekry_employments"
"helfi_rekry_employment_types"
)

echo "Starting helbit migrations: $(date)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
module:
- helfi_rekry_content
id: helfi_rekry_employment_types
deriver: Drupal\helfi_rekry_content\Plugin\Deriver\HelbitMigrationDeriver
migration_tags:
- helfi_rekry_content
- helfi_rekry_jobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
module:
- helfi_rekry_content
id: helfi_rekry_employments
deriver: Drupal\helfi_rekry_content\Plugin\Deriver\HelbitMigrationDeriver
migration_tags:
- helfi_rekry_content
- helfi_rekry_jobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
module:
- helfi_rekry_content
id: helfi_rekry_images
deriver: Drupal\helfi_rekry_content\Plugin\Deriver\HelbitMigrationDeriver
migration_tags:
- helfi_rekry_content
- helfi_rekry_jobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
module:
- helfi_rekry_content
id: helfi_rekry_videos
deriver: Drupal\helfi_rekry_content\Plugin\Deriver\HelbitMigrationDeriver
migration_tags:
- helfi_rekry_content
- helfi_rekry_jobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,14 @@ public static function create(ContainerInterface $container, $base_plugin_id) :
*/
public function getDerivativeDefinitions($base_plugin_definition): array {
$langcodes = ['fi', 'sv', 'en'];
$derivatives = ['all'];

if ($base_plugin_definition['source']['plugin'] == 'helbit_open_jobs') {
foreach ($derivatives as $key) {
$this->derivatives[$key] = $this->getJobMigrationDerivativeValues($base_plugin_definition, $key);
}
}
else {
foreach ($langcodes as $langcode) {
$this->derivatives[$langcode] = $this->getDerivativeValues($base_plugin_definition, $langcode);
}
foreach ($langcodes as $langcode) {
$this->derivatives[$langcode] = $this->getDerivativeValues($base_plugin_definition, $langcode);
}

return $this->derivatives;
}

/**
* Creates a derivative definition for job migration.
*
* @param array $base_plugin_definition
* Base migration definitions.
* @param string $key
* Key for derivative.
*
* @return array
* Modified plugin definition for derivative.
*/
private function getJobMigrationDerivativeValues(array $base_plugin_definition, string $key): array {
return $base_plugin_definition;
}

/**
* Creates a derivative definition for each available language.
*
Expand Down

0 comments on commit 3146b86

Please sign in to comment.