diff --git a/src-ui/src/app/components/admin/config/config.component.html b/src-ui/src/app/components/admin/config/config.component.html index e516ba941..31e9aecfa 100644 --- a/src-ui/src/app/components/admin/config/config.component.html +++ b/src-ui/src/app/components/admin/config/config.component.html @@ -23,17 +23,30 @@
-
+
{{option.title}}
+ @if (isExternallyConfigured(option.config_key)) { + @if (isSet(option.key)) { + Overrides external + } @else { + Set externally + } + } @if (isSet(option.key)) { - + @if (isExternallyConfigured(option.config_key)) { + + } @else { + + } }
diff --git a/src-ui/src/app/components/admin/config/config.component.spec.ts b/src-ui/src/app/components/admin/config/config.component.spec.ts index a99171f93..650761c7d 100644 --- a/src-ui/src/app/components/admin/config/config.component.spec.ts +++ b/src-ui/src/app/components/admin/config/config.component.spec.ts @@ -163,6 +163,19 @@ describe('ConfigComponent', () => { expect(component.configForm.get('barcodes_enabled').value).toBeNull() }) + it('should identify externally configured options', () => { + component.externallyConfiguredVariables = new Set([ + 'PAPERLESS_OCR_LANGUAGE', + ]) + + expect( + component.isExternallyConfigured('PAPERLESS_OCR_LANGUAGE') + ).toBeTruthy() + expect( + component.isExternallyConfigured('PAPERLESS_OCR_OUTPUT_TYPE') + ).toBeFalsy() + }) + it('should group options into sections within a category, or not', () => { const sections = component.getCategorySections(ConfigCategory.OCR) expect(sections).toEqual([null, ConfigSection.RemoteOCR])