Commit 3596ab87 authored by dindigala's avatar dindigala
Browse files

chore: merge branch 'develop' into feature/#272-annotation-motifs

parents f64e38a9 f722a025
......@@ -12,7 +12,7 @@ curl --output old-artifact.zip --header "PRIVATE-TOKEN: $API_TOKEN" "https://git
# add current data to artifact
unzip -u old-artifact.zip
if [[ $CONTINUE_BUILD == "true" ]]; then
if [[ $CONTINUE_BUILD == "true" || ($CI_COMMIT_BRANCH != "main" && $CI_COMMIT_BRANCH != "develop") ]]; then
mkdir -p public/{${CI_COMMIT_SHORT_SHA},${CI_COMMIT_REF_SLUG}}
echo public/${CI_COMMIT_SHORT_SHA} public/${CI_COMMIT_REF_SLUG} | xargs -n 1 cp --remove-destination --recursive ${dist_dir}/*
......
......@@ -16,65 +16,24 @@
@click="activeTab(annotationTab.key)"
/>
</q-tabs>
<div
v-if="currentAnnotation.length"
class="q-ma-sm"
>
<q-list>
<q-item
v-for="annotation in currentAnnotation"
:id="'list' + annotation.strippedId"
:key="annotation.strippedId"
clickable
padding="xs"
class="q-pa-sm q-pl-xs q-mb-xs"
@click="toggle(annotation); statusCheck();"
>
<q-item-section
avatar
class="q-mr-none"
>
<q-icon
:name="getIcon(annotation.body['x-content-type'])"
size="16px"
/>
</q-item-section>
<q-item-section>
<AnnotationUrls :content="annotation.body.value" />
</q-item-section>
</q-item>
</q-list>
<q-page-sticky
position="bottom-right"
:offset="[18, 18]"
>
<q-fab
color="primary"
direction="up"
vertical-actions-align="right"
:icon="icons.fasCog"
:active-icon="icons.fasChevronDown"
>
<q-fab-action
color="primary"
label="Highlight All Annotations in Text Panel"
label-position="left"
:disable="selectedAll"
:icon="icons.fasEye"
@click="toggleTo(true)"
/>
<q-fab-action
color="primary"
label="Remove All Highlights in Text Panel"
label-position="left"
:disable="selectedNone"
:icon="icons.fasEyeSlash"
@click="toggleTo(false)"
/>
</q-fab>
</q-page-sticky>
<AnnotationToggles />
<AnnotationList
:hot-annotations="currentAnnotation"
:get-icon="getIcon"
:status-check="statusCheck"
:toggle="toggle"
/>
<AnnotationOptions
:selected-all="selectedAll"
:selected-none="selectedNone"
:toggle-to="toggleTo"
/>
</div>
<div
......@@ -88,13 +47,19 @@
<script>
import * as Icons from '@quasar/extras/fontawesome-v5';
import AnnotationUrls from '@/components/urls.vue';
import AnnotationToggles from '@/components/annotations/toggles.vue';
import AnnotationList from '@/components/annotations/list.vue';
import AnnotationOptions from '@/components/annotations/options.vue';
import Notification from '@/components/notification.vue';
export default {
name: 'Annotations',
components: {
AnnotationUrls,
AnnotationToggles,
AnnotationList,
AnnotationOptions,
Notification,
},
props: {
......@@ -113,11 +78,11 @@ export default {
},
data() {
return {
hotAnnotations: [],
ids: [],
messages: {
none: 'noAnnotationMessage',
},
ids: [],
hotAnnotations: [],
selectedAll: undefined,
selectedNone: undefined,
currentTab: 'editorial',
......@@ -147,9 +112,6 @@ export default {
];
},
},
created() {
this.icons = Icons;
},
mounted() {
this.$root.$on('update-annotations', (content) => {
const parser = new DOMParser();
......@@ -176,7 +138,7 @@ export default {
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('aria-hidden', 'true');
svg.setAttribute('class', 'q-icon q-ml-xs');
svg.setAttribute('class', 'q-icon q-mx-xs');
svg.setAttribute('focusable', 'false');
svg.setAttribute('role', 'presentation');
svg.setAttribute('viewBox', viewBox);
......@@ -196,16 +158,16 @@ export default {
*/
filterAnnotationTypes() {
return this.annotations.filter((annotation) => {
annotation.strippedId = this.stripAnnotationId(annotation.target.id);
const targetId = annotation.strippedId;
const annotationIds = this.ids.includes(targetId);
this.$set(annotation, 'status', this.config.annotations.show);
annotation.strippedId = this.stripAnnotationId(annotation.target.id);
const annotationIds = this.ids.includes(annotation.strippedId);
if (this.configuredTypes.find((type) => type === annotation.body['x-content-type']) && annotationIds) {
this.setText(annotation);
return true;
}
return false;
});
},
......@@ -241,6 +203,7 @@ export default {
statusCheck() {
const num = this.hotAnnotations.length;
const active = this.hotAnnotations.filter((annotation) => annotation.status === true).length;
if (num === active) {
this.selectedAll = false;
this.selectedNone = true;
......@@ -264,8 +227,10 @@ export default {
},
toggle(annotation) {
const id = annotation.strippedId;
annotation.status = !annotation.status;
const id = annotation.strippedId;
document.getElementById(id).classList.toggle('annotation-disabled');
document.getElementById(`list${id}`).classList.toggle('bg-grey-2');
},
......
<template>
<q-list>
<q-item
v-for="annotation in hotAnnotations"
:id="'list' + annotation.strippedId"
:key="annotation.strippedId"
class="q-pa-sm q-pl-xs q-mb-xs"
clickable
padding="xs"
@click="toggle(annotation); statusCheck();"
>
<q-item-section
avatar
class="q-mr-none"
>
<q-icon
:name="getIcon(annotation.body['x-content-type'])"
size="16px"
/>
</q-item-section>
<q-item-section>
<AnnotationUrls :content="annotation.body.value" />
</q-item-section>
</q-item>
</q-list>
</template>
<script>
import AnnotationUrls from '@/components/urls.vue';
export default {
name: 'AnnotationList',
components: {
AnnotationUrls,
},
props: {
getIcon: {
type: Function,
default: () => null,
},
hotAnnotations: {
type: Array,
default: () => [],
},
toggle: {
type: Function,
default: () => null,
},
statusCheck: {
type: Function,
default: () => null,
},
},
};
</script>
<template>
<q-page-sticky
:offset="[18, 18]"
position="bottom-right"
>
<q-fab
color="primary"
direction="up"
vertical-actions-align="right"
:active-icon="fasChevronDown"
:icon="fasCog"
>
<q-fab-action
color="primary"
label="Highlight All Annotations in Text Panel"
label-position="left"
:disable="selectedAll"
:icon="fasEye"
@click="toggleTo(true)"
/>
<q-fab-action
color="primary"
label="Remove All Highlights in Text Panel"
label-position="left"
:disable="selectedNone"
:icon="fasEyeSlash"
@click="toggleTo(false)"
/>
</q-fab>
</q-page-sticky>
</template>
<script>
import {
fasChevronDown,
fasCog,
fasEye,
fasEyeSlash,
} from '@quasar/extras/fontawesome-v5';
export default {
name: 'AnnotationOptions',
props: {
selectedAll: {
type: Boolean,
},
selectedNone: {
type: Boolean,
},
toggleTo: {
type: Function,
default: () => null,
},
},
created() {
this.fasChevronDown = fasChevronDown;
this.fasCog = fasCog;
this.fasEye = fasEye;
this.fasEyeSlash = fasEyeSlash;
},
};
</script>
<template>
<div />
</template>
<script>
export default {
name: 'AnnotationToggles',
props: {
},
created() {
},
};
</script>
import Annotations from '@/components/annotations.vue';
import Annotations from '@/components/annotations/annotations.vue';
import Content from '@/components/content.vue';
import Metadata from '@/components/metadata.vue';
import OpenSeadragon from '@/components/openseadragon.vue';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment