Skip to content

Commit

Permalink
Use "oo-molecules-project-users" element
Browse files Browse the repository at this point in the history
  • Loading branch information
aggre committed Mar 28, 2018
1 parent 0a82c7f commit e1f2e35
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/elements/_molecules/oo-molecules-project-users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export default class extends OOElement {

return html`
<style>
:host {
display: block;
}
div {
display: flex;
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/oo-project-summary/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe(`<${ELEMENT}></${ELEMENT}>`, () => {
const [slotFooterAssigned] = slotFooter.assignedNodes()

Array.prototype.forEach.call(slotFooterAssigned.childNodes, item => {
const userName = item.parentElement.querySelector('oo-atoms-user-name').getAttribute('data-iam')
const userName = item.parentElement.querySelector('oo-molecules-project-users').getAttribute('data-assignee')
expect(userName).to.be('test')
})
})
Expand Down
11 changes: 7 additions & 4 deletions src/elements/oo-project-summary/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import define from '../../lib/define'
import markdown from '../oo-markdown'
import projectEditor from '../oo-project-editor'
import message from '../_atoms/oo-atoms-message'
import userName from '../_atoms/oo-atoms-user-name'
import users from '../_molecules/oo-molecules-project-users'
import datetime from '../_atoms/oo-atoms-datetime'
import modal from '../oo-modal'
import projectStatus from '../oo-project-status'
Expand All @@ -16,7 +16,7 @@ import {template as tagsTemplate} from '../../lib/tags'

define('oo-markdown', markdown)
define('oo-atoms-message', message)
define('oo-atoms-user-name', userName)
define('oo-molecules-project-users', users)
define('oo-atoms-datetime', datetime)
define('oo-project-status', projectStatus)
define('oo-project-editor', projectEditor)
Expand All @@ -31,6 +31,7 @@ const projectTitle = weakMap<string>()
const projectBody = weakMap<string>()
const projectTags = weakMap<Array<string>>()
const projectAuthor = weakMap<string>()
const projectAssignee = weakMap<string>()
const projectCreated = weakMap<number>()
const stateProjectUpdated = weakMap<boolean>()
const stateOpenEditor = weakMap<boolean>()
Expand Down Expand Up @@ -59,6 +60,7 @@ export default class extends OOElement {
const body = projectBody.get(this)
const tags = projectTags.get(this)
const author = projectAuthor.get(this)
const assignee = projectAssignee.get(this)
const editor = stateOpenEditor.get(this)
const projectUpdated = stateProjectUpdated.get(this)
const isPostOwner = store.uid === author
Expand Down Expand Up @@ -110,7 +112,7 @@ export default class extends OOElement {
oo-project-status {
margin-bottom: 0.5rem;
}
oo-atoms-user-name {
oo-molecules-project-users {
margin-bottom: 1rem;
}
oo-project-editor {
Expand Down Expand Up @@ -168,7 +170,7 @@ export default class extends OOElement {
${tagsTemplate(tags)}
</section>
<footer slot=footer>
<oo-atoms-user-name data-iam$='${author}' data-size=small></oo-atoms-user-name>
<oo-molecules-project-users data-author$='${author}' data-assignee$='${assignee}'></oo-molecules-project-users>
<oo-atoms-datetime data-unixtime$='${created}'></oo-atoms-datetime>
</footer>
</oo-atoms-message>
Expand Down Expand Up @@ -239,6 +241,7 @@ export default class extends OOElement {
projectBody.set(this, mapedExtensions.get('body'))
projectTags.set(this, mapedExtensions.get('tags') || [])
projectAuthor.set(this, mapedExtensions.get('author'))
projectAssignee.set(this, mapedExtensions.get('assignee'))
stateProjectUpdated.delete(this)
} else {
projectBody.delete(this)
Expand Down
7 changes: 4 additions & 3 deletions src/elements/oo-projects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import weakMap from '../../lib/weak-map'
import markdown from '../oo-markdown'
import message from '../_atoms/oo-atoms-message'
import button from '../_atoms/oo-atoms-button'
import userName from '../_atoms/oo-atoms-user-name'
import users from '../_molecules/oo-molecules-project-users'
import empty from '../oo-empty'
import toMap from '../../lib/extensions-to-map'
import {template as tagsTemplate} from '../../lib/tags'
Expand All @@ -19,7 +19,7 @@ import {href} from '../../lib/href'
define('oo-markdown', markdown)
define('oo-atoms-message', message)
define('oo-atoms-button', button)
define('oo-atoms-user-name', userName)
define('oo-molecules-project-users', users)
define('oo-empty', empty)
define('oo-project-status', projectStatus)

Expand Down Expand Up @@ -153,6 +153,7 @@ export default class extends OOElement {
const title = exts.has('title') ? exts.get('title') : ''
const body = exts.has('body') ? exts.get('body') : ''
const offerer = exts.has('author') ? exts.get('author') : ''
const assignee = exts.has('assignee') ? exts.get('assignee') : ''
const tags = exts.has('tags') ? exts.get('tags') : []
const titleHTML = title ? html`<h1>${title}</h1>` : html``
return html`
Expand All @@ -169,7 +170,7 @@ export default class extends OOElement {
</aside>
</section>
<footer slot=footer>
<oo-atoms-user-name data-iam$='${offerer}' data-size=small></oo-atoms-user-name>
<oo-molecules-project-users data-author$='${offerer}' data-assignee$='${assignee}'></oo-molecules-project-users>
</footer>
</oo-atoms-message>
`
Expand Down

0 comments on commit e1f2e35

Please sign in to comment.