Skip to content

Commit

Permalink
Rebase into models?
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Feb 18, 2024
1 parent 17c85e6 commit 05496a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const localVue = getLocalVue(true);
const STANDARD_TEMPLATE: ObjectStoreTemplateSummary = {
type: "s3",
name: "moo",
description: undefined,
description: null,
variables: [
{
name: "myvar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const router = injectTestRouter(localVue);
const STANDARD_TEMPLATE: ObjectStoreTemplateSummary = {
type: "s3",
name: "moo",
description: undefined,
description: null,
variables: [
{
name: "oldvar",
Expand Down
8 changes: 4 additions & 4 deletions client/src/stores/objectStoreTemplatesStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const TEMPLATES_BASIC = [
{
type: s3,
name: "moo",
description: undefined,
description: null,
variables: [],
secrets: [],
id: "moo",
Expand All @@ -20,7 +20,7 @@ const TEMPLATES_EXPANDED = [
{
type: s3,
name: "Testing S3",
description: undefined,
description: null,
variables: [],
secrets: [],
id: "bucket_s3",
Expand All @@ -30,7 +30,7 @@ const TEMPLATES_EXPANDED = [
{
type: s3,
name: "Testing S3 (some more)",
description: undefined,
description: null,
variables: [],
secrets: [],
id: "bucket_s3",
Expand All @@ -40,7 +40,7 @@ const TEMPLATES_EXPANDED = [
{
type: s3,
name: "Amazon S3 (working!)",
description: undefined,
description: null,
variables: [],
secrets: [],
id: "bucket_s3",
Expand Down
4 changes: 2 additions & 2 deletions client/src/stores/objectStoreTemplatesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function findTemplate(templates: ObjectStoreTemplateSummaries, templateId: strin
return null;
}

function getLatestVersionMap(templates: ObjectStoreTemplateSummaries) {
function getLatestVersionMap(templates: ObjectStoreTemplateSummaries): { [key: string]: number } {
const latestVersions: { [key: string]: number } = {};
templates.forEach((i: ObjectStoreTemplateSummary) => {
const templateId = i.id;
Expand Down Expand Up @@ -66,7 +66,7 @@ export const useObjectStoreTemplatesStore = defineStore("objectStoreTemplatesSto
latestTemplates: (state) => {
// only expose latest instance by template_version for each template_id
const latestVersions = getLatestVersionMap(state.templates);
return state.templates.filter((i) => latestVersions[i.id] == (i.version || 0));
return state.templates.filter((i:ObjectStoreTemplateSummary) => latestVersions[i.id] == (i.version || 0));
},
canUpgrade: (state) => {
return (templateId: string, templateVersion: number) =>
Expand Down

0 comments on commit 05496a5

Please sign in to comment.