Skip to content

Commit

Permalink
Merge pull request #614 from nextcloud/forwardport_PRs_notPorted
Browse files Browse the repository at this point in the history
Forwardport p rs not ported
  • Loading branch information
individual-it committed Apr 4, 2024
2 parents 6376d29 + de232e6 commit eac6693
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ On the OpenProject end, users are able to:
For more information on how to set up and use the OpenProject application, please refer to [integration setup guide](https://www.openproject.org/docs/system-admin-guide/integrations/nextcloud/) for administrators and [the user guide](https://www.openproject.org/docs/user-guide/nextcloud-integration/).
]]></description>
<version>2.6.1</version>
<version>2.6.2</version>
<licence>agpl</licence>
<author>Julien Veyssier</author>
<namespace>OpenProject</namespace>
Expand Down
5 changes: 2 additions & 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 @@ -583,7 +583,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 Expand Up @@ -634,7 +633,7 @@ export default {
const htmlLink = `<a class="link" href="${url}" target="_blank" title="${linkText}">${linkText}</a>`
switch (errorKey) {
case 'The "Group folders" app is not installed' :
return t('integration_openproject', 'Please install the "Group folders" app to be able to use automatically managed folders, {htmlLink}', { htmlLink }, null, { escape: false, sanitize: false })
return t('integration_openproject', 'Please install the "Group folders" app to be able to use automatically managed folders. {htmlLink}', { htmlLink }, null, { escape: false, sanitize: false })
default:
return this.errorHintForProjectFolderConfigAlreadyExists
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PersonalSettings.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="openproject-prefs section">
<SettingsTitle :is-connected-with-openproject="!!connected" is-setting="personal" />
<SettingsTitle is-setting="personal" />
<div v-if="connected" class="openproject-prefs--connected">
<label>
<CheckIcon :size="20" />
Expand Down
17 changes: 5 additions & 12 deletions src/components/settings/SettingsTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ export default {
type: String,
required: true,
},
isConnectedWithOpenproject: {
type: Boolean,
required: false,
},
showIntegrationSetupLinkInformation: {
type: Boolean,
required: false,
},
},
computed: {
title() {
Expand All @@ -42,14 +34,14 @@ 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) {
} else if (this.isSetting === 'personal') {
return dompurify.sanitize(this.getUserGuideDocumentationLinkText, { ADD_ATTR: ['target'] })
}
return ''
Expand Down Expand Up @@ -80,6 +72,7 @@ export default {
.settings .link {
color: #1a67a3 !important;
font-style: normal;
}
</style>
5 changes: 2 additions & 3 deletions src/components/tab/SearchInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div v-if="!!isStateOk && !isSmartPicker" class="create-workpackage">
<NcButton class="create-workpackage--button" @click="openCreateWorkpackageModal()">
<template #icon>
<Plus class="plus" :size="26" />
<Plus :size="20" />
</template>
{{ t('integration_openproject', 'Create and link a new work package') }}
</NcButton>
Expand Down Expand Up @@ -132,7 +132,7 @@ export default {
return t('integration_openproject', 'Start typing to search')
case NO_OPTION_TEXT_STATE.RESULT :
if (this.searchResults.length === 0) {
return t('integration_openproject', 'There were no workpackages found')
return t('integration_openproject', 'No matching work packages found')
}
break
}
Expand Down Expand Up @@ -358,7 +358,6 @@ export default {
display: flex;
align-items: center;
&--button {
border: 1px solid var(--color-border-dark);
&--label {
padding-left: 15px;
font-size: 1rem;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const WORKPACKAGES_SEARCH_ORIGIN = {
LINK_MULTIPLE_FILES_MODAL: 'link-multiple-files-modal',
}
export const USER_SETTINGS = {
NAVIGATION_LINK_DESCRIPTION: t('integration_openproject', 'This check will show "OpenProject Icon" in the navigation bar to navigate directly to OpenProject instance.'),
UNIFIED_SEARCH_DESCRIPTION: t('integration_openproject', 'This check will allow to unified or global search for the OpenProject tickets from the Nextcloud.'),
NAVIGATION_LINK_DESCRIPTION: t('integration_openproject', 'Displays a link to your OpenProject instance in the Nextcloud header.'),
UNIFIED_SEARCH_DESCRIPTION: t('integration_openproject', 'Allows you to search OpenProject work packages via the universal search bar in Nextcloud.'),
}

export const NO_OPTION_TEXT_STATE = {
Expand Down
8 changes: 4 additions & 4 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 Expand Up @@ -1040,7 +1040,7 @@ describe('AdminSettings.vue', () => {
'should set the project folder error message and error details when group folders app is not enabled',
{
error: 'The "Group folders" app is not installed',
expectedErrorDetailsMessage: 'Please install the "Group folders" app to be able to use automatically managed folders, {htmlLink}',
expectedErrorDetailsMessage: 'Please install the "Group folders" app to be able to use automatically managed folders. {htmlLink}',
},
],
[
Expand Down Expand Up @@ -1493,7 +1493,7 @@ describe('AdminSettings.vue', () => {
'should set the project folder error message and error details when group folders app is not enabled',
{
error: 'The "Group folders" app is not installed',
expectedErrorDetailsMessage: 'Please install the "Group folders" app to be able to use automatically managed folders, {htmlLink}',
expectedErrorDetailsMessage: 'Please install the "Group folders" app to be able to use automatically managed folders. {htmlLink}',
},
],
[
Expand Down
6 changes: 3 additions & 3 deletions tests/jest/components/PersonalSettings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ describe('PersonalSettings.vue', () => {
it('oAuth disconnect button is not displayed', () => {
expect(wrapper.find(oAuthDisconnectButtonSelector).exists()).toBeFalsy()
})
it('should show not show user guide documentation link', () => {
it('should show show user guide documentation link', () => {
const wrapper = getMountedWrapper({ state: { admin_config_ok: true, cases } })
const userGuideIntegrationDocumentationLink = wrapper.find(userGuideIntegrationDocumentationLinkSelector)
expect(userGuideIntegrationDocumentationLink.text()).toBe('')
expect(userGuideIntegrationDocumentationLink.text()).toBe('Learn how to get the most out of the OpenProject integration by visiting our {htmlLink}.')
})
})
describe('when username and token are given', () => {
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ exports[`AdminSettings.vue default user configurations form should be visible wh
<div class="form-check-input"><input id="default-prefs--link" type="checkbox" class="checkbox" value="false"> <label for="default-prefs--link">
Enable navigation link
</label>
<p class="user-setting-description">This check will show "OpenProject Icon" in the navigation bar to navigate directly to OpenProject instance.</p>
<p class="user-setting-description">Displays a link to your OpenProject instance in the Nextcloud header.</p>
</div>
<div class="form-check-input"><input id="default-prefs--u-search" type="checkbox" class="checkbox" value="false"> <label for="default-prefs--u-search">
Enable unified search for tickets
</label>
<p class="user-setting-description">This check will allow to unified or global search for the OpenProject tickets from the Nextcloud.</p>
<p class="user-setting-description">Allows you to search OpenProject work packages via the universal search bar in Nextcloud.</p>
</div>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ exports[`PersonalSettings.vue oAuth user settings admin and user should be able
<div class="form-check-input"><input id="openproject-prefs--link" type="checkbox" class="checkbox" value="true"> <label for="openproject-prefs--link">
Enable navigation link
</label>
<p class="user-setting-description">This check will show "OpenProject Icon" in the navigation bar to navigate directly to OpenProject instance.</p>
<p class="user-setting-description">Displays a link to your OpenProject instance in the Nextcloud header.</p>
</div>
<div class="form-check-input"><input id="openproject-prefs--u-search" type="checkbox" class="checkbox" value="true"> <label for="openproject-prefs--u-search">
Enable unified search for tickets
</label>
<p class="user-setting-description">This check will allow to unified or global search for the OpenProject tickets from the Nextcloud.</p>
<p class="user-setting-description">Allows you to search OpenProject work packages via the universal search bar in Nextcloud.</p>
<p class="openproject-prefs--hint"><span aria-hidden="true" role="img" class="material-design-icon information-variant-icon"><svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" class="material-design-icon__svg"><path d="M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z"><!----></path></svg></span>
Warning, everything you type in the search bar will be sent to your OpenProject instance.
</p>
Expand All @@ -23,12 +23,12 @@ exports[`PersonalSettings.vue oAuth user settings admin and user should be able
<div class="form-check-input"><input id="openproject-prefs--link" type="checkbox" class="checkbox" value="false"> <label for="openproject-prefs--link">
Enable navigation link
</label>
<p class="user-setting-description">This check will show "OpenProject Icon" in the navigation bar to navigate directly to OpenProject instance.</p>
<p class="user-setting-description">Displays a link to your OpenProject instance in the Nextcloud header.</p>
</div>
<div class="form-check-input"><input id="openproject-prefs--u-search" type="checkbox" class="checkbox" value="true"> <label for="openproject-prefs--u-search">
Enable unified search for tickets
</label>
<p class="user-setting-description">This check will allow to unified or global search for the OpenProject tickets from the Nextcloud.</p>
<p class="user-setting-description">Allows you to search OpenProject work packages via the universal search bar in Nextcloud.</p>
<p class="openproject-prefs--hint"><span aria-hidden="true" role="img" class="material-design-icon information-variant-icon"><svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" class="material-design-icon__svg"><path d="M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z"><!----></path></svg></span>
Warning, everything you type in the search bar will be sent to your OpenProject instance.
</p>
Expand Down
2 changes: 1 addition & 1 deletion tests/jest/components/tab/SearchInput.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ describe('SearchInput.vue', () => {
'should set no option text to "There were no workpackages found" for search query not matched',
{
searchQuery: 'query-not-matched',
expectedNoOptionText: 'There were no workpackages found',
expectedNoOptionText: 'No matching work packages found',
},
],
])('%s', async (name, expectedDetails) => {
Expand Down

0 comments on commit eac6693

Please sign in to comment.