-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix and expand RelatedHermesDocument type * Update list-item-test.ts * Revert out-of-scope changes * Add more attributes to RelatedHermesDocument * Add new attrs to Go API * Revert out-of-scope change * Start of Project Tile * Write tests, add factories * Cleanup
- Loading branch information
Showing
11 changed files
with
353 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<Hds::Card::Container | ||
data-test-project-tile | ||
@hasBorder={{true}} | ||
@levelHover="mid" | ||
class="project-tile h-48 p-4" | ||
...attributes | ||
> | ||
<div class="relative h-full pb-16"> | ||
<h3 | ||
data-test-title | ||
class="title text-display-300 font-semibold text-color-foreground-strong" | ||
> | ||
{{@project.title}} | ||
</h3> | ||
{{#if @project.description}} | ||
<p | ||
data-test-description | ||
class="description mt-1 text-body-300 text-color-foreground-faint" | ||
> | ||
{{@project.description}} | ||
</p> | ||
{{/if}} | ||
|
||
<div | ||
class="absolute bottom-0 left-0 flex w-full items-center justify-between" | ||
> | ||
{{#if this.productAreas}} | ||
<ul class="flex gap-px"> | ||
{{#each this.productAreas as |productArea|}} | ||
<li class="flex items-center" data-test-product> | ||
{{productArea}} | ||
</li> | ||
{{/each}} | ||
</ul> | ||
{{/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-key | ||
class="text-body-100 text-color-foreground-faint | ||
{{if (eq this.jiraObject.status 'Done') 'line-through'}}" | ||
> | ||
{{this.jiraObject.key}} | ||
</span> | ||
</div> | ||
{{/if}} | ||
</div> | ||
</div> | ||
</Hds::Card::Container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Component from "@glimmer/component"; | ||
import { HermesProject } from "hermes/types/project"; | ||
|
||
interface ProjectTileComponentSignature { | ||
Element: HTMLDivElement; | ||
Args: { | ||
project: HermesProject; | ||
}; | ||
} | ||
|
||
export default class ProjectTileComponent extends Component<ProjectTileComponentSignature> { | ||
protected get documents() { | ||
return this.args.project.documents; | ||
} | ||
|
||
protected get jiraObject() { | ||
return this.args.project.jiraObject; | ||
} | ||
|
||
protected get productAreas() { | ||
return this.documents?.map((doc) => doc.product).uniq(); | ||
} | ||
} | ||
|
||
declare module "@glint/environment-ember-loose/registry" { | ||
export default interface Registry { | ||
"Project::Tile": typeof ProjectTileComponent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.project-tile { | ||
.title, | ||
.description { | ||
@apply overflow-hidden; | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
} | ||
|
||
.title { | ||
-webkit-line-clamp: 2; | ||
line-clamp: 2; | ||
} | ||
|
||
.description { | ||
-webkit-line-clamp: 3; | ||
line-clamp: 3; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{{page-title "All Projects"}} | ||
|
||
<ol> | ||
<ol class="relative grid grid-cols-3 gap-2"> | ||
{{#each-in this.model as |_id project|}} | ||
<li data-test-project> | ||
{{project.title}} | ||
<LinkTo @route="authenticated.projects.project" @model={{project.id}}> | ||
<Project::Tile @project={{project}} /> | ||
</LinkTo> | ||
</li> | ||
{{/each-in}} | ||
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Factory } from "miragejs"; | ||
|
||
export default Factory.extend({ | ||
id: (i) => i, | ||
key: (i) => `KEY-00${i}`, | ||
url: "", | ||
priority: "Medium", | ||
status: "Open", | ||
assignee: "Unassigned", | ||
type: "Task", | ||
summary: "This is a Jira object", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
import { Factory } from "miragejs"; | ||
import { Factory, ModelInstance, Server } from "miragejs"; | ||
import { HermesProject } from "hermes/types/project"; | ||
|
||
export default Factory.extend({ | ||
id: (i: number) => i, | ||
title: (i: number) => `Test Project ${i}`, | ||
dateCreated: 1, | ||
dateModified: 1, | ||
creator: "[email protected]", | ||
|
||
// @ts-ignore - Bug https://github.com/miragejs/miragejs/issues/1052 | ||
afterCreate(project: ModelInstance<HermesProject>, server: any): void { | ||
server.createList("related-hermes-document", 1); | ||
server.create("jira-object"); | ||
|
||
const relatedHermesDocuments = server.schema.relatedHermesDocument | ||
.all() | ||
.models.map((doc: ModelInstance) => doc.attrs); | ||
|
||
const jiraObject = server.schema.jiraObjects.first()?.attrs; | ||
|
||
project.update({ | ||
documents: relatedHermesDocuments, | ||
jiraObject, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Model } from "miragejs"; | ||
|
||
export default Model.extend({ | ||
// Required for Mirage, even though it's empty | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.