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

🚇 Release 1.0.1 #2

Merged
merged 23 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9c8127d
version bump
hassan-pullflow Oct 25, 2023
1034a76
updated desc and categories
hassan-pullflow Oct 25, 2023
e771c2f
updated statusBar error icon
hassan-pullflow Oct 26, 2023
6d5332d
updated reconnect.ts
hassan-pullflow Oct 26, 2023
9b06da5
created command for welcome
hassan-pullflow Oct 30, 2023
4a095e2
created web view for welcome
hassan-pullflow Oct 30, 2023
f7ee45c
added css
hassan-pullflow Oct 30, 2023
20bc83f
added pullflow main icon
hassan-pullflow Oct 30, 2023
09d2112
created welcomeView in commands
hassan-pullflow Oct 30, 2023
9bd6af6
opening welcome page on first installation
hassan-pullflow Oct 30, 2023
9f5c1ad
minor changes
hassan-pullflow Oct 30, 2023
132ccf4
Merge pull request #4 from pullflow/fix/update-marketplace-content
hassan-pullflow Oct 31, 2023
cbc763c
updated sequence of icons
hassan-pullflow Oct 31, 2023
53c0d0e
Merge pull request #5 from pullflow/feature/welcome-page
hassan-pullflow Oct 31, 2023
5d4d755
Merge pull request #3 from pullflow/fix/offline-icon
hassan-pullflow Oct 31, 2023
e393ee9
added workflow for publishing to market place
hr-hassan-raza Nov 1, 2023
63b5787
Merge pull request #6 from pullflow/fix/publish-automation
hassan-pullflow Nov 1, 2023
1ee00ce
moved styles to root
hr-hassan-raza Nov 1, 2023
938a51a
Merge pull request #7 from pullflow/fix/css-path
hassan-pullflow Nov 1, 2023
a9c75a9
minor html and css changes
Nov 6, 2023
3dc1de6
ref: changed login command to sign in
Nov 6, 2023
f2a4e8b
renamed logout to sign out
Nov 6, 2023
9f6ff8f
Merge pull request #8 from pullflow/ref/change-login-to-signin
hassan-pullflow Nov 7, 2023
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
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to VS Code Marketplace
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Setup Node version
uses: actions/setup-node@v1
with:
node-version: 16

- uses: actions/checkout@v2

- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_SESSIONS_SECRET_KEY: ${{ secrets.SESSION_SECRET_KEY }}
envkey_CLIENT_IDENTIFIER: com.pullflow.vscode
envkey_PULLFLOW_APP_URL: https://app.pullflow.com

- name: Build, compile and test
run: |
yarn
yarn compile
yarn lint
yarn test

- name: publish
run: |
yarn global add vsce
vsce publish -p ${{ secrets.VSCE_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "1.0.0",
"version": "1.0.1",
"configurations": [
{
"name": "Run Extension",
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
"dbaeumer",
"nosources",
"Pullflow",
"quickpicks",
"Relogin",
"thumbsup",
"uuidv",
"vscodeignore",
"Webviews",
"Xids"
],
"editor.tabSize": 2,
Expand Down
Binary file added assets/pullflow-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "pullflow",
"publisher": "Pullflow",
"displayName": "Pullflow",
"description": "Enhance your code review process by consolidating interactions within VS Code and directly integrating with platforms like Slack and GitHub.",
"version": "1.0.0",
"description": "Code review collaboration across GitHub, Slack, and VS Code.",
"version": "1.0.1",
"preview": true,
"license": "MIT",
"engines": {
Expand All @@ -14,11 +14,14 @@
},
"icon": "assets/pullflow.png",
"categories": [
"SCM Providers",
"Programming Languages",
"Machine Learning",
"Education",
"Snippets",
"Other"
],
"galleryBanner": {
"color": "#795DBD",
"color": "#F6F4F9",
"theme": "light"
},
"private": true,
Expand All @@ -42,11 +45,11 @@
},
{
"command": "pullflow.login",
"title": "Pullflow: login"
"title": "Pullflow: Login"
},
{
"command": "pullflow.logout",
"title": "Pullflow: logout"
"title": "Pullflow: Logout"
},
{
"command": "pullflow.reconnect",
Expand All @@ -59,6 +62,10 @@
{
"command": "pullflow.toggle-flow-state",
"title": "Pullflow: Toggle Flow state"
},
{
"command": "pullflow.welcome-view",
"title": "Pullflow: Welcome"
}
],
"keybindings": [
Expand Down
3 changes: 3 additions & 0 deletions src/commands/reconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@ export const Reconnect = async (
userAuthoredCodeReviews: codeReviews.data.authored,
})
StatusBar.update({ context, statusBar, state: StatusBarState.SignedIn })

commands.executeCommand(Command.activePullRequests)

return
}
6 changes: 6 additions & 0 deletions src/commands/welcomeView.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ExtensionContext } from 'vscode'
import { Welcome } from '../views/webviews/welcome/welcome'

export const WelcomeView = (context: ExtensionContext) => {
Welcome.show(context)
}
23 changes: 15 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import { Logout } from './commands/logout'
import { ActivePullRequests } from './commands/activePullRequests'
import { Authorization } from './utils/authorization'
import { ToggleFlowState } from './commands/toggleFlowState'
import { Welcome } from './views/webviews/welcome/welcome'

const module = 'extension.ts'

export async function activate(context: ExtensionContext) {
log.info('activating extension', module)

await checkSessionAndLogin(context)
checkFirstActivation(context)

const statusBar: StatusBarItem = await StatusBar.activate(context)
const { pollIntervalId, focusStateEvent, presenceInterval } =
await initialize({
Expand Down Expand Up @@ -70,17 +72,22 @@ export async function activate(context: ExtensionContext) {
ToggleFlowState(context, statusBar)
)
)
context.subscriptions.push(
commands.registerCommand(Command.welcomeView, () => {
Welcome.show(context)
})
)
}

// this method is called when your extension is deactivated
export function deactivate() {}

const checkSessionAndLogin = async (context: ExtensionContext) => {
const session = await Authorization.currentSession(context)
if (!session) {
window.showInformationMessage(
`Pullflow: Please login to continue using extension`
)
commands.executeCommand(Command.login)
const checkFirstActivation = (context: ExtensionContext) => {
const isFirstActivation = !Store.get(context)?.extensionId

if (isFirstActivation) {
commands.executeCommand(Command.welcomeView)
const extensionId = `${context.extension.packageJSON.publisher}.${context.extension.packageJSON.name}`
Store.set(context, { extensionId })
}
}
1 change: 1 addition & 0 deletions src/utils/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export const Command = {
logout: 'pullflow.logout',
reconnect: 'pullflow.reconnect',
toggleFlowState: 'pullflow.toggle-flow-state',
welcomeView: 'pullflow.welcome-view',
}
3 changes: 0 additions & 3 deletions src/utils/pullRequestsState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export const PullRequestState = {
if (errorCount.count >= MAX_ERROR_COUNT) {
StatusBar.update({ context, statusBar, state: StatusBarState.Error })
}
window.showErrorMessage(
`Pullflow: Couldn't fetch pull requests. ${codeReviews.error.message}`
)
return
}
await Store.set(context, {
Expand Down
1 change: 1 addition & 0 deletions src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type RepoChannelConnection = {
}

export type CacheObject = {
extensionId?: string
pendingUserCodeReviews?: [UserCodeReview]
userAuthoredCodeReviews?: [UserCodeReview]
user?: User
Expand Down
29 changes: 21 additions & 8 deletions src/views/statusBar/statusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ export const StatusBar = {
log.info('updating status bar', module)

if (state === StatusBarState.SignedIn) {
statusBarProperties.signedIn.text = getStatusBarText(context)
statusBarProperties.signedIn.text = getStatusBarText({ context })
statusBar = Object.assign(statusBar, statusBarProperties.signedIn)
} else if (state === StatusBarState.Loading) {
statusBar = Object.assign(statusBar, statusBarProperties.loading)
} else if (state === StatusBarState.Error) {
statusBarProperties.error.text = getStatusBarText({
context,
showErrorIcon: true,
})
statusBar = Object.assign(statusBar, statusBarProperties.error)
} else {
statusBar = Object.assign(statusBar, statusBarProperties.signedOut)
Expand All @@ -82,7 +86,13 @@ export const StatusBar = {
}

/** computes status bar text */
function getStatusBarText(context: ExtensionContext): string {
function getStatusBarText({
context,
showErrorIcon = false,
}: {
context: ExtensionContext
showErrorIcon?: boolean
}): string {
if (STATUS_BAR_ICON_PREVIEW) {
const allIcons = IconReference.map((k) => `$(${k})`).join('')
return '$(pullflow-icon)' + allIcons
Expand All @@ -93,12 +103,15 @@ function getStatusBarText(context: ExtensionContext): string {
previousPresenceStatus,
} = Store.get(context)

if (!pendingUserCodeReviews && !userAuthoredCodeReviews) return ''
const presenceIcon =
previousPresenceStatus === PresenceStatus.Flow ? '$(symbol-event)' : ''
const errorIcon = showErrorIcon ? ' $(warning) ' : ''

if (!pendingUserCodeReviews && !userAuthoredCodeReviews)
return `${errorIcon} ${presenceIcon} $(pullflow-icon)`

const pendingCodeReviewsCount = pendingUserCodeReviews?.length || 0
const authoredCodeReviewsCount = userAuthoredCodeReviews?.length || 0
const presenceIcon =
previousPresenceStatus === PresenceStatus.Flow ? '$(symbol-event)' : ''
if (
pendingCodeReviewsCount < MAX_PR_COUNT &&
authoredCodeReviewsCount < MAX_PR_COUNT
Expand All @@ -111,10 +124,10 @@ function getStatusBarText(context: ExtensionContext): string {
userAuthoredCodeReviews?.map(
(codeReview) => `$(${PullRequestIcons.getIcon(codeReview.botReaction)})`
) || []
return `${presenceIcon} ${pendingCodeReviewIcons.join(
return `${errorIcon} ${presenceIcon} ${pendingCodeReviewIcons.join(
''
)} $(pullflow-icon)\t${authoredCodeReviewIcons.join('')}`
)} $(pullflow-icon) ${authoredCodeReviewIcons.join('')}`
} else {
return `${presenceIcon} ${pendingCodeReviewsCount} $(pullflow-icon) ${authoredCodeReviewsCount}`
return `${errorIcon} ${presenceIcon} ${pendingCodeReviewsCount} $(pullflow-icon) ${authoredCodeReviewsCount}`
}
}
Loading
Loading