Skip to content

Commit

Permalink
🐛 remove unuse code
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed Dec 2, 2020
1 parent a17362b commit a1825e8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
29 changes: 1 addition & 28 deletions src/common/backend/services/github/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,16 @@ const visibilityOptions = [
];

const GithubForm: React.FC<GithubFormProps & FormComponentProps> = ({
form: { getFieldDecorator, getFieldValue },
form: { getFieldDecorator },
info,
verified,
}) => {
const disabled = verified || !!info;
let initAccessToken;
let visibility;
let savePath;
if (info) {
initAccessToken = info.accessToken;
visibility = info.visibility;
savePath = info.savePath;
}
return (
<Fragment>
Expand Down Expand Up @@ -122,31 +120,6 @@ const GithubForm: React.FC<GithubFormProps & FormComponentProps> = ({
/>
)}
</Form.Item>
<Form.Item
label={
<FormattedMessage
id="backend.services.github.form.storageLocation.code.savePath"
defaultMessage="Save Path"
/>
}
>
{getFieldDecorator('savePath', {
initialValue: savePath,
rules: [
{
required: false,
},
],
})(
<Input
disabled={getFieldValue('storageLocation') === 'issue'}
placeholder={locale.format({
id: 'backend.services.github.form.storageLocation.code.savePathPlaceHolder',
defaultMessage: 'Only takes effect when saving to code.',
})}
/>
)}
</Form.Item>
</Fragment>
);
};
Expand Down
2 changes: 0 additions & 2 deletions src/common/backend/services/github/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Repository, CreateDocumentRequest } from '../interface';
export interface GithubBackendServiceConfig {
accessToken: string;
visibility: string;
storageLocation: string;
savePath: string;
}

export interface GithubCreateDocumentRequest extends CreateDocumentRequest {
Expand Down
4 changes: 0 additions & 4 deletions src/common/backend/services/github/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export default class GithubDocumentService implements DocumentService {
return md5(this.config.accessToken);
};

getStorageLocation = () => {
return this.config.storageLocation;
};

getUserInfo = async () => {
const data = await this.request.get<GithubUserInfoResponse>('user');
const { name, avatar_url: avatar, html_url: homePage, bio: description } = data.data;
Expand Down

0 comments on commit a1825e8

Please sign in to comment.