Skip to content

Commit d0d267a

Browse files
authored
Fix node-card date for older registrations (#1373)
- Ticket: [ENG-700] - Feature flag: n/a ## Purpose - Currently the node-card component (used on a project's registration page and the my-registrations page) is saying that a Registration was registered when the backing project was created. For older (not exactly sure how old), project-based registrations, this will not be true and will lead to user confusion. ## Summary of Changes - Change the date we are showing from the registration.dateCreated (date created of backing project), to registration.dateRegistered (when the registration was actually registered) - Update tests
1 parent a24c400 commit d0d267a

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

lib/osf-components/addon/components/node-card/template.hbs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,22 @@
123123
<dd data-test-registration-registry-name>
124124
{{@node.provider.name}}
125125
</dd><br />
126+
<dt data-test-created-timestamp-label>
127+
{{t (concat 'node_card.registration.timestamp_label')}}
128+
</dt>
129+
<dd data-test-created-timestamp-value>
130+
{{moment @node.dateRegistered}}
131+
</dd><br />
132+
{{else}}
133+
<dt data-test-created-timestamp-label>
134+
{{t (concat 'node_card.' @node.nodeType '.timestamp_label')}}
135+
</dt>
136+
<dd data-test-created-timestamp-value>
137+
{{moment @node.dateCreated}}
138+
</dd><br />
126139
{{/if}}
127-
<dt data-test-created-timestamp-label>
128-
{{t (concat 'node_card.' @node.nodeType '.timestamp_label')}}
129-
</dt>
130-
<dd data-test-created-timestamp-value>
131-
{{moment @node.dateCreated}}
132-
</dd><br />
133140
<dt data-test-updated-timestamp-label>
134-
{{t 'node_card.last_updated'}}
141+
{{t 'node_card.last_updated'}}
135142
</dt>
136143
<dd data-test-updated-timestamp-value>
137144
{{moment @node.dateModified}}

tests/integration/components/node-card/component-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module('Integration | Component | node-card', hooks => {
6868
);
6969
assert.dom('[data-test-created-timestamp-value]').exists('Created timestamp value exists');
7070
assert.dom('[data-test-created-timestamp-value]').hasText(
71-
`${moment(registration.dateCreated)}`,
71+
`${moment(registration.dateRegistered)}`,
7272
'Created timestamp value is correct',
7373
);
7474
assert.dom('[data-test-updated-timestamp-value]').exists('Updated timestamp value exists');

0 commit comments

Comments
 (0)