-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathSettingsTitle.vue
81 lines (75 loc) · 2.31 KB
/
SettingsTitle.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
<div class="settings">
<h2 class="settings--title">
<OpenProjectIcon />
<span>{{ title }}</span>
</h2>
<p class="settings--documentation-info" v-html="sanitizedHintText" /> <!-- eslint-disable-line vue/no-v-html -->
</div>
</template>
<script>
import { translate as t } from '@nextcloud/l10n'
import OpenProjectIcon from '../icons/OpenProjectIcon.vue'
import dompurify from 'dompurify'
export default {
name: 'SettingsTitle',
components: {
OpenProjectIcon,
},
props: {
isSetting: {
type: String,
required: true,
},
},
computed: {
title() {
return t('integration_openproject', 'OpenProject Integration')
},
getSetUpIntegrationDocumentationLinkText() {
const linkText = t('integration_openproject', 'setting up a Nextcloud file storage')
const htmlLink = `<a class="link" href="https://www.openproject.org/docs/system-admin-guide/integrations/nextcloud/" target="_blank" title="${linkText}">${linkText}</a>`
return t('integration_openproject', 'Visit our documentation for in-depth information on {htmlLink} integration.', { htmlLink }, null, { escape: false, sanitize: false })
},
getUserGuideDocumentationLinkText() {
const linkText = t('integration_openproject', 'user guide')
const htmlLink = `<a class="link" href="https://www.openproject.org/docs/user-guide/file-management/nextcloud-integration/" target="_blank" title="${linkText}">${linkText}</a>`
return t('integration_openproject', 'Learn how to get the most out of the OpenProject integration by visiting our {htmlLink}.', { htmlLink }, null, { escape: false, sanitize: false })
},
sanitizedHintText() {
if (this.isSetting === 'admin') {
return dompurify.sanitize(this.getSetUpIntegrationDocumentationLinkText, { ADD_ATTR: ['target'] })
} else if (this.isSetting === 'personal') {
return dompurify.sanitize(this.getUserGuideDocumentationLinkText, { ADD_ATTR: ['target'] })
}
return ''
},
},
methods: {
},
}
</script>
<style lang="scss">
@import '../../../css/dashboard.css';
.settings {
&--title {
display: flex;
align-items: center;
.icon-openproject {
min-height: 32px;
min-width: 32px;
background-size: cover;
}
span {
padding-left: 10px;
}
}
&--documentation-info {
font-size: 1rem;
}
}
.settings .link {
color: #1a67a3 !important;
font-style: normal;
}
</style>