Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
weryques 2018-07-27 16:22:07 -03:00
commit 1e107f8afe
37 changed files with 342 additions and 111 deletions

View File

@ -180,6 +180,7 @@ class Admin {
'admin_url' => admin_url(),
'custom_header_support' => get_theme_support('custom-header'),
'registered_view_modes' => \Tainacan\Theme_Helper::get_instance()->get_registered_view_modes(),
'repository_name' => get_bloginfo('name')
];
$maps = [

View File

@ -1,7 +1,7 @@
<template>
<div
class="page-container"
:class="{'primary-page' : isNewCollection }">
:class="{'repository-level-page' : isNewCollection }">
<tainacan-title />
<form
v-if="collection != null && collection != undefined"

View File

@ -1,6 +1,6 @@
<template>
<div
class="primary-page page-container">
class="repository-level-page page-container">
<tainacan-title />
<form
class="tainacan-form"

View File

@ -1,11 +1,11 @@
<template>
<div
class="primary-page page-container">
class="repository-level-page page-container">
<div class="tainacan-page-title">
<h1>{{ $i18n.get('label_metadata_mapping') }} </h1>
<a
@click="$router.go(-1)"
class="back-link is-secondary">
class="back-link has-text-secondary">
{{ $i18n.get('back') }}
</a>
<hr>
@ -119,7 +119,7 @@
</b-modal>
<a
v-if="collectionId != null && collectionId != undefined"
class="is-inline is-pulled-right add-link"
class="is-inline is-pulled-right add-link has-text-secondary"
@click="createNewMetadatum()">
<b-icon
icon="plus-circle"

View File

@ -40,6 +40,21 @@
v-model="editForm.description"
@focus="clearErrors('description')"/>
</b-field>
<b-field
:addons="false">
<label class="label is-inline">
{{ $i18n.get('label_semantic_uri') }}
<help-button
:title="$i18n.getHelperTitle('metadata', 'semantic_uri')"
:message="$i18n.getHelperMessage('metadata', 'semantic_uri')"/>
</label>
<b-input
v-model="editForm.semantic_uri"
name="semantic_uri"
type="url"
@focus="clearErrors('semantic_uri')"/>
</b-field>
<b-field
:addons="false"

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="page-container primary-page">
<div class="page-container repository-level-page">
<tainacan-title />
<b-tabs v-model="activeTab">
<b-tab-item :label="$i18n.get('taxonomy')">

View File

@ -37,7 +37,8 @@
:class="{
'not-sortable-item': filter.id == undefined || openedFilterId != '' || choosenMetadatum.name == filter.name,
'not-focusable-item': openedFilterId == filter.id,
'disabled-filter': filter.enabled == false
'disabled-filter': filter.enabled == false,
'inherited-filter': filter.collection_id != collectionId || isRepositoryLevel
}"
v-for="(filter, index) in activeFilterList"
:key="index">
@ -130,7 +131,7 @@
</div>
<div class="column available-metadata-area">
<div class="field" >
<h3 class="label"> {{ $i18n.get('label_available_metadata') }}</h3>
<h3 class="label has-text-secondary"> {{ $i18n.get('label_available_metadata') }}</h3>
<draggable
v-if="availableMetadatumList.length > 0"
v-model="availableMetadatumList"
@ -141,6 +142,7 @@
}">
<div
class="available-metadatum-item"
:class="{'inherited-metadatum': metadatum.collection_id != collectionId || isRepositoryLevel}"
v-if="metadatum.enabled"
v-for="(metadatum, index) in availableMetadatumList"
:key="index"
@ -466,15 +468,6 @@ export default {
@import "../../scss/_variables.scss";
.page-title {
border-bottom: 1px solid $secondary;
h2 {
color: $blue5;
font-weight: 500;
}
margin: 1em 0em 2.0em 0em;
}
.loading-spinner {
animation: spinAround 500ms infinite linear;
border: 2px solid #dbdbdb;
@ -657,7 +650,6 @@ export default {
}
h3 {
color: $secondary;
margin: 0.2em 0em 1em -1.2em;
font-weight: 500;
}
@ -743,5 +735,36 @@ export default {
}
}
.inherited-filter {
&.active-filter-item:hover:not(.not-sortable-item) {
background-color: $blue5;
border-color: $blue5;
.switch.is-small {
input[type="checkbox"] + .check {
background-color: $blue5 !important;
}
&:hover input[type="checkbox"] + .check {
background-color: $blue5 !important;
}
}
}
}
.inherited-metadatum {
&.available-metadatum-item:hover {
background-color: $blue5 !important;
border-color: $blue5 !important;
&:after {
border-color: transparent $blue5 transparent transparent !important;
}
&:before {
border-color: transparent $blue5 transparent transparent !important;
}
}
}
</style>

View File

@ -41,7 +41,8 @@
:class="{
'not-sortable-item': metadatum.id == undefined || openedMetadatumId != '' ,
'not-focusable-item': openedMetadatumId == metadatum.id,
'disabled-metadatum': metadatum.enabled == false
'disabled-metadatum': metadatum.enabled == false,
'inherited-metadatum': metadatum.collection_id != collectionId || isRepositoryLevel
}"
v-for="(metadatum, index) in activeMetadatumList"
:key="index">
@ -113,7 +114,7 @@
<div class="column available-metadata-area" >
<div class="field">
<h3 class="label">{{ $i18n.get('label_available_metadata_types') }}</h3>
<h3 class="label has-text-secondary">{{ $i18n.get('label_available_metadata_types') }}</h3>
<draggable
v-model="availableMetadatumList"
:options="{
@ -124,7 +125,7 @@
<div
@click.prevent="addMetadatumViaButton(metadatum)"
class="available-metadatum-item"
:class="{ 'hightlighted-metadatum' : hightlightedMetadatum == metadatum.name }"
:class="{ 'hightlighted-metadatum' : hightlightedMetadatum == metadatum.name, 'inherited-metadatum': isRepositoryLevel }"
v-for="(metadatum, index) in availableMetadatumList"
:key="index">
<grip-icon/>
@ -935,7 +936,6 @@ export default {
}
h3 {
color: $secondary;
margin: 0.2em 0em 1em -1.2em;
font-weight: 500;
}
@ -1094,6 +1094,33 @@ export default {
}
}
.inherited-metadatum {
&.active-metadatum-item:hover:not(.not-sortable-item) {
background-color: $blue5;
border-color: $blue5;
.switch.is-small {
input[type="checkbox"] + .check {
background-color: $blue5 !important;
}
&:hover input[type="checkbox"] + .check {
background-color: $blue5 !important;
}
}
}
&.available-metadatum-item:hover {
background-color: $blue5 !important;
border-color: $blue5 !important;
&:after {
border-color: transparent $blue5 transparent transparent !important;
}
&:before {
border-color: transparent $blue5 transparent transparent !important;
}
}
}
#mappers-options-dropdown {
background-color: transparent;
color: #fff;

View File

@ -31,7 +31,7 @@
:key="term.id"
@click.prevent="isEditingTerm ? null : loadTerms(term.id)">
<a
class="is-small"
class="is-small has-text-secondary"
type="button"
@click="addNewChildTerm(term, index)"
:disabled="isEditingTerm">

View File

@ -37,9 +37,9 @@
tag="a"
to="/metadata"
:class="activeRoute == 'MetadataPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="format-list-bulleted-type"/>
<span class="icon">
<i class="mdi mdi-format-list-bulleted-type"/>
</span>
<span class="menu-text">{{ $i18n.getFrom('metadata', 'name') }}</span>
</router-link>
</li>
@ -48,9 +48,9 @@
tag="a"
to="/filters"
:class="activeRoute == 'FiltersPage' ? 'is-active':''">
<b-icon
size="is-small"
icon="filter"/>
<span class="icon">
<i class="mdi mdi-filter"/>
</span>
<span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
</router-link>
</li>
@ -59,9 +59,7 @@
tag="a"
to="/taxonomies"
:class="activeRoute == 'Page' ? 'is-active':''">
<b-icon
size="is-small"
icon="shape"/>
<taxonomies-icon />
<span class="menu-text">{{ $i18n.getFrom('taxonomies', 'name') }}</span>
</router-link>
</li>
@ -81,6 +79,8 @@
<script>
import ActivitiesIcon from '../other/activities-icon.vue';
import TaxonomiesIcon from '../other/taxonomies-icon.vue';
export default {
name: 'PrimaryMenu',
props: {
@ -88,7 +88,8 @@ export default {
activeRoute: '/collections'
},
components: {
ActivitiesIcon
ActivitiesIcon,
TaxonomiesIcon
},
}
</script>
@ -144,6 +145,18 @@ export default {
.activities-icon {
fill: white;
margin-bottom: -4px;
}
.taxonomies-icon {
fill: white;
margin-bottom: -2px;
}
.icon {
height: auto;
width: auto;
i {
font-size: 18px !important;
}
}
}

View File

@ -1,18 +1,20 @@
<template>
<div
id="tainacan-subheader"
class="level secondary-page">
<div class="level-left">
class="secondary-page">
<div class="back-button">
<button
@click="$router.go(-1)"
class="button is-turquoise4">
<span class="icon">
<i class="mdi mdi-chevron-left"/>
</span>
</button>
</div>
<div class="level">
<div class="level-left">
<div class="level-item">
<div class="back-button">
<button
@click="$router.go(-1)"
class="button is-turquoise4">
<span class="icon">
<i class="mdi mdi-chevron-left"/>
</span>
</button>
</div>
<nav class="breadcrumbs">
<router-link
tag="a"
@ -32,6 +34,7 @@
</nav>
</div>
</div>
<ul class="menu-list level-right">
<li
:class="activeRoute == 'ItemPage' || activeRoute == 'CollectionItemsPage' || activeRoute == 'ItemEditionForm' || activeRoute == 'ItemCreatePage' ? 'is-active':''"
@ -98,6 +101,7 @@
</li>
</ul>
</div>
</div>
</template>
@ -220,7 +224,7 @@ export default {
// Tainacan Header
#tainacan-subheader {
background-color: $gray2;
background-color: $gray1;
height: $subheader-height;
max-height: $subheader-height;
width: 100%;
@ -234,6 +238,10 @@ export default {
left: 0;
right: 0;
z-index: 9;
display: flex;
align-items: center;
justify-content: space-between;
transition: padding 0.3s, height 0.3s;
h1 {
@ -246,25 +254,25 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
-webkit-transition: margin-bottom 0.2s linear; /* Safari */
transition: margin-bottom 0.2s linear;
}
.back-button {
padding: 0;
margin: 0 12px 0 0;
margin: 0;
height: 42px;
width: 42px;
background-color: $turquoise4;
color: white;
width: $page-side-padding;
min-width: $page-side-padding;
background-color: $gray1;
color: $turquoise4;
display: flex;
align-items: center;
button,
button:hover,
button:focus,
button:active{
color: white;
button:active {
width: 100%;
color: $turquoise4;
background-color: transparent !important;
border: none;
.icon i {
@ -279,49 +287,64 @@ export default {
color: #1d1d1d;
}
.level {
width: 100%;
}
li{
margin-right: 0px;
transition: max-width 0.4s linear, width 0.4s linear;
-webkit-transition: max-width 0.4s linear, width 0.4s linear;
overflow: hidden;
max-width: 50px;
transition: background-color 0.2s ease;
// transition: max-width 0.4s ease-in , width 0.4s ease-in ;
// -webkit-transition: max-width 0.4s ease-in, width 0.4s ease-in ;
// overflow: hidden;
// max-width: 50px;
&.is-active {
background-color: $turquoise4;
a {
background-color: $turquoise4;
transition: background-color 0.2s ease;
color: white;
text-decoration: none;
}
svg.activities-icon {
transition: fill 0.2s ease;
fill: white !important;
}
}
&:hover {
max-width: 100%;
transition: max-width 0.4s linear, width 0.4s linear;
-webkit-transition: max-width 0.4s linear, width 0.4s linear;
a {
background-color: transparent;
text-decoration: none;
}
.menu-text {
opacity: 1.0;
width: 100%;
visibility: visible;
transition: opacity 0.2s linear, visibility 0.2s linear, width 0.4s linear;
-webkit-transition: opacity 0.2s linear, visibility 0.2s linear, width 0.4s linear;
background-color: $turquoise3;
// max-width: 100%;
// transition: max-width 0.4s ease-out 0.2s, width 0.4s ease-out 0.2s;
// -webkit-transition: max-width 0.4s ease-out 0.2s, width 0.4s ease-out 0.2s;
a {
background-color: transparent;
text-decoration: none;
color: white;
}
svg.activities-icon {
fill: white !important;
}
// .menu-text {
// opacity: 1.0;
// width: 100%;
// right: 0%;
// visibility: visible;
// transition: opacity 0.4s ease-out 0.2s, visibility 0.4s ease-out 0.2s, width 0.4s ease-out 0.2s, right 0.4s ease-out 0.2s;
// -webkit-transition: opacity 0.4s ease-out 0.2s , visibility 0.4s ease-out 0.2s, width 0.4s ease-out 0.2s, right 0.4s ease-out 0.2s;
// }
}
a {
color: $gray4;
text-align: center;
white-space: nowrap;
padding: 1.0em 10px;
padding: 10px;
min-width: 50px;
line-height: 22px;
border-radius: 0px;
position: relative;
align-items: center;
display: flex;
}
a:focus{
box-shadow: none;
@ -329,19 +352,20 @@ export default {
.icon {
margin: 0;
padding: 0;
i {
font-size: 19px !important;
}
}
.menu-text {
margin-left: 8px;
font-size: 14px;
display: inline-flex;
width: 0px;
opacity: 0.0;
visibility: hidden;
transition: opacity 0.2s linear, visibility 0.2s linear, width 0.4s linear;
-webkit-transition: opacity 0.2s linear, visibility 0.2s linear, width 0.4s linear;
// width: 0px;
// right: 100%;
// opacity: 0.0;
// visibility: hidden;
// transition: opacity 0.4s ease-in, visibility 0.4s ease-in , width 0.2s ease-in, right 0.2s ease-in;
// -webkit-transition: opacity 0.4s ease-in, visibility 0.4s ease-in, width 0.2s ease-in, right 0.2s ease-in;
}
}

View File

@ -64,7 +64,7 @@
</div>
<button
@click="showProcesses = !showProcesses"
class="button is-small is-gray2 level-item">
class="button is-small is-white level-item">
<b-icon icon="swap-vertical"/>
</button>
<processes-popup
@ -154,7 +154,7 @@
// Tainacan Header
#tainacan-header {
background-color: $gray2;
background-color: white;
height: $header-height;
max-height: $header-height;
width: 100%;
@ -191,7 +191,7 @@
color: $blue5 !important;
}
.button:hover, .button:active, .button:focus {
background-color: $gray2 !important;
background-color: white !important;
}
.search-area {

View File

@ -3,8 +3,8 @@
id="tainacan-repository-subheader"
class="level secondary-page"
:class="{'is-menu-compressed': isMenuCompressed, 'is-repository-level' : isRepositoryLevel}">
<h1 v-if="isRepositoryLevel">Nome do Site</h1>
<h1 v-else>{{ collectionName }}</h1>
<h1 v-if="isRepositoryLevel">{{ repositoryName }}</h1>
<h1 v-else>{{ $i18n.get('collection') + '' }} <span class="has-text-weight-bold">{{ collectionName }}</span></h1>
</div>
</template>
@ -13,6 +13,11 @@ import { mapActions, mapGetters } from 'vuex';
export default {
name: 'TainacanRepositorySubheader',
data() {
return {
repositoryName: tainacan_plugin.repository_name
}
},
props: {
isMenuCompressed: false,
isRepositoryLevel: true
@ -70,7 +75,6 @@ export default {
h1 {
font-size: 18px;
font-weight: 500;
color: white;
line-height: 18px;
max-width: 100%;

View File

@ -4,7 +4,7 @@
<h1>{{ pageTitle }} <span class="is-italic has-text-weight-semibold">{{ isRepositoryLevel ? '' : entityName }}</span></h1>
<a
@click="$router.go(-1)"
class="back-link is-secondary">
class="back-link has-text-secondary">
{{ $i18n.get('back') }}
</a>
<hr>

View File

@ -4,8 +4,8 @@
xmlns="http://www.w3.org/2000/svg"
x="0px"
y="0px"
width="22"
height="22"
width="20"
height="20"
viewBox="0 0 24 24"
class="activities-icon"
xml:space="preserve">
@ -25,7 +25,6 @@ export default {
<style type="text/scss">
svg.activities-icon {
margin-bottom: -5px;
fill: #898d8f;
}

View File

@ -1,6 +1,6 @@
<template>
<span class="help-wrapper">
<a class="help-button">
<a class="help-button has-text-secondary">
<b-icon
size="is-small"
icon="help-circle-outline"/></a>

View File

@ -192,7 +192,7 @@ export default {
}
.processes-popup{
background-color: #c1dae0;
background-color: $blue2;
width: 320px;
max-width: 100%;
position: absolute;
@ -220,6 +220,7 @@ export default {
}
.popup-footer {
padding: 4px 12px 6px 10px;
min-height: 29px;
.footer-title {
margin-right: auto;
font-size: 0.625rem;
@ -244,7 +245,7 @@ export default {
}
li:hover {
background-color: $gray2;
background-color: $gray1;
.action-icon{
visibility: visible;
@ -318,7 +319,7 @@ export default {
border-style: solid;
}
&:before {
border-color: transparent transparent $turquoise2 transparent;
border-color: transparent transparent $blue2 transparent;
border-right-width: 8px;
border-bottom-width: 8px;
border-left-width: 8px;

View File

@ -0,0 +1,29 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
height="16"
width="16"
xml:space="preserve"
viewBox="0 0 20 20"
y="0px"
x="0px"
class="taxonomies-icon">
<path
d="M 0,0 H 9 V 9 H 0 V 0 M 15.5,0 C 18,0 20,2 20,4.5 20,7 18,9 15.5,9 13,9 11,7 11,4.5 11,2 13,0 15.5,0 M 4.5,12 9,20 H 0 L 4.5,12 M 17,15 h 3 v 2 h -3 v 3 h -2 v -3 h -3 v -2 h 3 v -3 h 2 z"
/>
</svg>
</template>
<script>
export default {
name: 'TaxonomiesIcon'
}
</script>
<style type="text/scss">
svg.taxonomies-icon {
fill: #898d8f;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="primary-page page-container">
<div class="repository-level-page page-container">
<tainacan-title />
<h3>{{ $i18n.get('label_available_importers') }}</h3>

View File

@ -1,5 +1,5 @@
<template>
<div class="primary-page page-container">
<div class="repository-level-page page-container">
<b-loading :active.sync="isLoadingMetadatumMappers"/>
<tainacan-title />
<div

View File

@ -2,7 +2,7 @@
<div>
<div
:class="{
'primary-page': isRepositoryLevel,
'repository-level-page': isRepositoryLevel,
'page-container': isRepositoryLevel
}">
<tainacan-title />

View File

@ -1,5 +1,5 @@
<template>
<div class="primary-page page-container">
<div class="repository-level-page page-container">
<tainacan-title />
<filters-list/>
</div>

View File

@ -1,6 +1,6 @@
<template>
<div
:class="{'primary-page': isRepositoryLevel}">
:class="{'repository-level-page': isRepositoryLevel}">
<!-- SEARCH AND FILTERS --------------------- -->
<!-- Filter menu compress button -->
@ -40,7 +40,7 @@
</div>
<a
@click="openAdvancedSearch = !openAdvancedSearch"
class="is-size-7 is-secondary is-pulled-right is-hidden-mobile">{{ $i18n.get('advanced_search') }}</a>
class="is-size-7 has-text-secondary is-pulled-right is-hidden-mobile">{{ $i18n.get('advanced_search') }}</a>
<h3 class="has-text-weight-semibold">{{ $i18n.get('filters') }}</h3>
<a
@ -368,7 +368,7 @@
</div>
<a
@click="openAdvancedSearch = !openAdvancedSearch"
class="is-size-7 is-secondary is-pulled-right">{{ $i18n.get('advanced_search') }}</a>
class="is-size-7 has-text-secondary is-pulled-right">{{ $i18n.get('advanced_search') }}</a>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
<template>
<div class="primary-page page-container">
<div class="repository-level-page page-container">
<tainacan-title />
<metadata-list/>
</div>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="primary-page page-container">
<div class="repository-level-page page-container">
<tainacan-title />
<div
class="sub-header"

View File

@ -1,7 +1,7 @@
<template>
<div>
<div class="is-fullheight">
<div class="page-container primary-page">
<div class="page-container repository-level-page">
<tainacan-title/>
<h1 class="event-titles">{{ event.description }}</h1>
<div

View File

@ -1,6 +1,6 @@
<template>
<div class="columns is-fullheight">
<div class="page-container primary-page">
<div class="page-container repository-level-page">
<div class="card">
<div class="card-content">
<p class="title">

View File

@ -28,7 +28,7 @@
label { margin-bottom: 0; }
&.control { font-size: 13px !important; }
.b-checkbox { width: 100% };
&:hover { background-color: $turquoise1; }
&:hover { background-color: $gray1; }
.is-small { color: $gray4; }
&.is-active { background-color: $turquoise2; }
}

View File

@ -11,7 +11,7 @@
margin-bottom: 0px !important;
color: $tainacan-input-color;
option:checked, option:hover {
background-color: $turquoise1 !important;
background-color: $gray1 !important;
}
&:focus, &:active {
box-shadow: none !important;

View File

@ -211,3 +211,4 @@
}
}
}

View File

@ -64,14 +64,77 @@ a:hover {
}
}
// Page settings
.primary-page {
// Repository-level pages
.repository-level-page {
margin-top: 94px;
height: $page-height !important;
@media screen and (max-width: 769px) {
margin-top: 0;
}
.is-primary, .is-primary:hover, .is-primary:focus {
background-color: $blue4 !important;
color: white !important;
}
.is-secondary, .is-secondary:hover, .is-secondary:focus {
background-color: $blue5 !important;
color: white !important;
}
.has-text-primary, .has-text-primary:hover, .is-has-text-primary:focus {
color: $blue4 !important;
}
a, a:hover,
.has-text-secondary, .has-text-secondary:hover, .is-has-text-secondary:focus {
color: $blue5 !important;
}
.tabs {
li.is-active a {
border-bottom: 5px solid $blue5;
color: $blue5;
}
}
.select:not(.is-multiple)::after {
color: $blue5;
option:checked, option:hover {
background-color: $gray1 !important;
}
}
.tainacan-table {
tr.selected-row {
background-color: $blue1 !important;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $blue2 !important;
}
}
}
.dropdown-trigger {
.button .icon {
color: $blue5;
}
}
.dropdown-menu .dropdown-content {
.dropdown-item.is-active { background-color: $blue2; }
}
.switch {
&:hover input[type="checkbox"]:checked + .check {
background-color: $blue2;
}
input[type="checkbox"]:checked + .check {
border: 2px solid $blue5;
&::before {
background-color: $blue5;
}
}
&.is-small {
input[type="checkbox"]:checked + .check {
border: 1.5px solid $blue5;
}
}
}
}
// Generic page container
.page-container {

View File

@ -271,6 +271,7 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_max_options_to_show' => __( 'Max options to show', 'tainacan' ),
'label_unamed_process' => __( 'Unamed process', 'tainacan' ),
'label_import_collection' => __( 'Import collection', 'tainacan' ),
'label_semantic_uri' => __( 'Semantic Uri', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),

View File

@ -210,6 +210,15 @@ class Metadatum extends Entity {
public function get_exposer_mapping() {
return $this->get_mapped_property('exposer_mapping');
}
/**
* Return the semantic_uri
*
* @return string
*/
function get_semantic_uri(){
return $this->get_mapped_property('semantic_uri');
}
/**
* Set the metadatum name
@ -361,7 +370,16 @@ class Metadatum extends Entity {
public function set_exposer_mapping( $value ) {
$this->set_mapped_property('exposer_mapping', $value);
}
/**
* Set Semantic URI for the metadatum
*
* @param [string] $value
* @return void
*/
function set_semantic_uri( $value ){
$this->set_mapped_property('semantic_uri', $value);
}
/**
* Transient property used to store the status of the metadatum for a particular collection

View File

@ -40,6 +40,10 @@ class Metadata extends Repository {
}
/**
* {@inheritDoc}
* @see \Tainacan\Repositories\Repository::get_map()
*/
public function get_map() {
return apply_filters('tainacan-get-map-'.$this->get_name(), [
'name' => [
@ -182,7 +186,15 @@ class Metadata extends Repository {
'validation' => v::stringType()->in( [ 'yes', 'no', 'never' ] ),
'description' => __( 'Display by default on listing or do not display or never display.', 'tainacan' ),
'default' => 'yes'
]
],
'semantic_uri' => [
'map' => 'meta',
'title' => __( 'The semantic metadatum description URI' ),
'type' => __( 'url' ),
'validation' => v::optional(v::url()),
'description' => __( 'The semantic metadatum description URI like: ', 'tainacan' ).'https://schema.org/URL',
'default' => ''
]
] );
}

View File

@ -403,7 +403,7 @@ class Exposers {
$metadatum->set_metadata_type('Tainacan\Metadata_Types\Text');
}
$metadatum->set_name($mapper_metadatum['label']);
$metadatum->set_description($mapper_metadatum['URI']);
$metadatum->set_semantic_uri($mapper_metadatum['URI']);
$metadatum->set_exposer_mapping([
$mapper->slug => $slug
]);

View File

@ -134,7 +134,7 @@ class CSV extends Importer {
* @return Tainacan\Entities\Item Item inserted
*/
public function insert( $processed_item, $collection_index ) {
$inserted_item = super::insert( $processed_item, $collection_index );
$inserted_item = parent::insert( $processed_item, $collection_index );
$column_document = $this->get_option('document_index');
$column_attachment = $this->get_option('attachment_index');

View File

@ -430,7 +430,7 @@ class TAINACAN_REST_Exposers extends TAINACAN_UnitApiTestCase {
foreach ($metadata as $metadatum) {
$this->assertTrue(array_key_exists($metadatum->get_slug(), $mapper->metadata));
if(! array_key_exists('core_metadatum', $mapper->metadata[$metadatum->get_slug()]) || $mapper->metadata[$metadatum->get_slug()]['core_metadatum'] == false) {
$this->assertEquals($mapper->metadata[$metadatum->get_slug()]['URI'], $metadatum->get_description());
$this->assertEquals($mapper->metadata[$metadatum->get_slug()]['URI'], $metadatum->get_semantic_uri());
}
$this->assertEquals($mapper->metadata[$metadatum->get_slug()]['label'], $metadatum->get_name());
}