Skip to content

Commit

Permalink
ACMS-1989: Update admin theme in Acquia CMS to Gin.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshreeputra committed Oct 16, 2023
1 parent e4b84da commit 0a45aaa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
17 changes: 8 additions & 9 deletions modules/acquia_cms_common/acquia_cms_common.install
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ function acquia_cms_common_install($is_syncing) {
'view media',
]);

// Enable acquia_claro theme.
// Enable gin theme.
$themesList = \Drupal::service('extension.list.theme')->getList();
$themesInstall = ["olivero"];
if (isset($themesList['acquia_claro'])) {
$themesInstall[] = "acquia_claro";
}
\Drupal::service('theme_installer')->install($themesInstall);
\Drupal::configFactory()->getEditable('system.theme')->set('default', 'olivero')->save();
if (in_array("acquia_claro", $themesInstall)) {
\Drupal::configFactory()->getEditable('system.theme')->set('admin', "acquia_claro")->save();
$theme_installer = \Drupal::service('theme_installer');
$theme_installer->install(["olivero"]);
$system_theme_config = \Drupal::configFactory()->getEditable('system.theme');
$system_theme_config->set('default', 'olivero')->save();
if (isset($themesList['gin'])) {
$theme_installer->install(["gin"]);
$system_theme_config->set('admin', "gin")->save();
}

// Re-write the content and media view on module install,
Expand Down
1 change: 0 additions & 1 deletion modules/acquia_cms_common/acquia_cms_common.module
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ function acquia_cms_common_modules_installed($modules, $is_syncing) {
* @see template_preprocess_maintenance_page()
*/
function acquia_cms_common_preprocess_maintenance_page(array &$variables) {
$variables['#attached']['library'][] = 'acquia_claro/install-page';
$acquia_cms_path = \Drupal::service('extension.list.module')->getPath('acquia_cms_common');
$variables['install_page_logo_path'] = '/' . $acquia_cms_path . '/acquia_cms.png';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ public function deleteHeadlessUiPaths() {
*/
public function updateHeadlessUiConfig(bool $isEnabled = TRUE) {
if ($isEnabled) {
// Reset default theme to acquia_claro.
if ($this->themeHandler->themeExists('acquia_claro')) {
// Reset default theme to gin.
if ($this->themeHandler->themeExists('gin')) {
$this->configFactory
->getEditable('system.theme')
->set('default', 'acquia_claro')
->set('default', 'gin')
->save();
}

Expand Down
8 changes: 4 additions & 4 deletions modules/acquia_cms_tour/src/Services/StarterKitService.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getModulesAndThemes(string $starter_kit, string $demo_question =
'acquia_cms_tour',
];
$enableThemes = [
'admin' => 'acquia_claro',
'admin' => 'gin',
'default' => 'cohesion_theme',
];
break;
Expand All @@ -167,7 +167,7 @@ public function getModulesAndThemes(string $starter_kit, string $demo_question =
'acquia_cms_tour',
];
$enableThemes = [
'admin' => 'acquia_claro',
'admin' => 'gin',
'default' => 'olivero',
];
break;
Expand All @@ -180,14 +180,14 @@ public function getModulesAndThemes(string $starter_kit, string $demo_question =
'acquia_cms_tour',
];
$enableThemes = [
'admin' => 'acquia_claro',
'admin' => 'gin',
'default' => 'olivero',
];
break;

default:
$enableThemes = [
'admin' => 'acquia_claro',
'admin' => 'gin',
'default' => 'olivero',
];
$enableModules = [
Expand Down

0 comments on commit 0a45aaa

Please sign in to comment.