Skip to content

Commit

Permalink
refactor: remove title prop from document preview component schema
Browse files Browse the repository at this point in the history
  • Loading branch information
vsgoulart committed Dec 10, 2024
1 parent 5b88f23 commit 0db4cb7
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function isProhibitedPath(path) {
return path.split('.').some((segment) => prohibitedSegments.includes(segment));
}

export const LABELED_NON_INPUTS = ['button', 'group', 'dynamiclist', 'iframe', 'table'];
export const LABELED_NON_INPUTS = ['button', 'group', 'dynamiclist', 'iframe', 'table', 'documentPreview'];

export const INPUTS = [
'checkbox',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ function getLabelText(type) {
case 'table':
return 'Table label';
case 'iframe':
case 'documentPreview':
return 'Title';
default:
return 'Field label';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export { StaticColumnsSourceEntry } from './StaticColumnsSourceEntry';
export { VersionTagEntry } from './VersionTagEntry';
export { AcceptEntry } from './AcceptEntry';
export { MultipleEntry } from './MultipleEntry';
export { TitleEntry } from './TitleEntry';
export { DocumentsDataSourceEntry } from './DocumentsDataSource';
export { EndpointKeyEntry } from './EndpointKey';
export { MaxHeightEntry } from './MaxHeightEntry';
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
VersionTagEntry,
AcceptEntry,
MultipleEntry,
TitleEntry,
DocumentsDataSourceEntry,
EndpointKeyEntry,
} from '../entries';
Expand All @@ -36,7 +35,6 @@ export function GeneralGroup(field, editField, getService) {
...IdEntry({ field, editField }),
...VersionTagEntry({ field, editField }),
...LabelEntry({ field, editField }),
...TitleEntry({ field, editField }),
...DescriptionEntry({ field, editField }),
...KeyEntry({ field, editField, getService }),
...PathEntry({ field, editField, getService }),
Expand Down
2 changes: 1 addition & 1 deletion packages/form-js-viewer/test/spec/documentPreview.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"components": [
{
"title": "Case {{case_id}} documents",
"label": "Case {{case_id}} documents",
"type": "documentPreview",
"id": "Field_0wy8tws",
"dataSource": "=my_documents",
Expand Down
5 changes: 0 additions & 5 deletions packages/form-json-schema/src/defs/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,6 @@
"description": "Allow multiple files to be selected.",
"type": ["boolean", "string"]
},
"title": {
"$id": "#/component/title",
"description": "The title displayed on top of the document preview component.",
"type": "string"
},
"maxHeight": {
"$id": "#/component/maxHeight",
"description": "The maximum height of a document item in the document preview component.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@
},
"then": {
"properties": {
"title": false,
"endpointKey": false,
"maxHeight": false
}
Expand Down
2 changes: 1 addition & 1 deletion packages/form-json-schema/test/fixtures/documentPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const form = {
{
type: 'documentPreview',
dataSource: '=someSource',
title: 'My documents',
label: 'My documents',
endpointKey: '=someEndpointKey',
maxHeight: 100,
},
Expand Down
27 changes: 0 additions & 27 deletions packages/form-json-schema/test/fixtures/title-not-allowed.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/form-json-schema/test/spec/validation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ describe('validation', function () {

testForm('documentPreview');

testForm('title-not-allowed');

testForm('maxHeight-not-allowed');

testForm('endpointKey-not-allowed');
Expand Down

0 comments on commit 0db4cb7

Please sign in to comment.