1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 18:29:23 +00:00

external link fix abuse report style (#7507)

* external link fix abuse report style

* change codes
This commit is contained in:
Michael An
2025-02-24 14:03:09 +08:00
committed by GitHub
parent 5bca4562fb
commit 78cb08d5a1

View File

@@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button, Form, FormGroup, Label, Input, Modal, ModalBody, ModalFooter, Alert } from 'reactstrap'; import { Button, Form, FormGroup, Label, Input, Modal, ModalBody, ModalFooter, Alert } from 'reactstrap';
import { gettext } from '../../utils/constants'; import { gettext } from '../../utils/constants';
import { SeahubSelect } from '../common/select';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import toaster from '../toast'; import toaster from '../toast';
import SeahubModalHeader from '@/components/common/seahub-modal-header'; import SeahubModalHeader from '@/components/common/seahub-modal-header';
@@ -24,6 +25,12 @@ class AddAbuseReportDialog extends React.Component {
reporter: this.props.contactEmail, reporter: this.props.contactEmail,
errMessage: '', errMessage: '',
}; };
this.typeOptions = [
{ value: 'copyright', label: gettext('Copyright Infringement') },
{ value: 'virus', label: gettext('Virus') },
{ value: 'abuse_content', label: gettext('Abuse Content') },
{ value: 'other', label: gettext('Other') },
];
} }
onAbuseReport = () => { onAbuseReport = () => {
@@ -45,8 +52,8 @@ class AddAbuseReportDialog extends React.Component {
}); });
}; };
onAbuseTypeChange = (event) => { onAbuseTypeChange = (option) => {
let type = event.target.value; let type = option.value;
if (type === this.state.abuseType) { if (type === this.state.abuseType) {
return; return;
} }
@@ -70,13 +77,13 @@ class AddAbuseReportDialog extends React.Component {
<ModalBody> <ModalBody>
<Form> <Form>
<FormGroup> <FormGroup>
<Label for="abuse-type-select">{gettext('Abuse Type')}</Label> <Label>{gettext('Abuse Type')}</Label>
<Input type="select" id="abuse-type-select" onChange={(event) => this.onAbuseTypeChange(event)}> <SeahubSelect
<option value='copyright'>{gettext('Copyright Infringement')}</option> options={this.typeOptions}
<option value='virus'>{gettext('Virus')}</option> value={this.typeOptions.find(option => option.value === this.state.abuseType) || this.typeOptions[0]}
<option value='abuse_content'>{gettext('Abuse Content')}</option> onChange={this.onAbuseTypeChange}
<option value='other'>{gettext('Other')}</option> isClearable={false}
</Input> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label>{gettext('Contact Information')}</Label> <Label>{gettext('Contact Information')}</Label>