A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: install page add title and install page forms add default value
shuai8dda61d6855a
diff --git a/ui/src/components/PageTitle/index.tsx b/ui/src/components/PageTitle/index.tsxindex a11ea992..a581af2e 100644--- a/ui/src/components/PageTitle/index.tsx+++ b/ui/src/components/PageTitle/index.tsx@@ -18,7 +18,7 @@ const PageTitle: FC<IProp> = ({ title = '', suffix = '' }) => {if (!suffix) {suffix = `${siteInfo.name}`;}- title = title ? `${title} - ${suffix}` : suffix;+ title = title ? `${title}${suffix ? ` - ${suffix}` : ''}` : suffix;return <>{setPageTitle(title)}</>;};diff --git a/ui/src/i18n/locales/en_US.yaml b/ui/src/i18n/locales/en_US.yamlindex 27300e92..9f2a06ab 100644--- a/ui/src/i18n/locales/en_US.yaml+++ b/ui/src/i18n/locales/en_US.yaml@@ -173,17 +173,17 @@ notification:# The following fields are used for interface presentation(Front-end)ui:how_to_format:- title: How to Format- description: >-- <ul class="mb-0"><li><p class="mb-2">to make links</p><pre- class="mb-2"><code><https://url.com><br/><br/>[Title](https://url.com)</code></pre></li><li><p- class="mb-2">put returns between paragraphs</p></li><li><p- class="mb-2"><em>_italic_</em> or **<strong>bold</strong>**</p></li><li><p- class="mb-2">indent code by 4 spaces</p></li><li><p class="mb-2">quote by- placing <code>></code> at start of line</p></li><li><p- class="mb-2">backtick escapes <code>`like _this_`</code></p></li><li><p- class="mb-2">create code fences with backticks <code>`</code></p><pre- class="mb-0"><code>```<br/>code here<br/>```</code></pre></li></ul>+ title: How to Format+ description: >-+ <ul class="mb-0"><li><p class="mb-2">to make links</p><pre+ class="mb-2"><code><https://url.com><br/><br/>[Title](https://url.com)</code></pre></li><li><p+ class="mb-2">put returns between paragraphs</p></li><li><p+ class="mb-2"><em>_italic_</em> or **<strong>bold</strong>**</p></li><li><p+ class="mb-2">indent code by 4 spaces</p></li><li><p class="mb-2">quote by+ placing <code>></code> at start of line</p></li><li><p+ class="mb-2">backtick escapes <code>`like _this_`</code></p></li><li><p+ class="mb-2">create code fences with backticks <code>`</code></p><pre+ class="mb-0"><code>```<br/>code here<br/>```</code></pre></li></ul>pagination:prev: Prevnext: Next@@ -816,7 +816,7 @@ ui:done: Doneconfig_yaml_error: Can’t create the config.yaml file.lang:- label: Please choose a language+ label: Please Choose a Languagedb_type:label: Database Enginedb_username:@@ -883,26 +883,15 @@ ui:If you ever feel like changing more settings, visit <1>admin section</1>;find it in the site menu.good_luck: 'Have fun, and good luck!'- warning: Warning- warning_description: >-+ warn_title: Warning+ warn_description: >-The file <1>config.yaml</1> already exists. If you need to reset any of the- configuration items in this file, please delete it first. You may try- <2>installing now</2>.+ configuration items in this file, please delete it first.+ install_now: You may try <1>installing now</1>.installed: Already installedinstalled_description: >-You appear to have already installed. To reinstall please clear your olddatabase tables first.- upgrade:- title: Answer- update_btn: Update data- update_title: Data update required- update_description: >-- <1>Answer has been updated! Before you continue, we have to update your data- to the newest version.</1><1>The update process may take a little while, so- please be patient.</1>- done_title: No update required- done_btn: Done- done_desscription: Your Answer data is already up-to-date.page_404:description: 'Unfortunately, this page doesn''t exist.'back_home: Back to homepage@@ -927,7 +916,7 @@ ui:smtp: SMTPdashboard:title: Dashboard- welcome: Welcome to Answer Admin !+ welcome: Welcome to Answer Admin!site_statistics: Site Statisticsquestions: 'Questions:'answers: 'Answers:'@@ -1047,6 +1036,7 @@ ui:site_url:label: Site URLmsg: Site url cannot be empty.+ validate: Please enter a valid URL.text: The address of your site.short_description:label: Short Site Description (optional)@@ -1059,6 +1049,7 @@ ui:contact_email:label: Contact Emailmsg: Contact email cannot be empty.+ validate: Contact email is not valid.text: Email address of key contact responsible for this site.interface:page_title: Interface@@ -1077,7 +1068,7 @@ ui:time_zone:label: Timezonemsg: Timezone cannot be empty.- text: Choose a UTC (Coordinated Universal Time) time offset.+ text: Choose a city in the same timezone as you.smtp:page_title: SMTPfrom_email:diff --git a/ui/src/i18n/locales/zh_CN.yaml b/ui/src/i18n/locales/zh_CN.yamlindex 34fd9dc9..a02f4219 100644--- a/ui/src/i18n/locales/zh_CN.yaml+++ b/ui/src/i18n/locales/zh_CN.yaml@@ -173,17 +173,17 @@ notification:# The following fields are used for interface presentation(Front-end)ui:how_to_format:- title: 如何设定文本格式- description: >-- <ul class="mb-0"><li><p class="mb-2">添加链接:</p><pre- class="mb-2"><code><https://url.com><br/><br/>[标题](https://url.com)</code></pre></li><li><p- class="mb-2">段落之间使用空行分隔</p></li><li><p class="mb-2"><em>_斜体_</em> 或者- **<strong>粗体</strong>**</p></li><li><p class="mb-2">使用 4- 个空格缩进代码</p></li><li><p- class="mb-2">在行首添加<code>></code>表示引用</p></li><li><p class="mb-2">反引号进行转义- <code>`像 _这样_`</code></p></li><li><p- class="mb-2">使用<code>```</code>创建代码块</p><pre class="mb-0"><code>```<br/>//- 这是代码<br/>```</code></pre></li></ul>+ title: 如何设定文本格式+ description: >-+ <ul class="mb-0"><li><p class="mb-2">添加链接:</p><pre+ class="mb-2"><code><https://url.com><br/><br/>[标题](https://url.com)</code></pre></li><li><p+ class="mb-2">段落之间使用空行分隔</p></li><li><p class="mb-2"><em>_斜体_</em> 或者+ **<strong>粗体</strong>**</p></li><li><p class="mb-2">使用 4+ 个空格缩进代码</p></li><li><p+ class="mb-2">在行首添加<code>></code>表示引用</p></li><li><p class="mb-2">反引号进行转义+ <code>`像 _这样_`</code></p></li><li><p+ class="mb-2">使用<code>```</code>创建代码块</p><pre class="mb-0"><code>```<br/>//+ 这是代码<br/>```</code></pre></li></ul>pagination:prev: 上一页next: 下一页@@ -396,7 +396,7 @@ ui:btn_save_edits: 保存更改btn_cancel: 取消dates:- long_date: YYYY年MM月+ long_date: MM月DD日long_date_with_year: YYYY年MM月DD日long_date_with_time: 'YYYY年MM月DD日 HH:mm'now: 刚刚@@ -917,3 +917,4 @@ ui:msg: 不能为空'yes': 是'no': 否+diff --git a/ui/src/pages/Install/components/SecondStep/index.tsx b/ui/src/pages/Install/components/SecondStep/index.tsxindex 30e48930..6c7125f8 100644--- a/ui/src/pages/Install/components/SecondStep/index.tsx+++ b/ui/src/pages/Install/components/SecondStep/index.tsx@@ -148,8 +148,6 @@ const Index: FC<Props> = ({ visible, data, changeCallback, nextCallback }) => {<Form.Label>{t('db_password.label')}</Form.Label><Form.Controlrequired- type="password"- placeholder={t('db_password.placeholder')}value={data.db_password.value}isInvalid={data.db_password.isInvalid}onChange={(e) => {diff --git a/ui/src/pages/Install/index.tsx b/ui/src/pages/Install/index.tsxindex 84a350bb..ae8f037b 100644--- a/ui/src/pages/Install/index.tsx+++ b/ui/src/pages/Install/index.tsx@@ -43,22 +43,22 @@ const Index: FC = () => {errorMsg: '',},db_username: {- value: '',+ value: 'root',isInvalid: false,errorMsg: '',},db_password: {- value: '',+ value: 'root',isInvalid: false,errorMsg: '',},db_host: {- value: '',+ value: 'db:3306',isInvalid: false,errorMsg: '',},db_name: {- value: '',+ value: 'answer',isInvalid: false,errorMsg: '',},diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.tsindex 7f926fba..4fb21496 100644--- a/ui/src/utils/guard.ts+++ b/ui/src/utils/guard.ts@@ -185,7 +185,6 @@ export const tryNormalLogged = (canNavigate: boolean = false) => {export const tryLoggedAndActicevated = () => {const gr: TGuardResult = { ok: true };const us = deriveLoginState();- console.log('tryLogged', us);if (!us.isLogged || !us.isActivated) {gr.ok = false;}