Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions frontend/src/modules/admin/modules/collections/pinia/actions.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2026 The Linux Foundation and each contributor.
// SPDX-License-Identifier: MIT

import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { CollectionModel } from '../models/collection.model';

export const useCollectionsStore = defineStore('collections-store', () => {
const collections = ref<CollectionModel[]>([]);

function setCollections(value: CollectionModel[]) {
collections.value = value;
}

function getCollection(id: string) {
return collections.value.find((c) => c.id === id);
}

function getCollections() {
return collections.value;
}

return {
collections,
setCollections,
getCollection,
getCollections,
};
});
12 changes: 1 addition & 11 deletions frontend/src/modules/admin/modules/collections/pinia/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
import { defineStore } from 'pinia';
import state from './state';
import actions from './actions';

export const useCollectionsStore = defineStore(
'collections-store',
{
state,
actions,
},
);
export * from './collections.store';
11 changes: 0 additions & 11 deletions frontend/src/modules/admin/modules/collections/pinia/state.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
import { defineStore } from 'pinia';
import state from './state';
import actions from './actions';

export const useInsightsProjectsStore = defineStore(
'insights-projects-store',
{
state,
actions,
},
);
export * from './insights-projects.store';
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2026 The Linux Foundation and each contributor.
// SPDX-License-Identifier: MIT

import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { InsightsProjectModel } from '../models/insights-project.model';

export const useInsightsProjectsStore = defineStore('insights-projects-store', () => {
const insightsProjects = ref<InsightsProjectModel[]>([]);

function setInsightsProjects(projects: InsightsProjectModel[]) {
insightsProjects.value = projects;
}

function getInsightsProject(id: string) {
return insightsProjects.value.find((c) => c.id === id);
}

function getInsightsProjects() {
return insightsProjects.value;
}

function updateInsightsProject(project: InsightsProjectModel) {
const index = insightsProjects.value.findIndex((c) => c.id === project.id);
if (index !== -1) {
insightsProjects.value[index] = project;
}
}

function createInsightsProject(project: InsightsProjectModel) {
insightsProjects.value.push(project);
}

function searchInsightsProjects(query: string) {
return insightsProjects.value.filter((c) => c.name.toLowerCase().includes(query.toLowerCase()));
}

return {
insightsProjects,
setInsightsProjects,
getInsightsProject,
getInsightsProjects,
updateInsightsProject,
createInsightsProject,
searchInsightsProjects,
};
});

This file was deleted.

Loading