diff --git a/src/constants.ts b/src/constants.ts index 6c0e6105..25dedb79 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -8,6 +8,7 @@ export const OPEN_SAUCED_INSIGHTS_DOMAIN = "insights.opensauced.pizza"; export const OPEN_SAUCED_USERS_ENDPOINT = "https://api.opensauced.pizza/v1/users"; export const OPEN_SAUCED_REPOS_ENDPOINT = "https://api.opensauced.pizza/v1/repos"; export const OPEN_SAUCED_SESSION_ENDPOINT = "https://api.opensauced.pizza/v1/auth/session"; +export const OPEN_SAUCED_USER_INSIGHTS_ENDPOINT = "https://api.opensauced.pizza/v1/user/insights"; // GitHub constants/selectors export const GITHUB_PROFILE_MENU_SELECTOR = ".p-nickname.vcard-username.d-block"; diff --git a/src/content-scripts/components/InsightsSelectDropdown/InsightsSelectDropdown.ts b/src/content-scripts/components/InsightsSelectDropdown/InsightsSelectDropdown.ts new file mode 100644 index 00000000..d5fce61f --- /dev/null +++ b/src/content-scripts/components/InsightsSelectDropdown/InsightsSelectDropdown.ts @@ -0,0 +1,115 @@ +import "../../content-scripts.css"; +import { createHtmlElement } from "../../../utils/createHtmlElement"; +import { getAuthToken } from "../../../utils/checkAuthentication"; +import { getUserInsightsData, getRepoData, updateInsight } from "../../../utils/fetchOpenSaucedApiData"; +import { IInsight } from "../../../ts/InsightDto"; + +export const InsightsSelectDropdown = async (ownerName: string, repoName: string) => { + const insightsDropdown = createHtmlElement("div", { + className: "SelectMenu cursor-default right-0 mt-1 hidden text-inherit", + innerHTML: ` +