Skip to content

Commit

Permalink
chore: format, orgs returned
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Nov 29, 2024
1 parent 74ad0cd commit 6b43d6d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
7 changes: 6 additions & 1 deletion static/scripts/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Octokit> {
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/rendering/config-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions static/scripts/rendering/input-parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ 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.
*/

Object.keys(config).forEach((key) => {
if (config[key] === null || config[key] === undefined || config[key] === "") {
delete config[key];
}
})
});

return { config, missing };
} else {
Expand Down
12 changes: 5 additions & 7 deletions static/scripts/rendering/write-add-remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion static/utils/toaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ export function toastNotification(
startAutoDismiss();

return kill;
}
}

0 comments on commit 6b43d6d

Please sign in to comment.