-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: show issueExtraDetails data on treeDetails #909
Conversation
f53d62c
to
7248507
Compare
dashboard/src/types/issueExtras.ts
Outdated
enum PossibleIssueTags { | ||
Mainline = 'mainline', | ||
Stable = 'stable', | ||
LinuxNext = 'linux-next', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://dev.to/ivanzm123/dont-use-enums-in-typescript-they-are-very-dangerous-57bh
enum PossibleIssueTags { | |
Mainline = 'mainline', | |
Stable = 'stable', | |
LinuxNext = 'linux-next', | |
} | |
const PossibleIssueTags = { | |
mainline: 'mainline', | |
stable: 'stable', | |
linuxNext : 'linux-next', | |
} as const |
@@ -150,6 +140,19 @@ const BuildTab = ({ treeDetailsLazyLoaded }: BuildTab): JSX.Element => { | |||
diffFilter={diffFilter} | |||
/> | |||
</div> | |||
<MemoizedIssuesList | |||
title={<FormattedMessage id="global.issues" />} | |||
issues={treeDetailsData.buildsIssues || []} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
issues={treeDetailsData.buildsIssues || []} | |
issues={treeDetailsData.buildsIssues ?? []} |
issuesExtras: { | ||
data?: IssueExtraDetailsResponse; | ||
isLoading: boolean; | ||
status: QuerySelectorStatus; | ||
error: UseQueryResult['error']; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can add a generic type
type TypeName = <T> {
data?: T;
isLoading: boolean;
status: QuerySelectorStatus;
error: UseQueryResult['error'];
};
type IssueExtrar = TypeName<IssueExtraDetailsResponse>
dashboard/src/api/issueExtras.ts
Outdated
}: ITabsIssues): IssueKeyList => { | ||
const result: IssueKeyList = []; | ||
|
||
for (const issue of buildIssues || []) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildIssues.forEach...
dashboard/src/api/issueExtras.ts
Outdated
for (const issue of buildIssues || []) { | ||
result.push([issue.id, issue.version]); | ||
} | ||
for (const issue of bootIssues || []) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto foreach
dashboard/src/api/issueExtras.ts
Outdated
for (const issue of bootIssues || []) { | ||
result.push([issue.id, issue.version]); | ||
} | ||
for (const issue of testIssues || []) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto foreach
7248507
to
8a2d715
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! I'd only hope the component was a little bit more "smart" when deciding when to start hiding the issue comment but it's working nice as is
8a2d715
to
013e746
Compare
013e746
to
ae109d3
Compare
How to test
Go to any treeDetails that have issues; all of them should have at least the first_seen information, the tags are optional and depend on each issue in particular.
Examples are sashal-next/linus-next, stable/linux-6.6.y and android/android12-5.10-lts.
You can check every tree that the issues are present by looking in the network tab of dev tools and see the response for the /issue/extras/ request.
Reference (from stabe/linux-6.6.y):
![image](https://private-user-images.githubusercontent.com/76781499/412551088-16545de2-e75e-44aa-99fc-7b4eee5461c1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Nzk4OTcsIm5iZiI6MTczOTU3OTU5NywicGF0aCI6Ii83Njc4MTQ5OS80MTI1NTEwODgtMTY1NDVkZTItZTc1ZS00NGFhLTk5ZmMtN2I0ZWVlNTQ2MWMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAwMzMxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMwMGUzM2FhNGU3ZjYyMGQ2N2E5ZmRjNDk2NjNlMGU5OWFjMTUzYjA1NmFlMzM2NzFjZWRlODY0MWMwMTg1ZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Knr5okhjBvrp0TDX9FhO4uNHjxEOwDpI_a8jlrbwelo)
Closes #870