diff --git a/static/scripts/authentication.ts b/static/scripts/authentication.ts index 3e38530..ad25036 100644 --- a/static/scripts/authentication.ts +++ b/static/scripts/authentication.ts @@ -153,7 +153,12 @@ export class AuthService { await getOrgConfigRepoUserPermissions(org); } - return Object.keys(orgConfigPermissions).filter((org) => orgConfigPermissions[org] === "admin" || orgConfigPermissions[org] === "write"); + return Array.from( + new Set([ + ...(listForAuthUser?.data.map((org) => org.login) || []), + ...Object.keys(orgConfigPermissions).filter((org) => orgConfigPermissions[org] !== "none"), + ]) + ); } public async getOctokit(): Promise { diff --git a/static/scripts/rendering/config-editor.ts b/static/scripts/rendering/config-editor.ts index 0f58bd1..259c25d 100644 --- a/static/scripts/rendering/config-editor.ts +++ b/static/scripts/rendering/config-editor.ts @@ -34,7 +34,7 @@ export function renderConfigEditor(renderer: ManifestRenderer, pluginManifest: M // If plugin is passed in, we want to inject those values into the inputs if (plugin) { - configInputs.forEach((input, i) => { + configInputs.forEach((input) => { const key = input.getAttribute("data-config-key"); if (!key) { throw new Error("Input key is required"); diff --git a/static/scripts/rendering/input-parsing.ts b/static/scripts/rendering/input-parsing.ts index 4715d65..a029bcd 100644 --- a/static/scripts/rendering/input-parsing.ts +++ b/static/scripts/rendering/input-parsing.ts @@ -109,8 +109,8 @@ export function parseConfigInputs( } /** - * We've ID'd the required fieds that are missing, now we check if there are any fields - * that have null | undefined values and remove them from the configuration object, + * We've ID'd the required fields that are missing, now we check if there are any fields + * that have null | undefined values and remove them from the configuration object, * since the defaults will be used the config prop does not need to be present. */ @@ -118,7 +118,7 @@ export function parseConfigInputs( if (config[key] === null || config[key] === undefined || config[key] === "") { delete config[key]; } - }) + }); return { config, missing }; } else { diff --git a/static/scripts/rendering/write-add-remove.ts b/static/scripts/rendering/write-add-remove.ts index 3f40c12..6ada9ec 100644 --- a/static/scripts/rendering/write-add-remove.ts +++ b/static/scripts/rendering/write-add-remove.ts @@ -5,7 +5,6 @@ import { parseConfigInputs } from "./input-parsing"; import { getOfficialPluginConfig } from "../../utils/storage"; import { renderConfigEditor } from "./config-editor"; import { normalizePluginName } from "./utils"; -import { renderPluginSelector } from "./plugin-select"; import { handleBackButtonClick } from "./navigation"; /** @@ -128,15 +127,14 @@ async function notificationConfigPush(renderer: ManifestRenderer) { const container = document.querySelector("#manifest-gui") as HTMLElement | null; const readmeContainer = document.querySelector(".readme-container") as HTMLElement | null; if (container && readmeContainer) { - container.style.transition = 'opacity 0.5s ease'; - container.style.opacity = '0'; - readmeContainer.style.transition = 'opacity 0.5s ease'; - readmeContainer.style.opacity = '0'; + container.style.transition = "opacity 0.5s ease"; + container.style.opacity = "0"; + readmeContainer.style.transition = "opacity 0.5s ease"; + readmeContainer.style.opacity = "0"; setTimeout(() => { handleBackButtonClick(renderer); - container.style.opacity = '1'; + container.style.opacity = "1"; }, 500); - } else { handleBackButtonClick(renderer); } diff --git a/static/utils/toaster.ts b/static/utils/toaster.ts index b409be7..08d3278 100644 --- a/static/utils/toaster.ts +++ b/static/utils/toaster.ts @@ -88,4 +88,4 @@ export function toastNotification( startAutoDismiss(); return kill; -} \ No newline at end of file +}