Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection contact information #4091

Merged
merged 5 commits into from
May 1, 2020
Merged

Collection contact information #4091

merged 5 commits into from
May 1, 2020

Conversation

cjcolvar
Copy link
Member

Resolves #3604

@cjcolvar cjcolvar changed the title Collection contact Collection contact information Apr 23, 2020
@@ -67,7 +67,7 @@ const CollectionDetails = ({ content = '', email = '', website = '' }) => {
{ website &&
<>
<dt style={descriptionStyle}>Website:</dt>
<dd><a href={website}>{website}</a></dd>
<dd dangerouslySetInnerHTML={{ __html: website }}></dd>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phuongdh @Dananji This is equivalent to innerHTML and while it is called dangerously because of the possibility of XSS I think it should be safe here since we're in control of the html. I thought it made more sense for the presenter to return a full a tag instead of the label and url separately. What do you two think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sounds good to me 👍

@cjcolvar
Copy link
Member Author

@Dananji I know we talked about keeping the UI consistent with having the field labels present even when there isn't a value but I went back on that when seeing it in the collection landing page. Was that a bad idea? Maybe we can ask @joncameron tomorrow.

@joncameron
Copy link
Contributor

When this gets merged and is on Spruce I'll take a look and we can tweak it. In this case I don't think it makes sense to have labels with no value.

Copy link
Member

@phuongdh phuongdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

it { is_expected.to allow_value('collection@example.com').for(:contact_email) }
it { is_expected.not_to allow_value('collection@').for(:contact_email) }
it { is_expected.to allow_value('https://collection.example.com').for(:website_url) }
it { is_expected.not_to allow_value('collection.example.com').for(:website_url) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a little a little too strict in practice as people aren't used to typing out the "https://" part, but I guess it makes for a safer validator.

@cjcolvar cjcolvar merged commit 121bb1f into develop May 1, 2020
@cjcolvar cjcolvar deleted the collection_contact branch May 1, 2020 01:08
Comment on lines +43 to +51
property :contact_email, predicate: Avalon::RDFVocab::Collection.contact_email, multiple: false do |index|
index.as :stored_sortable
end
property :website_label, predicate: Avalon::RDFVocab::Collection.website_label, multiple: false do |index|
index.as :stored_sortable
end
property :website_url, predicate: Avalon::RDFVocab::Collection.website_url, multiple: false do |index|
index.as :stored_sortable
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlhardes Are there standard RDF predicates that we should be using for these?

@joncameron joncameron mentioned this pull request Jun 9, 2020
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants