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
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ describe('ContentConfigurationServiceProvidersService', () => {

it('returns parsed content configurations', async () => {
mockClient.request.mockResolvedValue({
core_openmfp_io: {
ui_platform_mesh_io: {
ContentConfigurations: [
{
metadata: {
name: 'conf1',
labels: { 'portal.openmfp.org/entity': 'entity' },
labels: { 'ui.platform-mesh.io/entity': 'entity' },
},
spec: { remoteConfiguration: { url: 'http://remote' } },
status: {
Expand All @@ -70,12 +70,12 @@ describe('ContentConfigurationServiceProvidersService', () => {

it('falls back to spec.remoteConfiguration.url if missing in parsed config', async () => {
mockClient.request.mockResolvedValue({
core_openmfp_io: {
ui_platform_mesh_io: {
ContentConfigurations: [
{
metadata: {
name: 'conf1',
labels: { 'portal.openmfp.org/entity': 'entity' },
labels: { 'ui.platform-mesh.io/entity': 'entity' },
},
spec: { remoteConfiguration: { url: 'http://remote' } },
status: { configurationResult: JSON.stringify({}) },
Expand All @@ -95,12 +95,12 @@ describe('ContentConfigurationServiceProvidersService', () => {

it('throws on missing configurationResult', async () => {
mockClient.request.mockResolvedValue({
core_openmfp_io: {
ui_platform_mesh_io: {
ContentConfigurations: [
{
metadata: {
name: 'conf1',
labels: { 'portal.openmfp.org/entity': 'entity' },
labels: { 'ui.platform-mesh.io/entity': 'entity' },
},
spec: { remoteConfiguration: { url: 'http://remote' } },
status: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { GraphQLClient, gql } from 'graphql-request';

export const contentConfigurationsQuery = gql`
query {
core_openmfp_io {
ui_platform_mesh_io {
ContentConfigurations {
metadata {
name
Expand Down Expand Up @@ -66,17 +66,17 @@ export class ContentConfigurationServiceProvidersService
);

// Validate response structure
if (!response?.core_openmfp_io?.ContentConfigurations) {
if (!response?.ui_platform_mesh_io?.ContentConfigurations) {
throw new Error(
'Invalid response structure: missing ContentConfigurations',
);
}

const entity = !entities || !entities.length ? 'main' : entities[0];
const contentConfigurations =
response.core_openmfp_io.ContentConfigurations.filter(
response.ui_platform_mesh_io.ContentConfigurations.filter(
(item) =>
item.metadata.labels?.['portal.openmfp.org/entity'] === entity,
item.metadata.labels?.['ui.platform-mesh.io/entity'] === entity,
).map((item) => {
try {
// Validate required fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class KubernetesServiceProvidersService
group: 'core.openmfp.io',
version: 'v1alpha1',
plural: 'contentconfigurations',
labelSelector: `portal.openmfp.org/entity=${entity}`,
labelSelector: `ui.platform-mesh.io/entity=${entity}`,
};
return await this.k8sApi.listClusterCustomObject(gvr, {
middleware: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface ContentConfigurationQueryResponse {
core_openmfp_io: ContentConfigurationsResponse;
ui_platform_mesh_io: ContentConfigurationsResponse;
}

export interface ContentConfigurationsResponse {
Expand Down