Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions components/dashboard/GoodFirstIssues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,24 @@ interface GoodFirstIssuesProps {
issues: Issue[];
}

/**
* @description Filter issues based on selected repo and area.
*
* @param {Issue[]} issues - The list of issues to filter.
* @param {FiltersType} filters - The filters to apply.
* @returns {Issue[]} The filtered list of issues.
*/
export function filterIssues(issues: Issue[], filters: FiltersType): Issue[] {
let result = issues;

if (filters.selectedRepo !== 'Repository - All') {
if (filters.selectedRepo !== 'All') {
result = result.filter((issue) => issue.repo === filters.selectedRepo);
}
if (filters.selectedArea !== 'Area - All') {
if (filters.selectedArea !== 'All') {
result = result.filter((issue) => issue.area === filters.selectedArea);
}

return result;
}

/**
* @description Component that displays a list of good first issues.
*
* @param {GoodFirstIssuesProps} props - The props for the component.
* @param {Issue[]} props.issues - The list of good first issues.
*/
export default function GoodFirstIssues({ issues }: GoodFirstIssuesProps) {
const [selectedRepo, setSelectedRepo] = useState('All');
const [selectedArea, setSelectedArea] = useState('All');

// Get current issues

let filteredIssues = issues;

const allIssues = issues;

if (selectedRepo !== 'All') {
filteredIssues = filteredIssues.filter((issue) => issue.repo === selectedRepo);
}
if (selectedArea !== 'All') {
filteredIssues = filteredIssues.filter((issue) => issue.area === selectedArea);
}
const filteredIssues = filterIssues(issues, { selectedRepo, selectedArea });

return (
<Table
Expand All @@ -68,7 +44,7 @@ export default function GoodFirstIssues({ issues }: GoodFirstIssuesProps) {
className='ml-auto'
data-testid='GoodFirstIssues-filter-component'
issues={filteredIssues}
allIssues={allIssues}
allIssues={issues}
setSelectedRepo={setSelectedRepo}
setSelectedArea={setSelectedArea}
selectedArea={selectedArea}
Expand Down
2 changes: 1 addition & 1 deletion markdown/blog/shai-hulud-postmortem.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Regardless of how much we prepare, security incidents can still occur. This inci

- Have backup maintainers with publishing rights and revoking rights for tokens to reduce single points of failure.
- Token rotation and limited scope tokens should be enforced. The NPM token we were using was three years old and has now been revoked.
- Got to know about a [workflow with unsecured context](https://github.com/asyncapi/cli/blob/master/.github/workflows/auto-changeset.yml) in GitHub Actions. Although it is not the root cause here, we have fixed it to avoid any future risks in [PR #1909](https://github.com/asyncapi/cli/pull/1909)
- Got to know about a [workflow with unsecured context](https://github.com/asyncapi/cli/blob/6729f4c087c668e34106a21e766e651b6f0a2b5f/.github/workflows/auto-changeset.yml) in GitHub Actions. Although it is not the root cause here, we have fixed it to avoid any future risks in [PR #1909](https://github.com/asyncapi/cli/pull/1909)


**If you have any further questions or need assistance, please do not hesitate to reach out to us at [security@asyncapi.com](mailto:security@asyncapi.com)**
Expand Down
Loading