-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dataLayer * Add e2e test * Add title to dataLayer * Add type of resource * Add datalayer to collection page and remove null values from object * Fix linting issues * Fix broken cypress data error * Add page_type and human readable language field * Fix photographer_tesim * fix nested iframes dl viewer relates cypress test * fix nested iframes issue
- v3.17.0
- v3.16.6
- v3.16.5
- v3.16.4
- v3.16.3
- v3.16.2
- v3.16.1
- v3.16.0
- v3.15.0
- v3.14.0
- v3.13.0
- v3.12.0
- v3.11.0
- v3.10.0
- v3.9.0
- v3.8.0
- v3.7.1
- v3.7.0
- v3.6.1
- v3.6.0
- v3.5.2
- v3.5.1
- v3.5.0
- v3.4.14
- v3.4.13
- v3.4.12
- v3.4.11
- v3.4.10
- v3.4.9
- v3.4.8
- v3.4.7
- v3.4.6
- v3.4.5
- v3.4.4
- v3.4.3
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.22
- v3.2.21
- v3.2.20
- v3.2.19
- v3.2.18
- v3.2.17
- v3.2.16
- v3.2.15
- 3.6.0
Showing
5 changed files
with
117 additions
and
36 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,36 +1,53 @@ | ||
<% if Flipflop.sinai? %> | ||
<%# --------- Back to Search Results ----- %> | ||
|
||
<div class='item-page__metadata-wrapper-results--sinai'> | ||
<%= link_back_to_catalog label: '← Back to Search Results', class: 'si-link si-link-search-results' %> | ||
<%#= link_to image_tag('iiif-logo.png', alt: 'IIIF Manifest'), @document[:iiif_manifest_url_ssi], class: 'si-link-iiif' %> | ||
<div class='item-page__metadata-wrapper'> | ||
<%= render 'catalog/work_record--ursus/primary_metadata', document: document %> | ||
<%= render 'catalog/work_record--ursus/secondary_metadata', document: document %> | ||
</div> | ||
|
||
<%# ---------- IIIF & Tooltip ------------ %> | ||
<div class='si-link-iiif'> | ||
<div class='iiif-tooltip--sinai' data-toggle="tooltip" data-placement="bottom" data-html="true" title="IIIF Manifest URL"><%= link_to image_tag('iiif-logo.png', alt: 'IIIF Manifest'), @document[:iiif_manifest_url_ssi], class: 'si-link-iiif' %></div> | ||
</div> | ||
</div> | ||
|
||
<%# ----------- Shelfmark --------------- %> | ||
<div class='title-row-show--siani'> | ||
<%= @document[:shelfmark_ssi] %> | ||
</div> | ||
|
||
<div class='item-page__metadata-wrapper'> | ||
<%= render 'catalog/work_record--sinai/primary_metadata', document: document %> | ||
<%= render 'catalog/work_record--sinai/secondary_metadata', document: document %> | ||
</div> | ||
|
||
<%# ----------- Ursus --------------- %> | ||
<% else %> | ||
<div class='item-page__metadata-wrapper'> | ||
<%= render 'catalog/work_record--ursus/primary_metadata', document: document %> | ||
<%= render 'catalog/work_record--ursus/secondary_metadata', document: document %> | ||
</div> | ||
<% end %> | ||
|
||
<!-- <script> | ||
$(function () { | ||
$('[data-toggle="tooltip"]').tooltip() | ||
}) | ||
</script> --> | ||
<script> | ||
dataLayer.push({ | ||
'event':'pageLoad', | ||
'page_type':'asset', | ||
'AltTitle.other': <%= raw @document[:alternative_title_tesim].to_json %> === null ? undefined : <%= raw @document[:alternative_title_tesim].to_json.html_safe %>, | ||
'Coverage.geographic': <%= raw @document[:location_tesim].to_json %> === null ? undefined : <%= raw @document[:location_tesim].to_json.html_safe %>, | ||
'Date.normalized': <%= raw @document[:normalized_date_sim].to_json %> === null ? undefined : <%= raw @document[:normalized_date_sim].to_json.html_safe %>, | ||
'Description.fundingNote': <%= raw @document[:funding_note_tesim].to_json %> === null ? undefined : <%= raw @document[:funding_note_tesim].to_json.html_safe %>, | ||
'Finding Aid URL': <%= raw @document[:finding_aid_url_ssm].to_json %> === null ? undefined : <%= raw @document[:finding_aid_url_ssm].to_json.html_safe %>, | ||
'Item ARK': <%= raw @document[:ark_ssi].to_json %> === null ? undefined : <%= raw @document[:ark_ssi].to_json.html_safe %>, | ||
'Language': <%= raw @document[:human_readable_language_tesim].to_json %> === null ? undefined : <%= raw @document[:human_readable_language_tesim].to_json.html_safe %>, | ||
'Name.architect': <%= raw @document[:architect_tesim].to_json %> === null ? undefined : <%= raw @document[:architect_tesim].to_json.html_safe %>, | ||
'Name.artist': <%= raw @document[:artist_tesim].to_json %> === null ? undefined : <%= raw @document[:artist_tesim].to_json.html_safe %>, | ||
'Name.caligrapher': <%= raw @document[:calligrapher_tesim].to_json %> === null ? undefined : <%= raw @document[:calligrapher_tesim].to_json.html_safe %>, | ||
'Name.cartographer': <%= raw @document[:cartographer_tesim].to_json %> === null ? undefined : <%= raw @document[:cartographer_tesim].to_json.html_safe %>, | ||
'Name.commentator': <%= raw @document[:commentator_tesim].to_json %> === null ? undefined : <%= raw @document[:commentator_tesim].to_json.html_safe %>, | ||
'Name.composer': <%= raw @document[:composer_tesim].to_json %> === null ? undefined : <%= raw @document[:composer_tesim].to_json.html_safe %>, | ||
'Name.creator': <%= raw @document[:creator_tesim].to_json %> === null ? undefined : <%= raw @document[:creator_tesim].to_json.html_safe %>, | ||
'Name.director': <%= raw @document[:director_tesim].to_json %> === null ? undefined : <%= raw @document[:director_tesim].to_json.html_safe %>, | ||
'Name.editor': <%= raw @document[:editor_tesim].to_json %> === null ? undefined : <%= raw @document[:editor_tesim].to_json.html_safe %>, | ||
'Name.engraver': <%= raw @document[:engraver_tesim].to_json %> === null ? undefined : <%= raw @document[:engraver_tesim].to_json.html_safe %>, | ||
'Name.illuminator': <%= raw @document[:illuminator_tesim].to_json %> === null ? undefined : <%= raw @document[:illuminator_tesim].to_json.html_safe %>, | ||
'Name.illustrator': <%= raw @document[:illustrator_tesim].to_json %> === null ? undefined : <%= raw @document[:illustrator_tesim].to_json.html_safe %>, | ||
'Name.interviewee': <%= raw @document[:interviewee_tesim].to_json %> === null ? undefined : <%= raw @document[:interviewee_tesim].to_json.html_safe %>, | ||
'Name.interviewer': <%= raw @document[:interviewer_tesim].to_json %> === null ? undefined : <%= raw @document[:interviewer_tesim].to_json.html_safe %>, | ||
'Name.lyricist': <%= raw @document[:lyricist_tesim].to_json %> === null ? undefined : <%= raw @document[:lyricist_tesim].to_json.html_safe %>, | ||
'Name.photographer': <%= raw @document[:photographer_tesim].to_json %> === null ? undefined : <%= raw @document[:photographer_tesim].to_json.html_safe %>, | ||
'Name.printmaker': <%= raw @document[:printmaker_tesim].to_json %> === null ? undefined : <%= raw @document[:printmaker_tesim].to_json.html_safe %>, | ||
'Name.producer': <%= raw @document[:producer_tesim].to_json %> === null ? undefined : <%= raw @document[:producer_tesim].to_json.html_safe %>, | ||
'Name.recipient': <%= raw @document[:recipient_tesim].to_json %> === null ? undefined : <%= raw @document[:recipient_tesim].to_json.html_safe %>, | ||
'Name.rubricator': <%= raw @document[:rubricator_tesim].to_json %> === null ? undefined : <%= raw @document[:rubricator_tesim].to_json.html_safe %>, | ||
'Name.subject': <%= raw @document[:named_subject_tesim].to_json %> === null ? undefined : <%= raw @document[:named_subject_tesim].to_json.html_safe %>, | ||
'Name.scribe': <%= raw @document[:scribe_tesim].to_json %> === null ? undefined : <%= raw @document[:scribe_tesim].to_json.html_safe %>, | ||
'Name.translator': <%= raw @document[:translator_tesim].to_json %> === null ? undefined : <%= raw @document[:translator_tesim].to_json.html_safe %>, | ||
'Opac url': <%= raw @document[:opac_url_ssi].to_json %> === null ? undefined : <%= raw @document[:opac_url_ssi].to_json.html_safe %>, | ||
'Project Name': <%= raw @document[:member_of_collections_ssim].to_json %> === null ? undefined : <%= raw @document[:member_of_collections_ssim].to_json.html_safe %>, // Not sure if pulling from the right field there is no project_tesin field in solr | ||
'Publisher.publisherName': <%= raw @document[:publisher_tesim].to_json %> === null ? undefined : <%= raw @document[:publisher_tesim].to_json.html_safe %>, | ||
'Repository': <%= raw @document[:repository_tesim].to_json %> === null ? undefined : <%= raw @document[:repository_tesim].to_json.html_safe %>, | ||
'Subject geographic': <%= raw @document[:subject_geographic_tesim].to_json %> === null ? undefined : <%= raw @document[:subject_geographic_tesim].to_json.html_safe %>, | ||
'Subject name': <%= raw @document[:named_subject_tesim].to_json %> === null ? undefined : <%= raw @document[:named_subject_tesim].to_json.html_safe %>, | ||
'Subject temporal': <%= raw @document[:subject_temporal_tesim].to_json %> === null ? undefined : <%= raw @document[:subject_topic_tesim].to_json.html_safe %>, | ||
'Subject topic': <%= raw @document[:subject_topic_tesim].to_json.html_safe %> === null ? undefined : <%= raw @document[:subject_temporal_tesim].to_json.html_safe %>, | ||
'Title': <%= raw @document[:title_tesim].to_json %> === null ? undefined : <%= raw @document[:title_tesim].to_json.html_safe %>, | ||
'Type.genre': <%= raw @document[:genre_tesim].to_json %> === null ? undefined : <%= raw @document[:genre_tesim].to_json.html_safe %>, | ||
'Type.typeOfResource':<%= raw @document[:human_readable_resource_type_tesim].to_json %> === null ? undefined : <%= raw @document[:human_readable_resource_type_tesim].to_json.html_safe %> | ||
}) | ||
</script> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
describe('Data Layer tests', () => { | ||
it('Data Layer Loaded', () => { | ||
cy.visit('/catalog/ark:/21198/zz0027xkn4'); | ||
cy.window().then((win)=>{ | ||
assert.isDefined(win.dataLayer, 'window.dataLayer is defined'); | ||
assert.equal(win.dataLayer[0].Title[0], 'Russian aviators meet the press after breaking the non-stop flight record, flying from Moscow to San Jacinto, 1937'); | ||
assert.equal(win.dataLayer[0]['Item ARK'], 'ark:/21198/zz0027xkn4'); | ||
assert.equal(win.dataLayer[0]['Type.genre'][0],'news photographs'); | ||
assert.equal(win.dataLayer[0]['Type.genre'][1],'cellulose nitrate film'); | ||
}); | ||
}); | ||
}); |
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