Skip to content

Commit

Permalink
INTG-3306 - Added issue assignees feed (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-gv authored Mar 26, 2024
1 parent 89350e5 commit 4c1d42d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 17 additions & 1 deletion SafetyCulture.pq
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ ActionAssigneeType = type table [
id = text, action_id = text, assignee_id = text, name = nullable text, organisation_id = text, type = text
];

IssueAssigneesType = type table [
id = text,
issue_id = text,
assignee_id = text,
name = nullable text,
organisation_id = text,
modified_at = datetimezone,
type = text
];

ActionTimelineItemType = type table [
id = text,
task_id = text,
Expand Down Expand Up @@ -435,7 +445,8 @@ SchemaTable = #table(
{"issues", IssueType, "Issues"},
{"issue_timeline_items", IssueTimelineItemType, "Issues"},
{"assets", AssetType, "Assets"},
{"training-course-progress", CourseProgressType, "Training"}
{"training-course-progress", CourseProgressType, "Training"},
{"issue_assignees", IssueAssigneesType, "Issues"}
}
);

Expand Down Expand Up @@ -705,6 +716,9 @@ GetActionTimelineItems = () as table => let query = [], table = GetEntity(
GetIssueTimelineItems = () as table => let query = [], table = GetEntity(
Uri.Combine(BaseUrl, "/feed/"), "issue_timeline_items") in table;

GetIssueAssigneesItems = () as table => let query = [], table = GetEntity(
Uri.Combine(BaseUrl, "/feed/"), "issue_assignees") in table;

GetScheduleOccurrences = (
optional templateIds as text, optional startDate as datetimezone, optional endDate as datetimezone
) as table =>
Expand Down Expand Up @@ -857,6 +871,8 @@ GetActionTimelineItemsType = type function () as table;

GetIssueTimelineItemsType = type function () as table;

GetIssueAssigneesType = type function () as table;

// Read all pages of data.
// After every page, we check the "NextLink" record on the metadata of the previous request.
// Table.GenerateByPage will keep asking for more pages until we return null.
Expand Down
3 changes: 3 additions & 0 deletions SafetyCulture.query.pq
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ shared SafetyCulture.UnitTest = [
AssetsFolder = RootTable{[Name = "Assets"]}[Data],
Assets = AssetsFolder{[Name = "assets"]}[Data],
CourseProgresses = RootTable{[Name = "training-course-progress"]}[Data],
IssueAssignees = RootTable{[Name = "issue_assignees"]}[Data],
// Fact(<Name of the Test>, <Expected Value>, <Actual Value>)
// <Expected Value> and <Actual Value> can be a literal or let statement
facts = {
Expand Down Expand Up @@ -70,6 +71,8 @@ shared SafetyCulture.UnitTest = [
Fact("We have Asset data?", true, not Table.IsEmpty(Assets)),
Fact("Assets has 9 columns", 9, List.Count(Table.ColumnNames(Assets))),
Fact("Course Progresses has 15 columns", 15, List.Count(Table.ColumnNames(CourseProgresses)))
Fact("We have Issue Assignees data?", true, not Table.IsEmpty(IssueAssignees)),
Fact("Issue Assignees has 7 columns", 7, List.Count(Table.ColumnNames(IssueAssignees)))
},
report = Facts.Summarize(facts)
][report];
Expand Down

0 comments on commit 4c1d42d

Please sign in to comment.