Просмотр исходного кода

GC-2000: use AppService.getAppTitle from CustomizeService

Yuki Takei 6 лет назад
Родитель
Сommit
f06b7db601
2 измененных файлов с 3 добавлено и 8 удалено
  1. 1 1
      src/server/crowi/index.js
  2. 2 7
      src/server/service/customize.js

+ 1 - 1
src/server/crowi/index.js

@@ -480,7 +480,7 @@ Crowi.prototype.setUpAcl = function() {
 Crowi.prototype.setUpCustomize = function() {
   const CustomizeService = require('../service/customize');
   if (this.customizeService == null) {
-    this.customizeService = new CustomizeService(this.configManager, this.appService, this.xssService, this.model('Config'));
+    this.customizeService = new CustomizeService(this.configManager, this.appService, this.xssService);
     this.customizeService.initCustomCss();
     this.customizeService.initCustomTitle();
   }

+ 2 - 7
src/server/service/customize.js

@@ -5,13 +5,10 @@ const logger = require('@alias/logger')('growi:service:CustomizeService'); // es
  */
 class CustomizeService {
 
-  constructor(configManager, appService, xssService, Config) {
+  constructor(configManager, appService, xssService) {
     this.configManager = configManager;
     this.appService = appService;
     this.xssService = xssService;
-
-    // === TODO remove after GC-2004
-    this.Config = Config;
   }
 
   /**
@@ -47,9 +44,7 @@ class CustomizeService {
   generateCustomTitle(page) {
     // replace
     const customTitle = this.customTitleTemplate
-      .replace('{{sitename}}', this.Config.appTitle())
-      // === TODO fix after refactoring AppService (GC-2004)
-      // .replace('{{sitename}}', this.appService.getAppTitle())
+      .replace('{{sitename}}', this.appService.getAppTitle())
       .replace('{{page}}', page);
 
     return this.xssService.process(customTitle);