Skip to content
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: gsoc label #89

Merged
merged 2 commits into from
Dec 3, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/lib/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { SortingTag } from '@/models/SortingTag';

export const BASE_URL = 'https://api.github.com';
export const ISSUE_URL = `${BASE_URL}/search/issues`;
export const DEFAULT_LABELS = ['easy', 'first', 'good'];
export const INITIAL_LABELS = ['easy', 'first', 'good'];
export const QUERIES = ['state:open'].join('+');

export const DEFAULT_LANGUAGE: Language = 'all';
export const DEFAULT_ORDERING: Ordering = 'desc';
export const DEFAULT_LABEL: Label = 'hacktoberfest';
export const DEFAULT_LABEL: Label = 'gsoc';
export const DEFAULT_PAGE = 1;
export const DEFAULT_SORTING_TAG: SortingTag = 'best-match';
export const ISSUE_PER_PAGE = 10;
Expand Down
10 changes: 7 additions & 3 deletions src/lib/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
DEFAULT_LABELS,
DEFAULT_LABEL,
INITIAL_LABELS,
ISSUE_PER_PAGE,
ISSUE_URL,
QUERIES,
Expand Down Expand Up @@ -142,10 +143,13 @@ export const composeUrl = (
label: Label
) => {
const langQuery = lang && lang !== 'all' ? `+language:${lang}` : '';
const defaultLabelQuery = `+label:${DEFAULT_LABELS.join(',')}`;
const defaultLabelQuery = `+label:${
label === 'none' ? INITIAL_LABELS.join(',') : label
}`;

const labelQuery =
label && label.toLocaleLowerCase() !== 'none'
? `${defaultLabelQuery},${label}`
? `${defaultLabelQuery}`
: defaultLabelQuery;

const searchParams = {
Expand Down
3 changes: 2 additions & 1 deletion src/models/Label.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
export let label = [
'none',
'hacktoberfest',
'gsoc',
'good first issue',
'bug',
'enhancement',
'documentation',
'easy fix',
];
] as const;

export const sortedLabels = [...label];

Expand Down
Loading