is-seeks refactoring: updated owner-title-bar.
@@ -12,6 +12,10 @@ import {
selectOpenPostUri,
} from '../selectors';
import { actionCreators } from '../actions/actions';
+import {
+ seeksOrIs,
+ inferLegacyNeedType,
+} from '../won-utils';
const serviceDependencies = ['$ngRedux', '$scope'];
function genComponentConf() {
@@ -27,7 +31,7 @@ function genComponentConf() {
<won-square-image
ng-class="{'inactive' : !self.isActive}"
src="self.post.get('titleImgSrc')"
- title="self.post.getIn(['won:hasContent','dc:title'])"
+ title="self.postContent.get('dc:title')"
uri="self.post.get('@id')">
</won-square-image>
</div>
@@ -38,8 +42,8 @@ function genComponentConf() {
<div class ="ntb__inner__right__upper">
<hgroup>
- <h1 class="ntb__title">{{ self.post.getIn(['won:hasContent','dc:title']) }}</h1>
- <div class="ntb__titles__type">{{self.labels.type[self.post.getIn(['won:hasBasicNeedType','@id'])]}}</div>
+ <h1 class="ntb__title">{{ self.postContent.get('dc:title') }}</h1>
+ <div class="ntb__titles__type">{{self.labels.type[self.postType]}}</div>
</hgroup>
<img
class="ntb__icon clickable"
@@ -139,6 +143,8 @@ function genComponentConf() {
WON: won.WON,
postUri: postUri,
post: post,
+ postContent: post && seeksOrIs(post) ,
+ postType: post && inferLegacyNeedType(post),
hasIncomingRequests: state.getIn(['connections'])
.filter(conn =>
conn.get('hasConnectionState') === won.WON.RequestReceived
