Skip to content

Commit f729065

Browse files
committed
feat(workflowengine): add warning when context_chat and files_accesscontrol are enabled
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent f4cb78b commit f729065

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

apps/workflowengine/lib/Settings/ASettings.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use OCA\WorkflowEngine\AppInfo\Application;
1212
use OCA\WorkflowEngine\Manager;
13+
use OCP\App\IAppManager;
1314
use OCP\AppFramework\Http\TemplateResponse;
1415
use OCP\AppFramework\Services\IInitialState;
1516
use OCP\EventDispatcher\IEventDispatcher;
@@ -34,6 +35,7 @@ public function __construct(
3435
private IInitialState $initialStateService,
3536
private IConfig $config,
3637
private IURLGenerator $urlGenerator,
38+
private IAppManager $appManager,
3739
) {
3840
}
3941

@@ -83,6 +85,11 @@ public function getForm(): TemplateResponse {
8385
$this->urlGenerator->linkToDocs('admin-workflowengine')
8486
);
8587

88+
$this->initialStateService->provideInitialState(
89+
'context-chat-files_acesscontrol',
90+
$this->appManager->isEnabledForAnyone('context_chat') && $this->appManager->isEnabledForAnyone('files_accesscontrol')
91+
);
92+
8693
return new TemplateResponse(Application::APP_ID, 'settings', [], 'blank');
8794
}
8895

apps/workflowengine/src/components/Workflow.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
-->
55
<template>
66
<div id="workflowengine">
7+
<NcNoteCard v-if="contextChatPlusFilesAccessControl"
8+
type="warning">
9+
{{ t('workflowengine', 'The "Context chat" and "File access control" apps are enabled. Keep in mind that Context Chat is not affected by the File access control rules and will index files which access is denied by a rule.') }}
10+
</NcNoteCard>
711
<NcSettingsSection :name="t('workflowengine', 'Available flows')"
812
:doc-url="workflowDocUrl">
913
<p v-if="isAdminScope" class="settings-hint">
@@ -69,6 +73,7 @@ import NcButton from '@nextcloud/vue/components/NcButton'
6973
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
7074
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
7175
import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'
76+
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
7277
import { mapGetters, mapState } from 'vuex'
7378
import { generateUrl } from '@nextcloud/router'
7479
import { loadState } from '@nextcloud/initial-state'
@@ -89,6 +94,7 @@ export default {
8994
NcEmptyContent,
9095
NcIconSvgWrapper,
9196
NcSettingsSection,
97+
NcNoteCard,
9298
Operation,
9399
Rule,
94100
},
@@ -97,6 +103,7 @@ export default {
97103
showMoreOperations: false,
98104
appstoreUrl: generateUrl('settings/apps/workflow'),
99105
workflowDocUrl: loadState('workflowengine', 'doc-url'),
106+
contextChatPlusFilesAccessControl: loadState('workflowengine', 'context-chat-files_acesscontrol'),
100107
WorkflowOffSvg,
101108
}
102109
},
@@ -130,6 +137,7 @@ export default {
130137
},
131138
mounted() {
132139
this.$store.dispatch('fetchRules')
140+
console.debug('aaaaaaaaaaaaaaaaaaa conconconcon', this.contextChatPlusFilesAccessControl)
133141
},
134142
methods: {
135143
createNewRule(operation) {

0 commit comments

Comments
 (0)