Merge branch 'main' into fix-336

This commit is contained in:
Nitwel
2020-10-09 14:08:09 +02:00
25 changed files with 25755 additions and 125 deletions

View File

@@ -153,6 +153,16 @@ export default defineComponent({
font-size: 14px;
}
.heading-link {
color: var(--foreground-subdued);
font-size: 16px;
&:hover {
color: var(--primary);
text-decoration: none;
}
}
pre {
padding: 16px 20px;
overflow: auto;

View File

@@ -15,6 +15,12 @@
<div class="docs-content selectable">
<markdown>{{ markdownWithoutTitle }}</markdown>
</div>
<template #drawer>
<drawer-detail icon="info_outline" :title="$t('information')" close>
<div class="page-description" v-html="marked($t('page_help_docs_global'))" />
</drawer-detail>
</template>
</private-view>
</template>
@@ -22,6 +28,7 @@
import { defineComponent, ref, computed, inject, onUpdated } from '@vue/composition-api';
import DocsNavigation from '../components/navigation.vue';
import Markdown from '../components/markdown.vue';
import marked from 'marked';
async function getMarkdownForPath(path: string) {
const pathParts = path.split('/');
@@ -59,7 +66,7 @@ export default defineComponent({
},
setup() {
const markdown = ref('');
const view = ref<Vue | null>(null);
const view = ref<Vue>();
const title = computed(() => {
const firstLine = markdown.value.split('\n').shift();
@@ -73,11 +80,10 @@ export default defineComponent({
});
onUpdated(() => {
if(view.value === null) return
view.value.$data.contentEl?.scrollTo({ top: 0 });
view.value?.$data.contentEl?.scrollTo({ top: 0 });
});
return { markdown, title, markdownWithoutTitle, view };
return { markdown, title, markdownWithoutTitle, view, marked };
},
});
</script>

View File

@@ -291,21 +291,21 @@ export default defineComponent({
}
await Promise.all(
state.newCollections.map((newCollection: Partial<Collection> & { $type: string }) => {
state.newCollections.map((newCollection: Partial<Collection> & { $type?: string }) => {
delete newCollection.$type;
return api.post(`/collections`, newCollection);
})
);
await Promise.all(
state.newFields.map((newField: Partial<Field> & { $type: string }) => {
state.newFields.map((newField: Partial<Field> & { $type?: string }) => {
delete newField.$type;
return api.post(`/fields/${newField.collection}`, newField);
})
);
await Promise.all(
state.updateFields.map((updateField: Partial<Field> & { $type: string }) => {
state.updateFields.map((updateField: Partial<Field> & { $type?: string }) => {
delete updateField.$type;
return api.post(`/fields/${updateField.collection}/${updateField.field}`, updateField);
})

View File

@@ -298,7 +298,7 @@ export default defineComponent({
};
async function saveDuplicate() {
const newField = {
const newField: any = {
...props.field,
field: duplicateName.value,
collection: duplicateTo.value,