Merge branch 'develop' of https://github.com/tainacan/tainacan into develop
This commit is contained in:
commit
0d13adef5e
|
@ -54,6 +54,7 @@
|
|||
</label>
|
||||
<div class="inline-block">
|
||||
<b-radio
|
||||
size="is-small"
|
||||
@focus="clearErrors('label_status')"
|
||||
id="tainacan-select-status-publish"
|
||||
name="status"
|
||||
|
@ -63,6 +64,7 @@
|
|||
</b-radio>
|
||||
<br>
|
||||
<b-radio
|
||||
size="is-small"
|
||||
@focus="clearErrors('label_status')"
|
||||
id="tainacan-select-status-private"
|
||||
name="status"
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
</label>
|
||||
<div class="inline-block">
|
||||
<b-radio
|
||||
size="is-small"
|
||||
@focus="clearErrors('label_status')"
|
||||
id="tainacan-select-status-publish"
|
||||
name="status"
|
||||
|
@ -61,7 +62,8 @@
|
|||
{{ $i18n.get('publish_visibility') }}
|
||||
</b-radio>
|
||||
<br>
|
||||
<b-radio
|
||||
<b-radio
|
||||
size="is-small"
|
||||
@focus="clearErrors('label_status')"
|
||||
id="tainacan-select-status-private"
|
||||
name="status"
|
||||
|
|
|
@ -674,7 +674,7 @@ export default {
|
|||
color: $secondary;
|
||||
margin-bottom: 6px;
|
||||
&:hover {
|
||||
background-color: $primary-lighter;
|
||||
background-color: $primary-light;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export default {
|
|||
}
|
||||
.help-tooltip {
|
||||
z-index: 99999999999999999999;
|
||||
color: $secondary;
|
||||
color: $tertiary;
|
||||
background-color: $primary-light;
|
||||
border: none;
|
||||
display: block;
|
||||
|
@ -64,7 +64,7 @@ export default {
|
|||
padding: 0.8em 0.8em 0em 0.8em;
|
||||
|
||||
h5 {
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export default {
|
|||
|
||||
.help-tooltip-body {
|
||||
padding: 1.2em;
|
||||
font-size: 11px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
&:before {
|
||||
|
|
|
@ -47,7 +47,7 @@ const routes = [
|
|||
{ path: 'fields', component: FieldsList, name: 'FieldsList', meta: {title: i18nGet('title_collection_fields_edition'), icon: 'folder-multiple'} },
|
||||
{ path: 'filters', component: FiltersList, name: 'FiltersList', meta: {title: i18nGet('title_collection_filters_edition'), icon: 'folder-multiple'} },
|
||||
{ path: 'events', component: EventsPage, name: 'CollectionEventsPage', meta: {title: i18nGet('title_collection_events'), icon: 'calendar'} }
|
||||
]
|
||||
]
|
||||
},
|
||||
|
||||
// { path: '/items', name: 'ItemsPage', component: ItemsPage, meta: {title: i18nGet('title_items_page'), icon: 'file-multiple'} },
|
||||
|
|
|
@ -189,23 +189,12 @@
|
|||
min-height: 100%;
|
||||
height: auto;
|
||||
|
||||
.filters-menu {
|
||||
min-width: $side-menu-width;
|
||||
max-width: $side-menu-width;
|
||||
background-color: $primary-lighter;
|
||||
margin-left: -$page-small-side-padding;
|
||||
padding-left: $page-small-side-padding
|
||||
}
|
||||
|
||||
.table-container {
|
||||
margin-right: -$page-small-side-padding;
|
||||
padding: 3em 2.5em;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 769px) {
|
||||
.filters-menu {
|
||||
display: none;
|
||||
}
|
||||
.table-container {
|
||||
margin-right: 0;
|
||||
padding: .85em 0em;
|
||||
|
|
|
@ -401,7 +401,7 @@
|
|||
height: 21px;
|
||||
width: 23px;
|
||||
border: none;
|
||||
background-color: $primary-light;
|
||||
background-color: $primary-lighter;
|
||||
color: $tertiary;
|
||||
padding: 0px;
|
||||
border-top-right-radius: 2px;
|
||||
|
|
|
@ -10,7 +10,7 @@ $secondary-invert: findColorInvert($secondary);
|
|||
$tertiary: #01295c;
|
||||
$tertiary-invert: findColorInvert($tertiary);
|
||||
|
||||
$primary-light:#A5CDD7;
|
||||
$primary-light:#c1dae0;
|
||||
$primary-lighter: #e6f6f8;
|
||||
$primary-dark: #55A0AF;
|
||||
$primary-darker: darken($primary-dark, 5%);
|
||||
|
|
|
@ -193,7 +193,7 @@ html {
|
|||
margin-bottom: 0.2em;
|
||||
}
|
||||
.control-label { // The value part in checkbox, radio and switches
|
||||
color: black;
|
||||
color: $tainacan-input-color;
|
||||
padding-left: 0.8em;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
@ -208,12 +208,16 @@ html {
|
|||
padding: 2px 25px 2px 15px!important;
|
||||
margin-top: 0px !important;
|
||||
margin-bottom: 0px !important;
|
||||
background-color: $tainacan-input-background;
|
||||
color: black;
|
||||
color: $tainacan-input-color;
|
||||
background-color: white !important;
|
||||
border: 1px solid $tainacan-input-background;
|
||||
&:focus>option:checked, &:focus>option:hover {
|
||||
background-color: $primary-lighter !important;
|
||||
}
|
||||
}
|
||||
&.is-empty select{
|
||||
background-color: $tainacan-input-background !important;
|
||||
}
|
||||
&:not(.is-multiple)::after {
|
||||
content: "\F35D" !important;
|
||||
font: normal normal normal 24px/1 "Material Design Icons" !important;
|
||||
|
@ -395,7 +399,9 @@ html {
|
|||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
&:focus input[type="checkbox"] + .check, &:active input[type="checkbox"] + .check, &:hover input[type="checkbox"] + .check {
|
||||
&:focus input[type="checkbox"] + .check,
|
||||
&:active input[type="checkbox"] + .check,
|
||||
&:hover input[type="checkbox"] + .check {
|
||||
box-shadow: none !important;
|
||||
border-color: $gray-light !important;
|
||||
}
|
||||
|
@ -404,6 +410,31 @@ html {
|
|||
border-color: $gray-light !important;
|
||||
}
|
||||
}
|
||||
.b-radio.radio {
|
||||
|
||||
input[type="radio"] + .check {
|
||||
width: 13px !important;
|
||||
height: 13px !important;
|
||||
border: 1px solid $gray-light !important;
|
||||
}
|
||||
input[type="radio"] + .check::before {
|
||||
background: black !important;
|
||||
width: 7px !important;
|
||||
height: 7px !important;
|
||||
}
|
||||
&:focus input[type="radio"] + .check,
|
||||
&:active input[type="radio"] + .check,
|
||||
&:hover input[type="radio"] + .check {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
input[type="radio"]:checked + .check {
|
||||
border-color: $gray-light !important;
|
||||
}
|
||||
&:focus input[type="radio"]:checked + .check {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Tables
|
||||
.table {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div>
|
||||
<b-select
|
||||
:id = "id"
|
||||
:placeholder="$i18n.get('label_selectbox_init')"
|
||||
v-model="selected"
|
||||
@input="onChecked()">
|
||||
<option
|
||||
|
@ -24,7 +25,7 @@
|
|||
},
|
||||
data(){
|
||||
return {
|
||||
selected:''
|
||||
selected: undefined
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -52,7 +53,8 @@
|
|||
methods: {
|
||||
onChecked() {
|
||||
this.$emit('blur');
|
||||
this.onInput(this.selected)
|
||||
if (this.selected != undefined)
|
||||
this.onInput(this.selected)
|
||||
},
|
||||
onInput($event) {
|
||||
this.$emit('input', $event);
|
||||
|
|
|
@ -45,7 +45,7 @@ class Old_Tainacan extends Importer
|
|||
'Creating all categories' => 'create_categories',
|
||||
'Create empty collections' => 'create_collections',
|
||||
'Creating relationships metadata' => 'create_relationships_meta',
|
||||
'Create repository metadata' => 'create_repo_meta',
|
||||
'Create repository metadata' => 'treat_repo_meta',
|
||||
'Create collections metadata' => 'create_collection_metas',
|
||||
'Create collections items' => 'create_collection_items',
|
||||
"Finishing" => 'clear'
|
||||
|
@ -154,18 +154,26 @@ class Old_Tainacan extends Importer
|
|||
return false;
|
||||
}
|
||||
|
||||
public function create_repo_meta()
|
||||
public function treat_repo_meta()
|
||||
{
|
||||
$repository_meta_link = $this->get_url() . $this->tainacan_api_address . "/repository/metadata?includeMetadata=1";
|
||||
$repo_meta = wp_remote_get($repository_meta_link);
|
||||
|
||||
$repo_meta_array = $this->verify_process_result($repo_meta);
|
||||
|
||||
$Fields_Repository = \Tainacan\Repositories\Fields::get_instance();
|
||||
$created_categories = $this->read_from_file("categories");
|
||||
$relationships = $this->read_from_file("relationships");
|
||||
|
||||
$this->create_meta_repo($repo_meta_array, $Fields_Repository, $created_categories, $relationships);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function create_meta_repo($repo_meta_array, $Fields_Repository, $created_categories, $relationships, $compound_id = null)
|
||||
{
|
||||
if($repo_meta_array)
|
||||
{
|
||||
$Fields_Repository = \Tainacan\Repositories\Fields::get_instance();
|
||||
$created_categories = $this->read_from_file("categories");
|
||||
$relationships = $this->read_from_file("relationships");
|
||||
|
||||
foreach ($repo_meta_array as $meta)
|
||||
{
|
||||
$avoid = [
|
||||
|
@ -178,8 +186,7 @@ class Old_Tainacan extends Importer
|
|||
|
||||
$special = [
|
||||
'socialdb_property_fixed_type',
|
||||
'stars',
|
||||
'compound'
|
||||
'stars'
|
||||
];
|
||||
|
||||
if(!in_array($meta->slug, $avoid) && !in_array($meta->type, $special))
|
||||
|
@ -193,25 +200,64 @@ class Old_Tainacan extends Importer
|
|||
if(strcmp($type, "Category") === 0)
|
||||
{
|
||||
$taxonomy_id = $meta->metadata->taxonomy;
|
||||
|
||||
$new_category_id = $created_categories[$taxonomy_id]['new_id'];
|
||||
$newField->set_field_type_options(['taxonomy_id' => $new_category_id]);
|
||||
if(isset($created_categories[$taxonomy_id]))
|
||||
{
|
||||
$new_category_id = $created_categories[$taxonomy_id]['new_id'];
|
||||
$newField->set_field_type_options(['taxonomy_id' => $new_category_id]);
|
||||
}
|
||||
}else if(strcmp($type, "Relationship") === 0)
|
||||
{
|
||||
$taxonomy_id = $meta->metadata->object_category_id;
|
||||
$new_collection_id = $relationships[$taxonomy_id]['new_id'];
|
||||
|
||||
$newField->set_field_type_options(['collection_id' => $new_collection_id]);
|
||||
if(isset($relationships[$taxonomy_id]))
|
||||
{
|
||||
$new_collection_id = $relationships[$taxonomy_id]['new_id'];
|
||||
$newField->set_field_type_options(['collection_id' => $new_collection_id]);
|
||||
}
|
||||
}else if(strcmp($type, "Compound") === 0)
|
||||
{
|
||||
$this->create_meta_repo($meta->metadata->children, $Fields_Repository, $created_categories, $relationships, $newField->get_id());
|
||||
}
|
||||
|
||||
/*Compound treatement*/
|
||||
if($compound_id === null)
|
||||
{
|
||||
$newField->set_collection_id('default');
|
||||
}else //Set compound as field parent
|
||||
{
|
||||
$newField->set_parent($compound_id);
|
||||
}
|
||||
|
||||
if(isset($meta->metadata))
|
||||
{
|
||||
/*Properties of field*/
|
||||
if($meta->metadata->required == 1)
|
||||
{
|
||||
$newField->set_required(true);
|
||||
}
|
||||
if(!empty($meta->metadata->default_value))
|
||||
{
|
||||
$newField->set_default_value($meta->metadata->default_value);
|
||||
}
|
||||
if(!empty($meta->metadata->text_help))
|
||||
{
|
||||
/**/
|
||||
}
|
||||
if(!empty($meta->metadata->cardinality))
|
||||
{
|
||||
if($meta->metadata->cardinality > 1)
|
||||
{
|
||||
$newField->set_multiple('yes');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$newField->set_collection_id('default');
|
||||
$newField->validate(); // there is no user input here, so we can be sure it will validate.
|
||||
|
||||
$Fields_Repository->insert($newField);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function create_collection_metas()
|
||||
|
@ -225,11 +271,6 @@ class Old_Tainacan extends Importer
|
|||
return false;
|
||||
}
|
||||
|
||||
public function set_relationships()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function clear()
|
||||
{
|
||||
unlink($this->get_id()."_categories.txt");
|
||||
|
|
|
@ -99,6 +99,7 @@ export const sendItem = ( { commit }, { collection_id, status }) => {
|
|||
};
|
||||
|
||||
export const updateItem = ({ commit }, { item_id, status }) => {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.tainacan.patch('/items/' + item_id, {
|
||||
status: status
|
||||
|
|
|
@ -29,7 +29,7 @@ class ImporterTests extends TAINACAN_UnitTestCase {
|
|||
$this->assertEquals( $collection->get_id(), $_SESSION['tainacan_importer'][$id]->collection->get_id() );
|
||||
}
|
||||
|
||||
public function test_automapping_old_tainacan()
|
||||
/*public function test_automapping_old_tainacan()
|
||||
{
|
||||
//$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
//$Tainacan_Fields = \Tainacan\Repositories\Fields::get_instance();
|
||||
|
@ -54,7 +54,7 @@ class ImporterTests extends TAINACAN_UnitTestCase {
|
|||
}
|
||||
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}*/
|
||||
|
||||
/*public function test_file_old_tainacan () {
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
|
|
Loading…
Reference in New Issue