Delete older components (#147)

This commit is contained in:
weryques 2018-11-30 13:37:07 -02:00
parent 1c72dd501b
commit c5788536e1
6 changed files with 2 additions and 618 deletions

View File

@ -1,196 +0,0 @@
<template>
<div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile box is-child">
<div class="content">
<h1 class="activity-titles">{{ this.$i18n.get('info_logs_before') }}</h1>
<div
v-for="(diff, key) in activity.log_diffs"
v-if="diff.old"
:key="key">
<p/>
<div class="has-text-weight-bold is-capitalized">
{{ `${key.replace(/_/g, ' ')}:` }}
</div>
<div v-if="key === 'thumbnail'">
<div class="image is-128x128">
<img :src="diff.old">
</div>
</div>
<div
v-else-if="diff.old.constructor.name !== 'Array' && diff.old.constructor.name !== 'Object'"
class="is-inline">
{{ diff.old }}
</div>
<div
v-else
v-for="(o, ind) in diff.old"
:key="ind">
<div v-if="o.hasOwnProperty('mime_type') && o.mime_type.includes('image') && key === 'attachments'">
<article class="media">
<div class="media-left bottom-space-tainacan">
<p class="image is-64x64"><img :src="o.url"></p>
</div>
<div class="media-content">
<div class="content">
<p>
<strong class="is-capitalized">{{ o.title }}</strong> <small class="tag is-light">{{ o.mime_type }}</small>
<br>
{{ o.description }}
</p>
</div>
</div>
</article>
</div>
<div
v-else-if="key === 'metadata_order' || key === 'filters_order'"
class="is-capitalized">
{{ `ID: ${o.id} Enabled: ${o.enabled ? o.enabled : 'false'}` }}
</div>
<div
v-else-if="!(o instanceof Object)"
class="is-inline">
<div
v-if="ind.constructor.name === 'String'"
class="is-capitalized">
{{ `${ind.replace(/_/g, ' ')}: ${o} ` }}
</div>
<div v-else>
{{ `${ind}: ${o} ` }}
</div>
</div>
<div
v-else
v-for="(e, i2) in o"
:key="i2"
class="is-inline">
<div
v-if="i2.constructor.name === 'String'"
class="is-capitalized">
{{ `${i2.replace(/_/g, ' ')}: ${e} ` }}
</div>
<div v-else>
{{ `${i2}: ${e} ` }}
</div>
</div>
</div>
</div>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile box is-child">
<div class="content">
<h1 class="activity-titles">{{ this.$i18n.get('info_logs_after') }}</h1>
<div
v-for="(diff, key) in activity.log_diffs"
:key="key">
<p/>
<div
class="has-text-weight-bold is-capitalized"
:class="{ 'has-text-success': !diff.old, 'back-hlight': !diff.old }">
{{ `${key.replace(/_/g, ' ')}:` }}
</div>
<div v-if="key === 'thumbnail'">
<div class="image is-128x128">
<img :src="diff.new">
</div>
</div>
<div
v-else
v-for="(d, i) in diff.new"
:key="i"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
class="content is-inline" >
<div v-if="d.hasOwnProperty('mime_type') && d.mime_type.includes('image') && key === 'attachments'">
<article class="media">
<div class="media-left">
<p class="image is-64x64"><img :src="d.url"></p>
</div>
<div class="media-content">
<div class="content">
<p>
<strong class="is-capitalized">{{ d.title }}</strong> <small class="tag is-light">{{ d.mime_type }}</small>
<br>
{{ d.description }}
</p>
</div>
</div>
</article>
</div>
<div
v-else-if="key === 'metadata_order' || key === 'filters_order'"
class="is-capitalized"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `ID: ${d.id} Enabled: ${d.enabled ? d.enabled : 'false'}` }}
</div>
<div
class="is-inline"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
v-else-if="!(d instanceof Object)">{{ d }}
</div>
<div
v-else
v-for="(e, i2) in d"
:key="i2"
class="is-inline">
<div
v-if="i2.constructor.name === 'String'"
class="is-capitalized"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `${i2.replace(/_/g, ' ')}: ${e} ` }}
</div>
<div
v-else
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `${i2}: ${e} ` }}
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</template>
<script>
export default {
name: "ActivitySplit",
props: {
activity: Object
}
}
</script>
<style scoped>
.content {
overflow: auto;
}
.activity-titles {
font-size: 20px;
font-weight: 500;
color: #01295c;
display: inline-block;
}
</style>

View File

@ -1,194 +0,0 @@
<template>
<div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile box is-child">
<div class="content">
<h1 class="activity-titles">{{ this.$i18n.get('info_changes') }}</h1>
<div
v-for="(diff, key) in activity.log_diffs"
v-if="diff.old"
:key="key">
<p/>
<div class="has-text-weight-bold is-capitalized">
{{ `${key.replace(/_/g, ' ')}:` }}
</div>
<div v-if="key === 'thumbnail'">
<div class="image is-128x128">
<img :src="diff.old">
</div>
</div>
<div
v-else-if="diff.old.constructor.name !== 'Array' && diff.old.constructor.name !== 'Object'"
class="is-inline">
{{ diff.old }}
</div>
<div
v-else
v-for="(o, ind) in diff.old"
:key="ind">
<div v-if="o.hasOwnProperty('mime_type') && o.mime_type.includes('image') && key === 'attachments'">
<article class="media">
<div class="media-left bottom-space-tainacan">
<p class="image is-64x64"><img :src="o.url"></p>
</div>
<div class="media-content">
<div class="content">
<p>
<strong class="is-capitalized">{{ o.title }}</strong> <small class="tag is-light">{{ o.mime_type }}</small>
<br>
{{ o.description }}
</p>
</div>
</div>
</article>
</div>
<div
v-else-if="key === 'metadata_order' || key === 'filters_order'"
class="is-capitalized">
{{ `ID: ${o.id} Enabled: ${o.enabled ? o.enabled : 'false'}` }}
</div>
<div
v-else-if="!(o instanceof Object)"
class="is-inline">
<div
v-if="ind.constructor.name === 'String'"
class="is-capitalized">
{{ `${ind.replace(/_/g, ' ')}: ${o} ` }}
</div>
<div v-else>
{{ `${ind}: ${o} ` }}
</div>
</div>
<div
v-else
v-for="(e, i2) in o"
:key="i2"
class="is-inline">
<div
v-if="i2.constructor.name === 'String'"
class="is-capitalized">
{{ `${i2.replace(/_/g, ' ')}: ${e} ` }}
</div>
<div v-else>
{{ `${i2}: ${e} ` }}
</div>
</div>
</div>
</div>
<hr class="divider">
<div
v-for="(diff, key) in activity.log_diffs"
:key="key">
<p/>
<div
class="has-text-weight-bold is-capitalized"
:class="{ 'has-text-success': !diff.old, 'back-hlight': !diff.old }">
{{ `${key.replace(/_/g, ' ')}:` }}
</div>
<div v-if="key === 'thumbnail'">
<div class="image is-128x128">
<img :src="diff.new">
</div>
</div>
<div
v-else
v-for="(d, i) in diff.new"
:key="i"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
class="content is-inline" >
<div v-if="d.hasOwnProperty('mime_type') && d.mime_type.includes('image') && key === 'attachments'">
<article class="media">
<div class="media-left">
<p class="image is-64x64"><img :src="d.url"></p>
</div>
<div class="media-content">
<div class="content">
<p>
<strong class="is-capitalized">{{ d.title }}</strong> <small class="tag is-light">{{ d.mime_type }}</small>
<br>
{{ d.description }}
</p>
</div>
</div>
</article>
</div>
<div
v-else-if="key === 'metadata_order' || key === 'filters_order'"
class="is-capitalized"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `ID: ${d.id} Enabled: ${d.enabled ? d.enabled : 'false'}` }}
</div>
<div
class="is-inline"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
v-else-if="!(d instanceof Object)">{{ d }}
</div>
<div
v-else
v-for="(e, i2) in d"
:key="i2"
class="is-inline">
<div
v-if="i2.constructor.name === 'String'"
class="is-capitalized"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `${i2.replace(/_/g, ' ')}: ${e} ` }}
</div>
<div
v-else
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `${i2}: ${e} ` }}
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</template>
<script>
export default {
name: "ActivityUnified",
props: {
activity: Object
}
}
</script>
<style scoped>
.content {
overflow: auto;
}
.activity-titles {
font-size: 20px;
font-weight: 500;
color: #01295c;
display: inline-block;
}
</style>

View File

@ -1,92 +0,0 @@
<template>
<div>
<div
class="tile is-ancestor"
v-if="activity.log_diffs.constructor === Object &&
Object.keys(activity.log_diffs).length > 0 ||
activity.log_diffs.length > 0">
<div class="tile is-parent">
<article class="tile box is-child">
<div class="content">
<div
v-for="(diff, key) in activity.log_diffs"
:key="key">
<p/>
<div class="has-text-weight-bold is-capitalized">
{{ `${key.replace('_', ' ')}:` }}
</div>
<div v-if="key === 'thumbnail'">
<div class="image is-128x128">
<img :src="diff.new">
</div>
</div>
<div
v-else
v-for="(d, i) in diff.new"
:key="i"
class="content is-inline" >
<div v-if="d.hasOwnProperty('mime_type') && d.mime_type.includes('image') && key === 'attachments'">
<article class="media">
<div class="media-left">
<p class="image is-64x64"><img :src="d.url"></p>
</div>
<div class="media-content">
<div class="content">
<p>
<strong class="is-capitalized">{{ d.title }}</strong> <small class="tag is-light">{{ d.mime_type }}</small>
<br>
{{ d.description }}
</p>
</div>
</div>
</article>
</div>
<div
v-else-if="key === 'metadata_order' || key === 'filters_order'"
class="is-capitalized">
{{ `ID: ${d.id} Enabled: ${d.enabled}` }}
</div>
<div
class="is-inline"
v-else-if="!Array.isArray(d) && d.constructor.name !== 'Object' ">{{ d }}
</div>
<div
v-else
v-for="(e, i2) in d"
:key="i2"
class="is-inline">
<div class="is-capitalized">
{{ `${i2.replace('_', ' ')}: ${e} ` }}
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</template>
<script>
export default {
name: "ActivityNoDiff",
props: {
activity: Object
}
}
</script>
<style scoped>
</style>

View File

@ -12,7 +12,6 @@ import MetadataPage from '../pages/lists/metadata-page.vue'
import FiltersPage from '../pages/lists/filters-page.vue'
import Page from '../pages/lists/taxonomies-page.vue'
import ActivitiesPage from '../pages/lists/activities-page.vue'
import ActivityPage from '../pages/singles/activity-page.vue'
import AvailableExportersPage from '../pages/lists/available-exporters-page.vue'
import AvailableImportersPage from '../pages/lists/available-importers-page.vue'
import ExportPage from '../pages/singles/export-page.vue'
@ -59,7 +58,6 @@ const routes = [
{ path: 'metadata', component: MetadataList, name: 'MetadataList', meta: {title: i18nGet('title_collection_metadata_edition'), icon: 'folder-multiple'} },
{ path: 'filters', component: FiltersList, name: 'FiltersList', meta: {title: i18nGet('title_collection_filters_edition'), icon: 'folder-multiple'} },
{ path: 'activities', component: ActivitiesPage, name: 'CollectionActivitiesPage', meta: {title: i18nGet('title_collection_activities'), icon: 'flash'} },
{ path: 'activities/:activityId', name: 'CollectionActivityPage', component: ActivityPage, meta: {title: i18nGet('title_activity_page'), icon: 'flash'} },
{ path: 'sequence/:sequenceId', name: 'SavedSequenceEditionForm', component: ItemEditionForm, meta: {title: i18nGet('title_edit_item'), icon: 'folder-multiple'} },
{ path: 'sequence/:sequenceId/:itemPosition', name: 'SequenceEditionForm', component: ItemEditionForm, meta: {title: i18nGet('title_edit_item'), icon: 'folder-multiple'} },
]
@ -78,7 +76,6 @@ const routes = [
{ path: '/taxonomies/:taxonomyId', redirect: '/taxonomies/:taxonomyId/edit' },
{ path: '/activities', name: 'ActivitiesPage', component: ActivitiesPage, meta: {title: i18nGet('title_repository_activities_page'), icon: 'flash'} },
{ path: '/activities/:activityId', name: 'ActivityPage', component: ActivityPage, meta: {title: i18nGet('title_activity_page'), icon: 'flash'} },
{ path: '/importers/', name: 'AvailableImportersPage', component: AvailableImportersPage, meta: {title: i18nGet('title_importers_page'), icon: 'import'} },
{ path: '/importers/:importerSlug', name: 'ImporterEditionForm', component: ImporterEditionForm, meta: {title: i18nGet('title_importer_page'), icon: 'import'} },

View File

@ -26,6 +26,7 @@
:is-full-page="false"
:active.sync="isLoading"
:can-cancel="false"/>
<activities-list
v-if="tab != 'processes'"
:is-loading="isLoading"
@ -33,6 +34,7 @@
:page="activitiesPage"
:activities-per-page="activitiesPerPage"
:activities="activities"/>
<processes-list
v-if="tab == 'processes'"
:is-loading="isLoading"

View File

@ -1,133 +0,0 @@
<template>
<div>
<div class="is-fullheight">
<div
class="page-container"
:class="{ 'repository-level-page': $route.params.collectionId == undefined }">
<tainacan-title
:bread-crumb-items="[
{ path: $routerHelper.getActivitiesPath(), label: $i18n.get('activities') },
{ path: '', label: (activity != undefined && activity.title != undefined) ? activity.title : $i18n.get('activity') }
]"/>
<h1 class="activity-titles">{{ activity.description }}</h1>
<div
class="level"
v-if="activity.title !== undefined && activity.title.includes('updated')">
<div class="level-left"/>
<div class="level-right">
<div class="level-item">
<div class="field has-addons is-pulled-right">
<p class="control">
<a
@click="comp = 'Split'"
:class="{'is-selected': comp === 'Split', 'is-focused': comp === 'Split'}"
class="button">
<span class="icon is-small">
<i class="tainacan-icon tainacan-icon-pause" />
</span>
<span>{{ $i18n.get('split') }}</span>
</a>
</p>
<p class="control">
<a
@click="comp = 'Unified'"
:class="{'is-selected': comp === 'Unified', 'is-focused': comp === 'Unified'}"
class="button">
<span class="icon is-small">
-
</span>
<span>{{ $i18n.get('unified') }}</span>
</a>
</p>
</div>
</div>
</div>
</div>
<hr class="divider">
<div v-if="activity.title !== undefined && activity.title.includes('updated')">
<component
:is="comp"
:activity="activity"/>
</div>
<div v-else-if="activity.title !== undefined">
<no-diff :activity="activity"/>
</div>
</div>
</div>
</div>
</template>
<script>
import {mapActions, mapGetters} from 'vuex';
import Split from '../../components/other/activity/diff-exhibition/activity-split.vue';
import Unified from '../../components/other/activity/diff-exhibition/activity-unified.vue';
import NoDiff from '../../components/other/activity/unique-exhibition/activity-nodiff.vue';
import TainacanTitle from '../../components/navigation/tainacan-title.vue';
export default {
name: 'ActivityPage',
data() {
return {
activityId: Number,
comp: 'Split',
}
},
methods: {
...mapActions('activity', [
'fetchActivity'
]),
...mapGetters('activity', [
'getActivity'
])
},
computed: {
activity() {
return this.getActivity();
}
},
components: {
Split,
Unified,
NoDiff,
TainacanTitle,
},
created() {
this.activityId = parseInt(this.$route.params.activityId);
this.fetchActivity(this.activityId).then(() => {
if (this.$route.params.collectionId != undefined)
this.$root.$emit('onCollectionBreadCrumbUpdate', [
{ path: this.$routerHelper.getCollectionActivitiesPath(this.$route.params.collectionId), label: this.$i18n.get('activities') },
{ path: '', label: this.activity.title}
]);
});
}
}
</script>
<style>
.activity-titles {
font-size: 20px;
font-weight: 500;
color: #01295c;
display: inline-block;
}
.field.has-addons .control:first-child .button {
border-bottom-right-radius: 0 !important;
border-top-right-radius: 0 !important;
}
.field.has-addons .control:last-child .button {
border-bottom-left-radius: 0 !important;
border-top-left-radius: 0 !important;
}
</style>