feat: Add Linear Project and Team icons
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add Linear Project and Team icons
|
||||||
|
|
||||||
## [0.1.3] - 2024-02-05
|
## [0.1.3] - 2024-02-05
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "universal-inbox",
|
"name": "universal-inbox",
|
||||||
"version": "0.1.0",
|
"version": "0.1.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "universal-inbox",
|
"name": "universal-inbox",
|
||||||
"version": "0.1.0",
|
"version": "0.1.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@raycast/api": "^1.65.1",
|
"@raycast/api": "^1.65.1",
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export function getLinearUserAccessory(user?: LinearUser): List.Item.Accessory {
|
|||||||
|
|
||||||
export function getLinearNotificationReasonAccessory(notification_type: string): List.Item.Accessory {
|
export function getLinearNotificationReasonAccessory(notification_type: string): List.Item.Accessory {
|
||||||
const reason = match(notification_type)
|
const reason = match(notification_type)
|
||||||
.with("")
|
|
||||||
.with("issueAddedToTriage", () => "Added To Triage")
|
.with("issueAddedToTriage", () => "Added To Triage")
|
||||||
.with("issueAddedToView", () => "Added To View")
|
.with("issueAddedToView", () => "Added To View")
|
||||||
.with("issueAssignedToYou", () => "Assigned To You")
|
.with("issueAssignedToYou", () => "Assigned To You")
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { LinearIssuePreview } from "../preview/LinearIssuePreview";
|
|||||||
import { Notification } from "../../../notification";
|
import { Notification } from "../../../notification";
|
||||||
import { MutatePromise } from "@raycast/utils";
|
import { MutatePromise } from "@raycast/utils";
|
||||||
import { Page } from "../../../types";
|
import { Page } from "../../../types";
|
||||||
|
import { match, P } from "ts-pattern";
|
||||||
import { List } from "@raycast/api";
|
import { List } from "@raycast/api";
|
||||||
import { match } from "ts-pattern";
|
|
||||||
|
|
||||||
interface LinearIssueNotificationListItemProps {
|
interface LinearIssueNotificationListItemProps {
|
||||||
notification: Notification;
|
notification: Notification;
|
||||||
@@ -19,10 +19,18 @@ export function LinearIssueNotificationListItem({
|
|||||||
linearIssueNotification,
|
linearIssueNotification,
|
||||||
mutate,
|
mutate,
|
||||||
}: LinearIssueNotificationListItemProps) {
|
}: LinearIssueNotificationListItemProps) {
|
||||||
const projectSubtitle = linearIssueNotification.issue.project
|
const projectSubtitle = match(linearIssueNotification.issue.project)
|
||||||
? `/ ${linearIssueNotification.issue.project.name} `
|
.with({ name: P.select(), icon: P.nullish }, (project_name) => `/ ${project_name}`)
|
||||||
: "";
|
.with(
|
||||||
const subtitle = `${linearIssueNotification.issue.team.name} ${projectSubtitle}#${linearIssueNotification.issue.identifier}`;
|
{ name: P.select("project_name"), icon: P.select("icon") },
|
||||||
|
({ project_name, icon }) => `/ ${icon} ${project_name}`,
|
||||||
|
)
|
||||||
|
.otherwise(() => "");
|
||||||
|
const teamSubtitle = match(linearIssueNotification.issue.team)
|
||||||
|
.with({ name: P.select(), icon: P.nullish }, (team_name) => `${team_name}`)
|
||||||
|
.with({ name: P.select("team_name"), icon: P.select("icon") }, ({ team_name, icon }) => `${icon} ${team_name}`)
|
||||||
|
.otherwise(() => "");
|
||||||
|
const subtitle = `${teamSubtitle} ${projectSubtitle} #${linearIssueNotification.issue.identifier}`;
|
||||||
|
|
||||||
const state = getLinearIssueStateAccessory(linearIssueNotification.issue.state);
|
const state = getLinearIssueStateAccessory(linearIssueNotification.issue.state);
|
||||||
const assignee = getLinearUserAccessory(linearIssueNotification.issue.assignee);
|
const assignee = getLinearUserAccessory(linearIssueNotification.issue.assignee);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Notification } from "../../../notification";
|
|||||||
import { MutatePromise } from "@raycast/utils";
|
import { MutatePromise } from "@raycast/utils";
|
||||||
import { List, Color } from "@raycast/api";
|
import { List, Color } from "@raycast/api";
|
||||||
import { Page } from "../../../types";
|
import { Page } from "../../../types";
|
||||||
import { match } from "ts-pattern";
|
import { match, P } from "ts-pattern";
|
||||||
|
|
||||||
interface LinearProjectNotificationListItemProps {
|
interface LinearProjectNotificationListItemProps {
|
||||||
notification: Notification;
|
notification: Notification;
|
||||||
@@ -19,7 +19,13 @@ export function LinearProjectNotificationListItem({
|
|||||||
linearProjectNotification,
|
linearProjectNotification,
|
||||||
mutate,
|
mutate,
|
||||||
}: LinearProjectNotificationListItemProps) {
|
}: LinearProjectNotificationListItemProps) {
|
||||||
const subtitle = linearProjectNotification.project.name;
|
const subtitle = match(linearProjectNotification.project)
|
||||||
|
.with({ name: P.select(), icon: P.nullish }, (project_name) => `${project_name}`)
|
||||||
|
.with(
|
||||||
|
{ name: P.select("project_name"), icon: P.select("icon") },
|
||||||
|
({ project_name, icon }) => `${icon} ${project_name}`,
|
||||||
|
)
|
||||||
|
.otherwise(() => "");
|
||||||
|
|
||||||
const state = getLinearProjectStateAccessory(linearProjectNotification.project);
|
const state = getLinearProjectStateAccessory(linearProjectNotification.project);
|
||||||
const lead = getLinearUserAccessory(linearProjectNotification.project.lead);
|
const lead = getLinearUserAccessory(linearProjectNotification.project.lead);
|
||||||
|
|||||||
Reference in New Issue
Block a user