Skip to content

Commit cf980fd

Browse files
authored
Linear - New ProjectUpdates (#15332)
* linear_app-new-projectupdate-created * linear-new-projectupdate-created * remove linear-new-projectupdate-created * pnpm-lock.yaml * revert linear package version * remove duplicate body field * update description
1 parent c7318a2 commit cf980fd

File tree

18 files changed

+176
-12
lines changed

18 files changed

+176
-12
lines changed

components/linear_app/actions/create-issue/create-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "linear_app-create-issue",
66
name: "Create Issue",
77
description: "Create an issue (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues)",
8-
version: "0.4.6",
8+
version: "0.4.7",
99
props: {
1010
linearApp,
1111
teamId: {

components/linear_app/actions/get-issue/get-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "linear_app-get-issue",
55
name: "Get Issue",
66
description: "Get an issue by ID (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api)",
7-
version: "0.1.6",
7+
version: "0.1.7",
88
type: "action",
99
props: {
1010
linearApp,

components/linear_app/actions/get-teams/get-teams.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "linear_app-get-teams",
55
name: "Get Teams",
66
description: "Get all the teams (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api)",
7-
version: "0.2.6",
7+
version: "0.2.7",
88
type: "action",
99
props: {
1010
linearApp,

components/linear_app/actions/search-issues/search-issues.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Search Issues",
77
description: "Search issues (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api)",
88
type: "action",
9-
version: "0.2.6",
9+
version: "0.2.7",
1010
props: {
1111
linearApp,
1212
query: {

components/linear_app/actions/update-issue/update-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Update Issue",
66
description: "Update an issue (API Key). See the docs [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues)",
77
type: "action",
8-
version: "0.1.6",
8+
version: "0.1.7",
99
props: {
1010
linearApp,
1111
teamId: {

components/linear_app/common/constants.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const RESOURCE_TYPE = {
1313
ISSUE: "Issue",
1414
ISSUE_LABEL: "IssueLabel",
1515
PROJECT: "Project",
16+
PROJECT_UPDATE: "ProjectUpdate",
1617
CYCLE: "Cycle",
1718
REACTION: "Reaction",
1819
};

components/linear_app/common/fragments.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,33 @@ export default {
136136
url
137137
}
138138
`,
139+
projectUpdate: `
140+
fragment ProjectUpdate on ProjectUpdate {
141+
id
142+
body
143+
health
144+
project {
145+
id
146+
name
147+
lead {
148+
id
149+
name
150+
}
151+
initiatives {
152+
nodes {
153+
name
154+
}
155+
}
156+
}
157+
user {
158+
id
159+
}
160+
createdAt
161+
updatedAt
162+
bodyData
163+
slugId
164+
infoSnapshot
165+
url
166+
}
167+
`,
139168
};

components/linear_app/common/queries.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,32 @@ export default {
7575
${fragments.project}
7676
${fragments.pageInfo}
7777
`,
78+
listProjectUpdates: `
79+
query ListProjectUpdates(
80+
$filter: ProjectUpdateFilter,
81+
$before: String,
82+
$after: String,
83+
$first: Int,
84+
$last: Int,
85+
$orderBy: PaginationOrderBy
86+
) {
87+
projectUpdates(
88+
filter: $filter,
89+
before: $before,
90+
after: $after,
91+
first: $first,
92+
last: $last,
93+
orderBy: $orderBy
94+
) {
95+
pageInfo {
96+
...PageInfo
97+
}
98+
nodes {
99+
...ProjectUpdate
100+
}
101+
}
102+
}
103+
${fragments.projectUpdate}
104+
${fragments.pageInfo}
105+
`,
78106
};

components/linear_app/common/utils.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ function buildVariables(endCursor, args) {
4242
const issueLabels = args.filter.issueLabels
4343
? `, labels: { name: { in: ${JSON.stringify(args.filter.issueLabels)} } }`
4444
: "";
45-
let filter = `${title}${teamId}${projectId}${team}${project}${state}${assigneeId}${issueLabels}`;
45+
const createdAt = args.filter.createdAt
46+
? `, createdAt: { gte: "${args.filter.createdAt.gte}" }`
47+
: "";
48+
let filter = `${title}${teamId}${projectId}${team}${project}${state}${assigneeId}${issueLabels}${createdAt}`;
4649
if (filter[0] === ",") {
4750
filter = filter.substring(2, filter.length);
4851
}

components/linear_app/linear_app.app.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ export default {
248248
async getProject(id) {
249249
return this.client().project(id);
250250
},
251+
async getProjectUpdate(id) {
252+
return this.client().projectUpdate(id);
253+
},
251254
async getState(id) {
252255
return this.client().workflowState(id);
253256
},
@@ -266,6 +269,15 @@ export default {
266269
});
267270
return projects;
268271
},
272+
async listProjectUpdates(variables) {
273+
const { data: { projectUpdates } } = await this.post({
274+
data: {
275+
query: queries.listProjectUpdates,
276+
variables,
277+
},
278+
});
279+
return projectUpdates;
280+
},
269281
async listUsers(variables = {}) {
270282
return this.client().users(variables);
271283
},

0 commit comments

Comments
 (0)