Skip to content

Commit

Permalink
Adjust the documentation link according to review
Browse files Browse the repository at this point in the history
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
  • Loading branch information
SagarGi committed Mar 25, 2024
1 parent d9a7f71 commit 57c41ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="openproject_prefs" class="section">
<TermsOfServiceUnsigned :is-all-terms-of-service-signed-for-user-open-project="isAllTermsOfServiceSignedForUserOpenProject" />
<SettingsTitle :show-integration-setup-link-information="showIntegrationSetupLinkInformation" is-setting="admin" />
<SettingsTitle is-setting="admin" />
<div class="openproject-server-host">
<FormHeading index="1"
:title="t('integration_openproject', 'OpenProject server')"
Expand Down Expand Up @@ -434,7 +434,6 @@ export default {
isFormStep: null,
isDarkTheme: null,
isAllTermsOfServiceSignedForUserOpenProject: true,
showIntegrationSetupLinkInformation: true,
userSettingDescription: USER_SETTINGS,
}
},
Expand Down Expand Up @@ -583,7 +582,6 @@ export default {
}
if (this.state.openproject_instance_url && this.state.openproject_client_id && this.state.openproject_client_secret && this.state.nc_oauth_client) {
this.showDefaultManagedProjectFolders = true
this.showIntegrationSetupLinkInformation = false
}
if (this.state.openproject_instance_url) {
this.formMode.server = F_MODES.VIEW
Expand Down
11 changes: 4 additions & 7 deletions src/components/settings/SettingsTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export default {
type: Boolean,
required: false,
},
showIntegrationSetupLinkInformation: {
type: Boolean,
required: false,
},
},
computed: {
title() {
Expand All @@ -42,12 +38,12 @@ export default {
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', 'Nextcloud integration user guide')
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', 'Please go to our {htmlLink} to learn more about how to work with the OpenProject integration.', { htmlLink }, null, { escape: false, sanitize: false })
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' && this.showIntegrationSetupLinkInformation) {
if (this.isSetting === 'admin') {
return dompurify.sanitize(this.getSetUpIntegrationDocumentationLinkText, { ADD_ATTR: ['target'] })
} else if (this.isSetting === 'personal' && this.isConnectedWithOpenproject) {
return dompurify.sanitize(this.getUserGuideDocumentationLinkText, { ADD_ATTR: ['target'] })
Expand Down Expand Up @@ -80,6 +76,7 @@ export default {
.settings .link {
color: #1a67a3 !important;
font-style: normal;
}
</style>
4 changes: 2 additions & 2 deletions tests/jest/components/AdminSettings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ describe('AdminSettings.vue', () => {
expect(setupIntegrationDocumentationLink.text()).toBe('Visit our documentation for in-depth information on {htmlLink} integration.')
})

it('should not be visible when integration is completed', () => {
it('should be visible when integration is completed', () => {
const wrapper = getMountedWrapper({ state: completeIntegrationState })
const setupIntegrationDocumentationLink = wrapper.find(selectors.setupIntegrationDocumentationLinkSelector)
expect(setupIntegrationDocumentationLink.text()).toBe('')
expect(setupIntegrationDocumentationLink.text()).toBe('Visit our documentation for in-depth information on {htmlLink} integration.')
})
})

Expand Down
2 changes: 1 addition & 1 deletion tests/jest/components/PersonalSettings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('PersonalSettings.vue', () => {
it('should show not show user guide documentation link', () => {
const wrapper = getMountedWrapper({ state: { user_name: 'test', token: '123', admin_config_ok: true } })
const userGuideIntegrationDocumentationLink = wrapper.find(userGuideIntegrationDocumentationLinkSelector)
expect(userGuideIntegrationDocumentationLink.text()).toBe('Please go to our {htmlLink} to learn more about how to work with the OpenProject integration.')
expect(userGuideIntegrationDocumentationLink.text()).toBe('Learn how to get the most out of the OpenProject integration by visiting our {htmlLink}.')
})
})

Expand Down

0 comments on commit 57c41ee

Please sign in to comment.