Skip to content

Commit

Permalink
Revert adapterId removal
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jul 22, 2024
1 parent eecd373 commit 69eaab3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
5 changes: 2 additions & 3 deletions plugins/config/src/FromConfigAdapter/FromConfigAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ export default class FromConfigAdapter extends BaseFeatureDataAdapter {
pluginManager?: PluginManager,
) {
super(conf, getSubAdapter, pluginManager)
this.features = makeFeatures(
(readConfObject(conf, 'features') || []) as SimpleFeatureSerialized[],
)
const feats = readConfObject(conf, 'features') as SimpleFeatureSerialized[]
this.features = makeFeatures(feats || [])
}

async getRefNames() {
Expand Down
4 changes: 2 additions & 2 deletions plugins/config/src/FromConfigAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const configSchema = ConfigurationSchema(
*/
features: {
type: 'frozen',
defaultValue: null,
defaultValue: [],
},
},
{ explicitlyTyped: true },
{ explicitlyTyped: true, implicitIdentifier: 'adapterId' },
)

export default configSchema
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export default class FromConfigRegionsAdapter
pluginManager?: PluginManager,
) {
super(config, getSubAdapter, pluginManager)
this.features = makeFeatures(
(readConfObject(config, 'features') || []) as SimpleFeatureSerialized[],
)
const f = readConfObject(config, 'features') as SimpleFeatureSerialized[]
this.features = makeFeatures(f || [])
}

/**
Expand Down
3 changes: 2 additions & 1 deletion plugins/config/src/FromConfigRegionsAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ const regionsConfigSchema = ConfigurationSchema(
*/
features: {
type: 'frozen',
defaultValue: null,
defaultValue: [],
},
},
{
explicitlyTyped: true,
implicitIdentifier: 'adapterId',
},
)
export default regionsConfigSchema
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export default class FromConfigSequenceAdapter
}

/**
* called to provide a hint that data tied to a certain region will not be
* needed for the foreseeable future and can be purged from caches, etc
* called to provide a hint that data tied to a certain region
* will not be needed for the foreseeable future and can be purged
* from caches, etc
*/
freeResources(/* { region } */): void {}
}
4 changes: 2 additions & 2 deletions plugins/config/src/FromConfigSequenceAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const sequenceConfigSchema = ConfigurationSchema(
*/
features: {
type: 'frozen',
defaultValue: null,
defaultValue: [],
},
},
{ explicitlyTyped: true },
{ explicitlyTyped: true, implicitIdentifier: 'adapterId' },
)

export default sequenceConfigSchema
7 changes: 6 additions & 1 deletion plugins/config/src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

exports[`Config editing adds config editor widget 1`] = `{}`;

exports[`Config editing creates proper FromConfigAdapter 1`] = `{}`;
exports[`Config editing creates proper FromConfigAdapter 1`] = `
{
"adapterId": "testFromConfigAdapterId",
"type": "FromConfigAdapter",
}
`;

0 comments on commit 69eaab3

Please sign in to comment.