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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed

- Fix `--assignee self` to correctly resolve to current user ([#104](https://github.com/schpet/linear-cli/pull/104); thanks @JustTrott)
- issue list --web/--app now respects --team flag and works without workspace configured

### Added

Expand Down
2 changes: 1 addition & 1 deletion src/commands/issue/issue-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const listCommand = new Command()
) => {
const usePager = pager !== false
if (web || app) {
await openTeamAssigneeView({ app: app })
await openTeamAssigneeView({ app: app, team })
return
}

Expand Down
26 changes: 19 additions & 7 deletions src/utils/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
import { getOption } from "../config.ts"
import { encodeBase64 } from "@std/encoding/base64"
import { getNoIssueFoundMessage, startVcsWork } from "./vcs.ts"
import { gql } from "../__codegen__/gql.ts"
import { getGraphQLClient } from "./graphql.ts"

export async function openIssuePage(
providedId?: string,
Expand Down Expand Up @@ -52,21 +54,31 @@ export async function openProjectPage(
await open(url, options.app ? { app: { name: "Linear" } } : undefined)
}

export async function openTeamAssigneeView(options: { app?: boolean } = {}) {
const teamId = getTeamKey()
export async function openTeamAssigneeView(
options: { app?: boolean; team?: string } = {},
) {
const teamId = options.team ?? getTeamKey()
if (!teamId) {
console.error(
"Could not determine team id from configuration or directory name.",
)
Deno.exit(1)
}

const workspace = getOption("workspace")
let workspace = getOption("workspace")
if (!workspace) {
console.error(
"workspace is not set via command line, configuration file, or environment.",
)
Deno.exit(1)
const client = getGraphQLClient()
const viewerQuery = gql(`
query GetViewerWorkspace {
viewer {
organization {
urlKey
}
}
}
`)
const result = await client.request(viewerQuery)
workspace = result.viewer.organization.urlKey
}

const filterObj = {
Expand Down