-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add contributor avatar and fix Weekly Meeting date (#319)
Signed-off-by: laixingyou <[email protected]>
- Loading branch information
1 parent
63dde50
commit 0b7f788
Showing
9 changed files
with
175 additions
and
31 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...ules/analyze/DataView/MetricDetail/MetricContributor/ContributorTable/ContributorName.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import { IoPeopleCircle } from 'react-icons/io5'; | ||
import Image from 'next/image'; | ||
|
||
const DomainPersona = ({ name, origin }) => { | ||
let icon = getIcons(origin, name); | ||
|
||
return ( | ||
<div className="flex"> | ||
<div>{icon}</div> | ||
{name} | ||
</div> | ||
); | ||
}; | ||
|
||
const getIcons = (origin, name) => { | ||
switch (origin) { | ||
case 'github': | ||
return ( | ||
<div className="relative mr-2 h-6 w-6 overflow-hidden rounded-full border border-gray-100"> | ||
<Image | ||
src={'https://github.com/' + name + '.png'} | ||
onError={(e) => (e.currentTarget.src = '/images/github.png')} | ||
unoptimized | ||
fill={true} | ||
style={{ | ||
objectFit: 'cover', | ||
}} | ||
alt="icon" | ||
placeholder="blur" | ||
blurDataURL="/images/github.png" | ||
/> | ||
</div> | ||
); | ||
case 'gitee': | ||
return ( | ||
<div className="relative mr-2 h-6 w-6 overflow-hidden rounded-full border border-gray-100"> | ||
<Image | ||
src={'https://gitee.com/' + name + '.png'} | ||
onError={(e) => | ||
(e.currentTarget.src = '/images/logos/gitee-red.svg') | ||
} | ||
unoptimized | ||
fill={true} | ||
style={{ | ||
objectFit: 'cover', | ||
}} | ||
alt="icon" | ||
placeholder="blur" | ||
blurDataURL="/images/logos/gitee-red.svg" | ||
/> | ||
</div> | ||
); | ||
// return <SiGitee color="#c71c27" className="mr-0" />; | ||
default: | ||
return <IoPeopleCircle />; | ||
} | ||
}; | ||
|
||
export default DomainPersona; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...modules/analyze/DataView/MetricDetail/MetricContributor/ContributorTable/tableDownload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import axios from 'axios'; | ||
|
||
export enum Status { | ||
PENDING = 'pending', | ||
PROGRESS = 'progress', | ||
COMPLETE = 'complete', | ||
UNKNOWN = 'unknown', | ||
} | ||
export const apiDownloadFiles = (path, fileName, onFinish) => { | ||
let link = document.createElement('a'); | ||
link.href = path; | ||
link.download = fileName + '.csv'; | ||
link.style.display = 'none'; | ||
document.body.appendChild(link); | ||
link.click(); | ||
onFinish && onFinish(); | ||
document.body.removeChild(link); | ||
}; | ||
export const getContributorPolling = (uuid) => { | ||
return axios.get('/api/v1/contributor/export_state/' + uuid); | ||
}; | ||
export const getContributorExport = (query) => { | ||
return axios.post('/api/v1/contributor/export', query, { | ||
headers: { | ||
accept: 'application/json', | ||
}, | ||
}); | ||
}; | ||
export const getIssuePolling = (uuid) => { | ||
return axios.get('/api/v1/issue/export_state/' + uuid); | ||
}; | ||
export const getIssueExport = (query) => { | ||
return axios.post('/api/v1/issue/export', query, { | ||
headers: { | ||
accept: 'application/json', | ||
}, | ||
}); | ||
}; | ||
export const getPrPolling = (uuid) => { | ||
return axios.get('/api/v1/pull/export_state/' + uuid); | ||
}; | ||
export const getPrExport = (query) => { | ||
return axios.post('/api/v1/pull/export', query, { | ||
headers: { | ||
accept: 'application/json', | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -656,6 +656,7 @@ query contributorsDetailList( | |
mileageType | ||
organization | ||
} | ||
origin | ||
page | ||
totalPage | ||
} | ||
|