Add AffiliationUrl.

This commit is contained in:
Yang Luo
2021-05-24 21:27:00 +08:00
parent b23e8cf90c
commit 089ff6c6eb
5 changed files with 30 additions and 9 deletions

View File

@ -35,12 +35,13 @@ type Application struct {
ProviderObjs []*Provider `xorm:"-" json:"providerObjs"` ProviderObjs []*Provider `xorm:"-" json:"providerObjs"`
OrganizationObj *Organization `xorm:"-" json:"organizationObj"` OrganizationObj *Organization `xorm:"-" json:"organizationObj"`
ClientId string `xorm:"varchar(100)" json:"clientId"` ClientId string `xorm:"varchar(100)" json:"clientId"`
ClientSecret string `xorm:"varchar(100)" json:"clientSecret"` ClientSecret string `xorm:"varchar(100)" json:"clientSecret"`
RedirectUris []string `xorm:"varchar(1000)" json:"redirectUris"` RedirectUris []string `xorm:"varchar(1000)" json:"redirectUris"`
ExpireInHours int `json:"expireInHours"` ExpireInHours int `json:"expireInHours"`
SignupUrl string `xorm:"varchar(100)" json:"signupUrl"` SignupUrl string `xorm:"varchar(100)" json:"signupUrl"`
ForgetUrl string `xorm:"varchar(100)" json:"forgetUrl"` ForgetUrl string `xorm:"varchar(100)" json:"forgetUrl"`
AffiliationUrl string `xorm:"varchar(100)" json:"affiliationUrl"`
} }
func GetApplications(owner string) []*Application { func GetApplications(owner string) []*Application {

View File

@ -256,6 +256,16 @@ class ApplicationEditPage extends React.Component {
}} /> }} />
</Col> </Col>
</Row> </Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("general:Affiliation URL")}:
</Col>
<Col span={22} >
<Input prefix={<LinkOutlined/>} value={this.state.application.affiliationUrl} onChange={e => {
this.updateApplicationField('affiliationUrl', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} > <Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}> <Col style={{marginTop: '5px'}} span={2}>
{i18next.t("general:Providers")}: {i18next.t("general:Providers")}:

View File

@ -286,9 +286,17 @@ class UserEditPage extends React.Component {
{i18next.t("user:Affiliation")}: {i18next.t("user:Affiliation")}:
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.user.affiliation} onChange={e => { {
this.updateUserField('affiliation', e.target.value); this.state.application?.affiliationUrl === "" ? (
}} /> <Input value={this.state.user.affiliation} onChange={e => {
this.updateUserField('affiliation', e.target.value);
}} />
) : (
<Button key="home" onClick={() => Setting.goToLink(this.state.application.affiliationUrl)}>
{`${i18next.t("user:Modify affiliation")}...`}
</Button>
)
}
</Col> </Col>
</Row> </Row>
<Row style={{marginTop: '20px'}} > <Row style={{marginTop: '20px'}} >

View File

@ -114,6 +114,7 @@
"Set password...": "Set password...", "Set password...": "Set password...",
"Modify password...": "Modify password...", "Modify password...": "Modify password...",
"Affiliation": "Affiliation", "Affiliation": "Affiliation",
"Modify affiliation": "Modify affiliation",
"Tag": "Tag", "Tag": "Tag",
"Third-party logins": "Third-party logins", "Third-party logins": "Third-party logins",
"Link": "Link", "Link": "Link",

View File

@ -114,6 +114,7 @@
"Set password...": "设置密码...", "Set password...": "设置密码...",
"Modify password...": "修改密码...", "Modify password...": "修改密码...",
"Affiliation": "工作单位", "Affiliation": "工作单位",
"Modify affiliation": "修改工作单位",
"Tag": "标签", "Tag": "标签",
"Third-party logins": "第三方登录", "Third-party logins": "第三方登录",
"Link": "绑定", "Link": "绑定",