Skip to content
Open
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
2 changes: 1 addition & 1 deletion github/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "826f0d95-9e25-48a6-a781-a32f147230a5",
"version": "0.0.1",
"requiredApiVersion": "^1.36.0",
"requiredApiVersion": "^1.44.0",
"iconFile": "icon.png",
"author": {
"name": "Samad Yar Khan",
Expand Down
5 changes: 3 additions & 2 deletions github/handlers/EventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export async function UnsubscribeAllEvents(
if (!isValidRepo) {
return;
}

let events: Array<string> = [
"pull_request",
"push",
Expand Down Expand Up @@ -287,10 +287,11 @@ export async function ManageSubscriptions(
persistence: persistence,
http: http,
slashcommandcontext: context,
id: app.getID(),
});
await modify
.getUiController()
.openModalView(modal, { triggerId }, context.getSender());
.openSurfaceView(modal, { triggerId }, context.getSender());
} else {
console.log("Invalid Trigger ID !");
}
Expand Down
1,820 changes: 1,218 additions & 602 deletions github/handlers/ExecuteBlockActionHandler.ts

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions github/handlers/ExecuteViewClosedHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export class ExecuteViewClosedHandler {
persistence: this.persistence,
http: this.http,
uikitcontext: context,
id: this.app.getID(),
});
await this.modify.getUiController().updateModalView(
await this.modify.getUiController().updateSurfaceView(
modal,
{
triggerId: context.getInteractionData()
Expand All @@ -46,10 +47,10 @@ export class ExecuteViewClosedHandler {
case ModalsEnum.SEARCH_RESULT_VIEW:{
const room = context.getInteractionData().room;
const user = context.getInteractionData().user;

if (user?.id) {
let roomId;

if (room?.id) {
roomId = room.id;
await storeInteractionRoomData(this.persistence, user.id, roomId);
Expand All @@ -69,7 +70,7 @@ export class ExecuteViewClosedHandler {
case ModalsEnum.ISSUE_LIST_VIEW: {
const room = context.getInteractionData().room;
const user = context.getInteractionData().user;

if (user?.id) {
let roomId;
if (room?.id) {
Expand Down
399 changes: 233 additions & 166 deletions github/handlers/ExecuteViewSubmitHandler.ts

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions github/handlers/HandleIssues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export async function handleNewIssue(
persistence: persistence,
http: http,
slashcommandcontext: context,
id: app.getID()
});
await modify
.getUiController()
.openModalView(
.openSurfaceView(
modal,
{ triggerId },
context.getSender()
Expand Down Expand Up @@ -63,8 +64,8 @@ export async function handleIssues(
){
const triggerId= context.getTriggerId();
if(triggerId){
const modal = await GitHubIssuesStarterModal({modify,read,persistence,http,slashcommandcontext:context});
await modify.getUiController().openModalView(modal,{triggerId},context.getSender());
const modal = await GitHubIssuesStarterModal({modify,read,persistence,http,slashcommandcontext:context, id: app.getID()});
await modify.getUiController().openSurfaceView(modal,{triggerId},context.getSender());
}else{
console.log("invalid Trigger ID !");
}
Expand Down
8 changes: 5 additions & 3 deletions github/handlers/HandleRemider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ export async function handleReminder(
persistence: persistence,
http: http,
slashcommandcontext: context,
id: app.getID(),
});
await modify
.getUiController()
.openModalView(
.openSurfaceView(
modal,
{ triggerId },
context.getSender()
Expand Down Expand Up @@ -77,10 +78,11 @@ export async function ManageReminders(
persistence: persistence,
http: http,
slashcommandcontext: context,
id: app.getID(),
});
await modify
.getUiController()
.openModalView(modal, { triggerId }, context.getSender());
.openSurfaceView(modal, { triggerId }, context.getSender());
} else {
console.log("Invalid Trigger ID !");
}
Expand All @@ -93,4 +95,4 @@ export async function ManageReminders(
"Login to see to pull request reminders! `/github login`"
);
}
}
}
3 changes: 2 additions & 1 deletion github/handlers/MainModalHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ export async function handleMainModal(
persistence: persistence,
http: http,
slashcommandcontext: context,
id: app.getID(),
});
await modify
.getUiController()
.openModalView(
.openSurfaceView(
modal,
{ triggerId },
context.getSender()
Expand Down
3 changes: 2 additions & 1 deletion github/handlers/SearchHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ export async function handleSearch(
persistence: persistence,
http: http,
slashcommandcontext: context,
id: app.getID(),
});
await modify
.getUiController()
.openModalView(
.openSurfaceView(
modal,
{ triggerId },
context.getSender()
Expand Down
5 changes: 3 additions & 2 deletions github/handlers/UserProfileHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export async function handleUserProfileRequest(
read: read,
persistence: persistence,
http: http,
slashcommandcontext: context
slashcommandcontext: context,
id: app.getID(),
});
await modify.getUiController().openModalView(
await modify.getUiController().openSurfaceView(
modal,
{triggerId},
context.getSender()
Expand Down
6 changes: 5 additions & 1 deletion github/lib/commandUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { HandleInvalidRepoName } from "../handlers/HandleInvalidRepoName";
import { handleMainModal } from "../handlers/MainModalHandler";
import { createReminder } from "../handlers/CreateReminder";
import { ManageReminders, handleReminder } from "../handlers/HandleRemider";
import { getAccessTokenForUser } from "../persistance/auth";

export class CommandUtility implements ExecutorProps {
sender: IUser;
Expand Down Expand Up @@ -264,10 +265,12 @@ export class CommandUtility implements ExecutorProps {
}

private async handleTriParamCommand() {
let accessToken = await getAccessTokenForUser(this.read, this.sender, this.app.oauth2Config);
const data = {
repository: this.command[0],
query: this.command[1],
number: this.command[2],
accessToken: accessToken,
};

const isValidRepo = await HandleInvalidRepoName(
Expand All @@ -293,10 +296,11 @@ export class CommandUtility implements ExecutorProps {
persistence: this.persistence,
http: this.http,
slashcommandcontext: this.context,
id: this.app.getID(),
});
await this.modify
.getUiController()
.openModalView(modal, { triggerId }, this.context.getSender());
.openSurfaceView(modal, { triggerId }, this.context.getSender());
} else {
console.log("invalid Trigger ID !");
}
Expand Down
Loading