1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 08:53:14 +00:00

fix transfer department repo to another department (#7491)

This commit is contained in:
Michael An
2025-02-20 17:56:00 +08:00
committed by GitHub
parent cebadb9769
commit 90a4cf40ea

View File

@@ -32,6 +32,7 @@ class TransferDialog extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
options: [],
selectedOption: null, selectedOption: null,
errorMsg: [], errorMsg: [],
transferToUser: true, transferToUser: true,
@@ -39,7 +40,6 @@ class TransferDialog extends React.Component {
reshare: false, reshare: false,
activeTab: !this.props.isDepAdminTransfer ? TRANS_USER : TRANS_DEPART activeTab: !this.props.isDepAdminTransfer ? TRANS_USER : TRANS_DEPART
}; };
this.options = [];
} }
handleSelectChange = (option) => { handleSelectChange = (option) => {
@@ -82,7 +82,7 @@ class TransferDialog extends React.Component {
} }
updateOptions = (departmentsRes) => { updateOptions = (departmentsRes) => {
this.options = departmentsRes.data.map(item => { const options = departmentsRes.data.map(item => {
let option = { let option = {
value: item.name, value: item.name,
email: item.email, email: item.email,
@@ -90,6 +90,7 @@ class TransferDialog extends React.Component {
}; };
return option; return option;
}); });
this.setState({ options });
}; };
onClick = () => { onClick = () => {
@@ -181,7 +182,7 @@ class TransferDialog extends React.Component {
hideSelectedOptions={true} hideSelectedOptions={true}
components={makeAnimated()} components={makeAnimated()}
placeholder={gettext('Select a department')} placeholder={gettext('Select a department')}
options={this.options} options={this.state.options}
onChange={this.handleSelectChange} onChange={this.handleSelectChange}
value={this.state.selectedOption} value={this.state.selectedOption}
className="transfer-repo-select-department" className="transfer-repo-select-department"