Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed contribution graph from /github me #54

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 3 additions & 5 deletions github/handlers/ExecuteBlockActionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class ExecuteBlockActionHandler {
let profileShareParams: string[] = [];

if (profileData.length == 0){
profileShareParams = ['username', 'avatar', 'email', 'bio', 'followers', 'following' , 'contributionGraph'];
profileShareParams = ['username', 'avatar', 'email', 'bio', 'followers', 'following' ];
}
else {
const dat = profileData[0] as {profileParams : string[]};
Expand All @@ -317,7 +317,7 @@ export class ExecuteBlockActionHandler {
}

profileShareParams.map((value) => {
if (value != 'contributionGraph' && value != 'avatar'){
if ( value != 'avatar'){
block.addSectionBlock({
text : block.newPlainTextObject(value),
})
Expand All @@ -330,9 +330,7 @@ export class ExecuteBlockActionHandler {
}
})

if (profileShareParams.includes('contributionGraph')){
block.addImageBlock({imageUrl : `https://activity-graph.herokuapp.com/graph?username=${userProfile.username}&bg_color=ffffff&color=708090&line=24292e&point=24292e`, altText: "Github Contribution Graph"})
}



if(user?.id){
Expand Down
14 changes: 3 additions & 11 deletions github/modals/UserProfileModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,9 @@ export async function userProfileModal({
]
});

block.addDividerBlock();

block.addImageBlock({imageUrl : githubActivityGraphUrl(userInfo.username), altText: "Github Contribution Graph"});



block.addDividerBlock();

block.addSectionBlock({
text: block.newPlainTextObject("Select from the following options.")
})
// block.addSectionBlock({
// text: block.newPlainTextObject("Select from the following options.")
// })

block.addActionsBlock({
elements : [
Expand Down
129 changes: 62 additions & 67 deletions github/modals/profileShareModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,96 +13,91 @@ export async function shareProfileModal({
http,
slashcommandcontext,
uikitcontext
} : {
modify : IModify,
}: {
modify: IModify,
read: IRead,
persistence: IPersistence,
http: IHttp,
slashcommandcontext?: SlashCommandContext,
uikitcontext?: UIKitInteractionContext
}) : Promise<IUIKitModalViewParam> {
}): Promise<IUIKitModalViewParam> {

const viewId = "ProfileShareView";
const block = modify.getCreator().getBlockBuilder();

block.addSectionBlock({
text: block.newPlainTextObject("Select from the following options.")
})
block.addActionsBlock({

elements : [
elements: [
block.newMultiStaticElement({
actionId: ModalsEnum.SHARE_PROFILE_PARAMS,
initialValue: ['username', 'avatar', 'email', 'bio', 'followers', 'following' , 'contributionGraph'],
initialValue: ['username', 'avatar', 'email', 'bio', 'followers', 'following'],
options: [
{
value: 'followers',
text: {
type: TextObjectType.PLAINTEXT,
text: 'Followers',
emoji: true,
}
},
{
value: 'following',
text: {
type: TextObjectType.PLAINTEXT,
text: 'Following',
emoji: true,
}
},
{
value : 'avatar',
text : {
text: "Avatar",
type: TextObjectType.PLAINTEXT
}
},
{
value : 'username',
text : {
text : "Github ID",
type : TextObjectType.PLAINTEXT
{
value: 'followers',
text: {
type: TextObjectType.PLAINTEXT,
text: 'Followers',
emoji: true,
}
},
{
value: 'following',
text: {
type: TextObjectType.PLAINTEXT,
text: 'Following',
emoji: true,
}
},
{
value: 'avatar',
text: {
text: "Avatar",
type: TextObjectType.PLAINTEXT
}
},
{
value: 'username',
text: {
text: "Github ID",
type: TextObjectType.PLAINTEXT
}
},
{
value: 'email',
text: {
type: TextObjectType.PLAINTEXT,
text: 'Email',
emoji: true,
}
},
{
value: 'bio',
text: {
type: TextObjectType.PLAINTEXT,
text: 'bio'
}
}
},
{
value: 'email',
text: {
type: TextObjectType.PLAINTEXT,
text: 'Email',
emoji: true,
}
},
{
value : 'bio',
text : {
type: TextObjectType.PLAINTEXT,
text: 'bio'
}
},
{
value : 'contributionGraph',
text : {
text: 'Contribution',
type : TextObjectType.PLAINTEXT
}
}
],
placeholder: {
type: TextObjectType.PLAINTEXT,
text: 'Select Property to Share',
},
}),
block.newButtonElement({
actionId : ModalsEnum.SHARE_PROFILE_EXEC,
text : {
text : "Share to Chat",
type : TextObjectType.PLAINTEXT
},
value : "shareChat"
}),
block.newButtonElement({
actionId: ModalsEnum.SHARE_PROFILE_EXEC,
text: {
text: "Share to Chat",
type: TextObjectType.PLAINTEXT
},
value: "shareChat"

})
})
]
})

return {
return {
id: viewId,
title: {
type: TextObjectType.PLAINTEXT,
Expand Down
Loading