Futa Arai 3 лет назад
Родитель
Сommit
40489a18db

+ 4 - 4
.devcontainer/Dockerfile

@@ -3,7 +3,7 @@
 # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
 #-------------------------------------------------------------------------------------------------------------
 
-FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16
+FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16-bullseye
 
 # The node image includes a non-root user with sudo access. Use the
 # "remoteUser" property in devcontainer.json to use it. On Linux, update
@@ -33,13 +33,13 @@ RUN chown -R $USER_UID:$USER_GID /home/$USERNAME /workspace;
 ENV DEBIAN_FRONTEND=noninteractive
 
 # Prepare to install Chrome for VRT
-RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
-RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
+# RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
+# RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
 
 RUN apt-get update \
    && apt-get -y install --no-install-recommends git-lfs \
       # Chrome
-      google-chrome-stable \
+      # google-chrome-stable \
       # for Cypress
       libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb fonts-noto-cjk \
 

+ 3 - 3
packages/app/src/interfaces/questionnaire/condition.ts

@@ -2,12 +2,12 @@ import { GrowiServiceType } from './growi-info';
 import { UserType } from './user-info';
 
 interface UserCondition {
-  types: UserType[] // アンケート対象ユーザータイプ
+  types: UserType[] // user types to show questionnaire
 }
 
 interface GrowiCondition {
-  types: GrowiServiceType[] // アンケート対象 GROWI タイプ
-  versionRegExps: string[] // アンケート対象 GROWI バージョン正規表現
+  types: GrowiServiceType[] // GROWI types to show questionnaire in
+  versionRegExps: string[] // GROWI versions to show questionnaire in
 }
 
 export interface ICondition {

+ 1 - 1
packages/app/src/interfaces/questionnaire/growi-info.ts

@@ -35,7 +35,7 @@ interface IGrowiOSInfo {
 
 export interface IGrowiInfo {
   version: string
-  appSiteUrl: string // hash 化されている場合もある
+  appSiteUrl: string // it may be hashed
   type: GrowiServiceType
   currentUsersCount: number
   currentActiveUsersCount: number

+ 2 - 2
packages/app/src/interfaces/questionnaire/question.ts

@@ -3,6 +3,6 @@ export const QuestionType = { points: 'points', text: 'text' } as const;
 type QuestionType = typeof QuestionType[keyof typeof QuestionType];
 
 export interface IQuestion {
-  type: QuestionType // アンケートの回答形式
-  text: string // アンケートの文章
+  type: QuestionType
+  text: string
 }

+ 2 - 2
packages/app/src/interfaces/questionnaire/user-info.ts

@@ -3,7 +3,7 @@ export const UserType = { admin: 'admin', general: 'general' } as const;
 export type UserType = typeof UserType[keyof typeof UserType];
 
 export interface IUserInfo {
-  userIdHash: string // 生のユーザー ID を appSiteUrl を hash 化したものを salt にして hash 化
+  userIdHash: string // userId hash generated by using appSiteUrl as salt
   type: UserType
-  userCreatedAt: Date // 回答ユーザーの作成日時(登録日時)
+  userCreatedAt: Date // createdAt of user that answered the questionnaire
 }

+ 3 - 5
packages/app/src/server/service/questionnaire-cron.ts

@@ -1,5 +1,3 @@
-
-
 import axiosRetry from 'axios-retry';
 
 import loggerFactory from '~/utils/logger';
@@ -19,7 +17,7 @@ class QuestionnaireCronService {
 
   crowi: any;
 
-  cronJob;
+  cronJob: any;
 
   // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
   constructor(crowi) {
@@ -43,13 +41,13 @@ class QuestionnaireCronService {
     const growiQuestionnaireServerOrigin = this.crowi.configManager?.getConfig('crowi', 'app:growiQuestionnaireServerOrigin');
     const saveOrders = async(questionnaireOrders: QuestionnaireOrderDocument[]) => {
       const currentDate = new Date(Date.now());
-      // 渡されたアンケートのうち終了前のものを保存する
+      // save questionnaires that are not finished (doesn't have to be started)
       const nonFinishedOrders = questionnaireOrders.filter(order => new Date(order.showUntil) > currentDate);
       await QuestionnaireOrder.insertMany(nonFinishedOrders);
     };
 
     return nodeCron.schedule(cronSchedule, async() => {
-      // GROWI ごとにリクエスト時刻を分散させるためにランダムな時間 sleep する
+      // sleep for a random amount to scatter request time from GROWI apps to questionnaire server
       const secToSleep = getRandomIntInRange(0, maxSecondsUntilRequest);
       await sleep(secToSleep * 1000);