Skip to content

Commit

Permalink
chore: address admin UI linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Jan 10, 2025
1 parent dad785c commit d71abd8
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 195 deletions.
18 changes: 9 additions & 9 deletions ui/admin/app/components/oauth-apps/OAuthAppTypeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import { OAuthProvider } from "~/lib/model/oauthApps/oauth-helpers";
import { cn } from "~/lib/utils";

const IconMap = {
[OAuthProvider.Atlassian]: FaAtlassian,
[OAuthProvider.GitHub]: FaGithub,
[OAuthProvider.Slack]: FaSlack,
[OAuthProvider.Salesforce]: FaSalesforce,
[OAuthProvider.Google]: FaGoogle,
[OAuthProvider.Microsoft365]: FaMicrosoft,
[OAuthProvider.Notion]: NotionLogoIcon,
[OAuthProvider.Zoom]: BiLogoZoom,
[OAuthProvider.Custom]: KeyIcon,
[OAuthProvider.Atlassian]: FaAtlassian,
[OAuthProvider.GitHub]: FaGithub,
[OAuthProvider.Slack]: FaSlack,
[OAuthProvider.Salesforce]: FaSalesforce,
[OAuthProvider.Google]: FaGoogle,
[OAuthProvider.Microsoft365]: FaMicrosoft,
[OAuthProvider.Notion]: NotionLogoIcon,
[OAuthProvider.Zoom]: BiLogoZoom,
[OAuthProvider.Custom]: KeyIcon,
};

export function OAuthAppTypeIcon({
Expand Down
20 changes: 10 additions & 10 deletions ui/admin/app/lib/model/oauthApps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import { ZoomOAuthApp } from "~/lib/model/oauthApps/providers/zoom";
import { EntityMeta } from "~/lib/model/primitives";

export const OAuthAppSpecMap = {
[OAuthProvider.Atlassian]: AtlassianOAuthApp,
[OAuthProvider.GitHub]: GitHubOAuthApp,
[OAuthProvider.Google]: GoogleOAuthApp,
[OAuthProvider.Microsoft365]: Microsoft365OAuthApp,
[OAuthProvider.Slack]: SlackOAuthApp,
[OAuthProvider.Salesforce]: SalesforceOAuthApp,
[OAuthProvider.Notion]: NotionOAuthApp,
[OAuthProvider.Zoom]: ZoomOAuthApp,
// Custom OAuth apps are intentionally omitted from the map.
// They are handled separately
[OAuthProvider.Atlassian]: AtlassianOAuthApp,
[OAuthProvider.GitHub]: GitHubOAuthApp,
[OAuthProvider.Google]: GoogleOAuthApp,
[OAuthProvider.Microsoft365]: Microsoft365OAuthApp,
[OAuthProvider.Slack]: SlackOAuthApp,
[OAuthProvider.Salesforce]: SalesforceOAuthApp,
[OAuthProvider.Notion]: NotionOAuthApp,
[OAuthProvider.Zoom]: ZoomOAuthApp,
// Custom OAuth apps are intentionally omitted from the map.
// They are handled separately
} as const;

export type OAuthAppDetail = OAuthAppSpec & {
Expand Down
18 changes: 9 additions & 9 deletions ui/admin/app/lib/model/oauthApps/oauth-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { ZodObject, ZodType } from "zod";
import { ApiUrl } from "~/lib/routers/baseRouter";

export const OAuthProvider = {
Atlassian: "atlassian",
GitHub: "github",
Google: "google",
Microsoft365: "microsoft365",
Slack: "slack",
Salesforce: "salesforce",
Notion: "notion",
Zoom: "zoom",
Custom: "custom",
Atlassian: "atlassian",
GitHub: "github",
Google: "google",
Microsoft365: "microsoft365",
Slack: "slack",
Salesforce: "salesforce",
Notion: "notion",
Zoom: "zoom",
Custom: "custom",
} as const;
export type OAuthProvider = (typeof OAuthProvider)[keyof typeof OAuthProvider];

Expand Down
174 changes: 87 additions & 87 deletions ui/admin/app/lib/model/oauthApps/providers/atlassian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,93 +13,93 @@ const schema = z.object({
});

const steps: OAuthFormStep<typeof schema.shape>[] = [
{
type: "markdown",
text:
"### Step 1: Create a new Atlassian OAuth 2.0 Integration\n" +
"- Navigate to [Create a new OAuth 2.0 (3LO) integration](https://developer.atlassian.com/console/myapps/create-3lo-app)\n" +
"- Enter `Obot` as the integration name.\n" +
"- Click the checkbox to the terms and conditions.\n" +
"- Click the `Create` button.\n",
},
{
type: "markdown",
text:
"### Step 2: Configure OAuth Scopes\n" +
"Configure required OAuth Scopes by completing both sections below.\n",
},
{
type: "sectionGroup",
sections: [
{
title: "User identity API Scopes",
steps: [
{
type: "markdown",
text:
"- Navigate to the `Permissions` tab in the sidebar.\n" +
"- Click on the `Add` button for `User identity API`\n" +
"- Click on the `Configure` button for `User identity API`\n" +
"- Click on the `Edit Scopes` button to open the `Edit User identity API` modal.\n" +
"- Click the checkboxes to select the `read:me` and `read:account` scopes.\n" +
"- Click on the `Save` button.\n",
},
],
},
{
title: "Jira API Scopes",
steps: [
{
type: "markdown",
text:
"- Navigate to the `Permissions` tab in the sidebar.\n" +
"- Click on the `Add` button for `Jira API`\n" +
"- Click on the `Configure` button for `Jira API`\n" +
"- Click on the `Edit Scopes` button to open the `Edit Jira API` modal.\n" +
"- Click the checkboxes to select the `read:jira-work`, `write:jira-work`, and `read:jira-user` scopes.\n" +
"- Click on the `Save` button.\n",
},
],
},
],
},
{
type: "markdown",
text:
"### Step 3: Configure your OAuth Consent Screen\n" +
"- Navigate to the `Authorization` tab in the sidebar.\n" +
"- Click on the `Add` button for `OAuth 2.0 (3LO)`.\n" +
"- Enter the URL below in the `Callback URL` box and click on the `Save changes` button:\n",
},
{
type: "copy",
text: getOAuthLinks("atlassian").redirectURL,
},
{
type: "markdown",
text:
"### Step 4: Register your OAuth App credentials with Obot\n" +
"- Navigate to the `Settings` tab in the sidebar.\n" +
"- Enter the `Client ID` and `Client Secret` from the `Authentication details` section into the fields below\n",
},
{ type: "input", input: "clientID", label: "Client ID" },
{
type: "input",
input: "clientSecret",
label: "Client Secret",
inputType: "password",
},
{
type: "markdown",
text:
"### (Optional): Make Your OAuth App Public\n" +
"By default, your OAuth App is private. When users authorize your atlassian app to access their account, they will see a warning like: `Make sure you trust [Your App Name]`. To remove this warning, follow these steps to make your app public:\n" +
"- Navigate to the `Distribution` tab in the sidebar\n" +
"- Click on `Edit` button and change the `DISTRIBUTION STATUS` of your app to `Sharing`.\n" +
"- Fill in the required vendor and security details in the same window\n" +
"- Once you've completed the required details, click the **Save Changes** button.\n" +
"\nYour app is now public, and users will no longer see the warning message.\n",
},
{
type: "markdown",
text:
"### Step 1: Create a new Atlassian OAuth 2.0 Integration\n" +
"- Navigate to [Create a new OAuth 2.0 (3LO) integration](https://developer.atlassian.com/console/myapps/create-3lo-app)\n" +
"- Enter `Obot` as the integration name.\n" +
"- Click the checkbox to the terms and conditions.\n" +
"- Click the `Create` button.\n",
},
{
type: "markdown",
text:
"### Step 2: Configure OAuth Scopes\n" +
"Configure required OAuth Scopes by completing both sections below.\n",
},
{
type: "sectionGroup",
sections: [
{
title: "User identity API Scopes",
steps: [
{
type: "markdown",
text:
"- Navigate to the `Permissions` tab in the sidebar.\n" +
"- Click on the `Add` button for `User identity API`\n" +
"- Click on the `Configure` button for `User identity API`\n" +
"- Click on the `Edit Scopes` button to open the `Edit User identity API` modal.\n" +
"- Click the checkboxes to select the `read:me` and `read:account` scopes.\n" +
"- Click on the `Save` button.\n",
},
],
},
{
title: "Jira API Scopes",
steps: [
{
type: "markdown",
text:
"- Navigate to the `Permissions` tab in the sidebar.\n" +
"- Click on the `Add` button for `Jira API`\n" +
"- Click on the `Configure` button for `Jira API`\n" +
"- Click on the `Edit Scopes` button to open the `Edit Jira API` modal.\n" +
"- Click the checkboxes to select the `read:jira-work`, `write:jira-work`, and `read:jira-user` scopes.\n" +
"- Click on the `Save` button.\n",
},
],
},
],
},
{
type: "markdown",
text:
"### Step 3: Configure your OAuth Consent Screen\n" +
"- Navigate to the `Authorization` tab in the sidebar.\n" +
"- Click on the `Add` button for `OAuth 2.0 (3LO)`.\n" +
"- Enter the URL below in the `Callback URL` box and click on the `Save changes` button:\n",
},
{
type: "copy",
text: getOAuthLinks("atlassian").redirectURL,
},
{
type: "markdown",
text:
"### Step 4: Register your OAuth App credentials with Obot\n" +
"- Navigate to the `Settings` tab in the sidebar.\n" +
"- Enter the `Client ID` and `Client Secret` from the `Authentication details` section into the fields below\n",
},
{ type: "input", input: "clientID", label: "Client ID" },
{
type: "input",
input: "clientSecret",
label: "Client Secret",
inputType: "password",
},
{
type: "markdown",
text:
"### (Optional): Make Your OAuth App Public\n" +
"By default, your OAuth App is private. When users authorize your atlassian app to access their account, they will see a warning like: `Make sure you trust [Your App Name]`. To remove this warning, follow these steps to make your app public:\n" +
"- Navigate to the `Distribution` tab in the sidebar\n" +
"- Click on `Edit` button and change the `DISTRIBUTION STATUS` of your app to `Sharing`.\n" +
"- Fill in the required vendor and security details in the same window\n" +
"- Once you've completed the required details, click the **Save Changes** button.\n" +
"\nYour app is now public, and users will no longer see the warning message.\n",
},
];

export const AtlassianOAuthApp = {
Expand Down
Loading

0 comments on commit d71abd8

Please sign in to comment.