Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 2, 2023. It is now read-only.
/golangci-webPublic archive

Commit3ecd409

Browse files
committed
show report by analysisGuid query
1 parent056d6e7 commit3ecd409

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

‎src/components/pages/Report.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface IStateProps {
2929
}
3030

3131
interfaceIDispatchProps{
32-
fetchAnalysis(owner:string,name:string,prNumber?:number):void;
32+
fetchAnalysis(owner:string,name:string,prNumber?:number,analysisGuid?:string):void;
3333
toggle(name:string,value?:boolean):void;
3434
buildLogTogglePanels(keys:string[]):void;
3535
}
@@ -43,7 +43,8 @@ class Report extends React.Component<IProps> {
4343

4444
privatefetchAnalysis(){
4545
constp=this.props.match.params;
46-
this.props.fetchAnalysis(p.owner,p.name,Number(p.prNumber));
46+
constqs=queryString.parse(this.props.location.search);
47+
this.props.fetchAnalysis(p.owner,p.name,Number(p.prNumber),qs.analysisGuid);
4748
}
4849

4950
publiccomponentWillMount(){

‎src/modules/analyzes/index.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ enum AnalyzesAction {
1111
BuildLogTogglePanels="@@GOLANGCI/BUILDLOG/PANELS/TOGGLE",
1212
}
1313

14-
exportconstfetchAnalysis=(owner:string,name:string,prNumber?:number)=>({
14+
exportconstfetchAnalysis=(owner:string,name:string,prNumber?:number,analysisGuid?:string)=>({
1515
type:AnalyzesAction.Fetch,
1616
owner,
1717
name,
1818
prNumber,
19+
analysisGuid,
1920
});
2021

2122
exportconstbuildLogTogglePanels=(keys:string[])=>({
@@ -146,11 +147,15 @@ export const reducer = combineReducers<IAnalyzesStore>({
146147
buildLogActivePanels,
147148
});
148149

149-
function*doFetchAnalysis({prNumber, owner, name}:any){
150+
function*doFetchAnalysis({prNumber, owner, name, analysisGuid}:any){
150151
conststate:IAppStore=yieldselect();
151-
constapiUrl=prNumber ?
152+
letapiUrl=prNumber ?
152153
`/v1/repos/github.com/${owner}/${name}/pulls/${prNumber}` :
153154
`/v1/repos/github.com/${owner}/${name}/repoanalyzes`;
155+
if(analysisGuid){
156+
apiUrl+=`?analysisGUID=${analysisGuid}`;
157+
}
158+
154159
constresp=yieldcall(makeApiGetRequest,apiUrl,state.auth.cookie);
155160
if(!resp||resp.error){
156161
yield*processError(apiUrl,resp,"Can't fetch analysis state");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp