Skip to content

Commit

Permalink
Add version choice to widget
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-cfc4 committed Jan 13, 2023
1 parent a46848d commit 0689e40
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/ConnectedTableau/ConnectedTableau.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ConnectedTableau = (props) => {
setLoaded={setLoaded}
data={{ ...props?.general, ...props?.options, ...props?.extraOptions }}
url={props?.general?.url}
version={props?.general?.version}
/>
</div>
);
Expand Down
52 changes: 36 additions & 16 deletions src/Widgets/schema.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
const generalSchema = {
title: 'General',
const generalSchema = (config) => {
return {
title: 'General',

fieldsets: [
{
id: 'general',
title: 'General',
fields: ['url'],
},
],
fieldsets: [
{
id: 'general',
title: 'General',
fields: ['version', 'url'],
},
],

properties: {
url: {
title: 'Url',
type: 'textarea',
properties: {
version: {
title: 'Version',
type: 'array',
choices: [
...[
'2.8.0',
'2.7.0',
'2.6.0',
'2.5.0',
'2.4.0',
'2.3.0',
'2.2.2',
'2.1.2',
'2.0.3',
].map((version) => [version, `tableau-${version}`]),
],
default: config.settings.tableauVersion || '2.8.0',
},
url: {
title: 'Url',
type: 'textarea',
},
},
},
required: ['url'],
required: ['url', 'version'],
};
};

const optionsSchema = {
Expand Down Expand Up @@ -158,7 +178,7 @@ export default (config) => {
schemas: [
{
id: 'general',
schema: generalSchema,
schema: generalSchema(config),
},
{
id: 'options',
Expand Down

0 comments on commit 0689e40

Please sign in to comment.