Skip to content

Commit

Permalink
Merge branch 'main' into jeffdaley/empty-state-add-button
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdaley committed Oct 27, 2023
2 parents 12ca497 + 3423f31 commit 2f40c42
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
8 changes: 3 additions & 5 deletions web/app/components/project/tile.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
{{/if}}
{{#if this.jiraObject}}
<div class="flex items-center gap-1.5">
{{#if @project.jiraObject.type}}
<span data-test-jira-type>
{{@project.jiraObject.type}}
</span>
{{/if}}
<span data-test-jira-type>
{{@project.jiraObject.type}}
</span>
<span
data-test-jira-key
class="text-body-100 text-color-foreground-faint
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/project/tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ProjectTileComponentSignature {

export default class ProjectTileComponent extends Component<ProjectTileComponentSignature> {
protected get documents() {
return this.args.project.documents;
return this.args.project.hermesDocuments;
}

protected get jiraObject() {
Expand Down
24 changes: 13 additions & 11 deletions web/app/types/project.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ import {
} from "hermes/components/related-resources";
import { ProjectStatus } from "./project-status";

export interface JiraObject {
key: string;
url: string;
priority: string;
status: string;
assignee?: string;
type: string;
summary: string;
}

export interface HermesProject {
id: string; // at least in Mirage...
title: string;
status: ProjectStatus;
documents?: RelatedHermesDocument[];
hermesDocuments?: RelatedHermesDocument[];
description?: string;
jiraObject?: {
key: string;
url: string;
priority: string;
status: string;
assignee?: string;
type?: string;
summary: string;
};
relatedLinks?: RelatedExternalLink[];
jiraObject?: JiraObject;
externalLinks?: RelatedExternalLink[];
creator: string; // maybe a Google/HermesUser
dateCreated: number;
dateModified: number;
Expand Down
8 changes: 3 additions & 5 deletions web/tests/acceptance/authenticated/projects-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ module("Acceptance | authenticated/projects", function (hooks) {

if (project.jiraObject) {
expectedKeys.push(project.jiraObject.key);
if (project.jiraObject.type) {
expectedJiraTypes.push(project.jiraObject.type);
}
expectedJiraTypes.push(project.jiraObject.type);
}
if (project.documents) {
project.documents.forEach((doc) => {
if (project.hermesDocuments) {
project.hermesDocuments.forEach((doc) => {
if (doc.product) {
expectedProducts.push(doc.product);
}
Expand Down
8 changes: 4 additions & 4 deletions web/tests/integration/components/project/tile-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module("Integration | Component | project/tile", function (hooks) {
this.project = this.server.create("project", {
title: "Test Title",
description: "Test Description",
documents: [
hermesDocuments: [
{
product: "Foo",
},
Expand All @@ -46,8 +46,8 @@ module("Integration | Component | project/tile", function (hooks) {
<Project::Tile @project={{this.project}} />
`);

const { title, description, documents, jiraObject } = this.project;
const documentProducts = documents
const { title, description, hermesDocuments, jiraObject } = this.project;
const documentProducts = hermesDocuments
?.map((doc) => doc.product as string)
.uniq();

Expand Down Expand Up @@ -77,7 +77,7 @@ module("Integration | Component | project/tile", function (hooks) {

project.update({
description: null,
documents: null,
hermesDocuments: null,
jiraObject: null,
});

Expand Down

0 comments on commit 2f40c42

Please sign in to comment.