forked from CenterForOpenScience/ember-osf-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-5065] Add a new metadata details (view only) component (CenterFo…
…rOpenScience#2095) * Added the initial metadata-detail component * Added some more touches to the detail template * Removed unnecessary mobile styling and actually the component. * Much cleaner look and feel for the read-only view * Added more randomness
- Loading branch information
Showing
7 changed files
with
191 additions
and
11 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
app/guid-node/metadata/-components/metadata-detail/styles.scss
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,74 @@ | ||
// stylelint-disable max-nesting-depth, selector-max-compound-selectors | ||
|
||
.metadata-detail-container { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
|
||
a { | ||
text-decoration: none; | ||
color: $color-text-black; | ||
} | ||
|
||
.header-container { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: center; | ||
margin-bottom: 10px; | ||
|
||
.header { | ||
font-size: 18px; | ||
margin-right: 20px; | ||
} | ||
} | ||
|
||
.detail-container { | ||
width: calc(100% - 20px); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
margin-left: 20px; | ||
padding-bottom: 20px; | ||
margin-bottom: 20px; | ||
border-bottom: 1px solid $color-border-gray-darker; | ||
|
||
.key-container { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
|
||
.key { | ||
font-weight: bold; | ||
} | ||
|
||
.required { | ||
color: $brand-danger; | ||
} | ||
} | ||
} | ||
} | ||
|
||
:global(.cp-is-open .cedar-template-chevron-right) { | ||
display: none; | ||
} | ||
|
||
:global(.cp-is-open .cedar-template-chevron-down) { | ||
display: flex; | ||
margin-right: 10px; | ||
} | ||
|
||
|
||
:global(.cp-is-closed .cedar-template-chevron-right) { | ||
display: flex; | ||
margin-right: 10px; | ||
} | ||
|
||
:global(.cp-is-closed .cedar-template-chevron-down) { | ||
display: none; | ||
} |
51 changes: 51 additions & 0 deletions
51
app/guid-node/metadata/-components/metadata-detail/template.hbs
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,51 @@ | ||
<div local-class='metadata-detail-container'> | ||
<CpPanels | ||
@accordion={{true}} | ||
as |panels| | ||
> | ||
{{#each @cedarMetadataRecord.metadata.templates as |template| }} | ||
{{#panels.panel | ||
as |panel|}} | ||
{{#panel.toggle}} | ||
<div local-class='header-container'> | ||
<FaIcon class='cedar-template-chevron-right' @icon='chevron-right' /> | ||
<FaIcon class='cedar-template-chevron-down' @icon='chevron-down' /> | ||
<div local-class='header'> | ||
{{template.name}} | ||
</div> | ||
<FaIcon @icon='question-circle' /> | ||
<EmberPopover | ||
@side='bottom' | ||
@event='hover' | ||
@popperContainer='body' | ||
> | ||
<div local-class='popover-format'> | ||
<h3>{{t 'metadata.detail.popover.header'}}</h3> | ||
{{t 'metadata.detail.popover.content'}} | ||
</div> | ||
</EmberPopover> | ||
</div> | ||
{{/panel.toggle}} | ||
{{#panel.body}} | ||
{{#each template.data as |data| }} | ||
<div local-class='detail-container'> | ||
<div local-class='key-container'> | ||
<div local-class='key'> | ||
{{data.key}} | ||
</div> | ||
{{#if data.required}} | ||
<div local-class='required'> | ||
* | ||
</div> | ||
{{/if}} | ||
</div> | ||
<div> | ||
{{data.value}} | ||
</div> | ||
</div> | ||
{{/each}} | ||
{{/panel.body}} | ||
{{/panels.panel}} | ||
{{/each}} | ||
</CpPanels> | ||
</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
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
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