This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: readded app card components to lessen line changes in pr
- Loading branch information
Sabrina Ko
committed
Oct 29, 2021
1 parent
7c652c0
commit e0a59a0
Showing
10 changed files
with
503 additions
and
1 deletion.
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,39 @@ | ||
{{! | ||
## Usage | ||
<AppCard class="my-custom-class"> | ||
<:meta-primary> | ||
v5 | ||
</:meta-primary> | ||
<:meta-secondary> | ||
Starting… | ||
</:meta-secondary> | ||
<:actions> | ||
<a href="...">Visit</a> | ||
</:actions> | ||
</AppCard> | ||
}} | ||
|
||
<div | ||
data-test-app-card | ||
class="app-card" | ||
...attributes | ||
> | ||
|
||
<div class="app-card__meta"> | ||
|
||
<div class="app-card__meta__primary"> | ||
{{yield to="meta-primary"}} | ||
</div> | ||
|
||
<div class="app-card__meta__secondary"> | ||
{{yield to="meta-secondary"}} | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="app-card__actions"> | ||
{{yield to="actions"}} | ||
</div> | ||
|
||
</div> |
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,34 @@ | ||
<AppCard | ||
data-test-app-card-build={{@model.sequence}} | ||
> | ||
<:meta-primary> | ||
<LinkTo | ||
@route="workspace.projects.project.app.build" | ||
@models={{array @model.sequence}} | ||
class="app-card__sequence-link" | ||
> | ||
<b class="badge badge--version">v{{@model.sequence}}</b> | ||
</LinkTo> | ||
<OperationStatusIndicator @status={{or @model.pushedArtifact.status @model.status}} /> | ||
<GitCommit @commit={{@model.preload.jobDataSourceRef.git.commit}}/> | ||
</:meta-primary> | ||
|
||
<:meta-secondary> | ||
{{#let (or @model.pushedArtifact @model) as |operation|}} | ||
<Pds::Icon | ||
@type={{icon-for-component operation.component.name}} | ||
class="icon app-card__component-icon" | ||
/> | ||
<span> | ||
{{t | ||
(concat | ||
"build_status" | ||
".type-" operation.component.type | ||
".state-" operation.status.state | ||
) | ||
}} | ||
<b>{{component-name operation.component.name}}</b> | ||
</span> | ||
{{/let}} | ||
</:meta-secondary> | ||
</AppCard> |
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,20 @@ | ||
<Card @classNames={{unless @builds.length 'empty-state'}}> | ||
{{#if @builds.length}} | ||
<Card::Header> | ||
<h4> | ||
<Pds::Icon @type="build" class="icon" /> | ||
<span>Latest build</span> | ||
</h4> | ||
<LinkTo @route="workspace.projects.project.app.builds"> | ||
View all builds | ||
</LinkTo> | ||
</Card::Header> | ||
|
||
<AppCard::Build @model={{@builds.[0]}} /> | ||
{{else}} | ||
<p> | ||
<Pds::Icon @type="build" class="icon" /> | ||
<span>There are no builds to display yet</span> | ||
</p> | ||
{{/if}} | ||
</Card> |
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,35 @@ | ||
<AppCard | ||
data-test-app-card-deployment={{@model.sequence}} | ||
> | ||
<:meta-primary> | ||
<LinkTo | ||
@route="workspace.projects.project.app.deployment" | ||
@models={{array @model.sequence}} | ||
class="app-card__sequence-link" | ||
> | ||
<b class="badge badge--version">v{{@model.sequence}}</b> | ||
</LinkTo> | ||
<OperationStatusIndicator @status={{@model.status}} /> | ||
<GitCommit @commit={{@model.preload.jobDataSourceRef.git.commit}}/> | ||
</:meta-primary> | ||
|
||
<:meta-secondary> | ||
<Pds::Icon | ||
@type={{icon-for-component @model.component.name}} | ||
class="icon app-card__component-icon" | ||
/> | ||
<StatusReportIndicator @statusReport={{@model.statusReport}} /> | ||
</:meta-secondary> | ||
|
||
<:actions> | ||
{{#if @model.preload.deployUrl}} | ||
<ExternalLink | ||
href={{enforce-protocol @model.preload.deployUrl}} | ||
title="Visit {{enforce-protocol @model.preload.deployUrl}}" | ||
class="button button--secondary button--external-link app-card__launch-link" | ||
> | ||
<Pds::Icon @type="exit" class="icon" /> | ||
</ExternalLink> | ||
{{/if}} | ||
</:actions> | ||
</AppCard> |
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,23 @@ | ||
<Card | ||
data-test-latest-deployments | ||
class={{unless @deployments.length 'empty-state'}} | ||
> | ||
{{#if @deployments.length}} | ||
<Card::Header> | ||
<h4> | ||
<Pds::Icon @type="upload" class="icon" /> | ||
<span>Latest deployment</span> | ||
</h4> | ||
<LinkTo @route="workspace.projects.project.app.deployments"> | ||
View all deployments | ||
</LinkTo> | ||
</Card::Header> | ||
|
||
<AppCard::Deployment @model={{@deployments.[0] }} /> | ||
{{else}} | ||
<p> | ||
<Pds::Icon @type="upload" class="icon" /> | ||
<span>There are no deployments to display yet</span> | ||
</p> | ||
{{/if}} | ||
</Card> |
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,35 @@ | ||
<AppCard | ||
data-test-app-card-release={{@model.sequence}} | ||
> | ||
<:meta-primary> | ||
<LinkTo | ||
@route="workspace.projects.project.app.release" | ||
@models={{array @model.sequence}} | ||
class="app-card__sequence-link" | ||
> | ||
<b class="badge badge--version">v{{@model.sequence}}</b> | ||
</LinkTo> | ||
<OperationStatusIndicator @status={{@model.status}} /> | ||
<GitCommit @commit={{@model.preload.jobDataSourceRef.git.commit}}/> | ||
</:meta-primary> | ||
|
||
<:meta-secondary> | ||
<Pds::Icon | ||
@type={{icon-for-component @model.component.name}} | ||
class="icon app-card__component-icon" | ||
/> | ||
<StatusReportIndicator @statusReport={{@model.statusReport}} /> | ||
</:meta-secondary> | ||
|
||
<:actions> | ||
{{#if @model.url}} | ||
<ExternalLink | ||
href={{enforce-protocol @model.url}} | ||
title="Visit {{enforce-protocol @model.url}}" | ||
class="button button--primary app-card__launch-link" | ||
> | ||
<Pds::Icon @type="exit" class="icon" /> | ||
</ExternalLink> | ||
{{/if}} | ||
</:actions> | ||
</AppCard> |
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,23 @@ | ||
<Card | ||
data-test-latest-releases | ||
@classNames={{unless @releases.length 'empty-state'}} | ||
> | ||
{{#if @releases.length}} | ||
<Card::Header> | ||
<h4> | ||
<Pds::Icon @type="public-default" class="icon" /> | ||
<span>Latest release</span> | ||
</h4> | ||
<LinkTo @route="workspace.projects.project.app.releases"> | ||
View all releases | ||
</LinkTo> | ||
</Card::Header> | ||
|
||
<AppCard::Release @model={{@releases.[0] }} /> | ||
{{else}} | ||
<p> | ||
<Pds::Icon @type="public-default" class="icon" /> | ||
<span>There are no releases to display yet</span> | ||
</p> | ||
{{/if}} | ||
</Card> |
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.