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
117 changes: 67 additions & 50 deletions cypress/e2e/configuration/new_configuration_test.cy.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,67 @@
import {
mockGenericAuthorizationRepository, mockGenericConfigurationRepository, mockGenericInstanceFlowTrackingRepository,
mockGenericIntegrationRepository, mockGenericResourceRepository,
mockGenericAuthorizationRepository,
mockGenericConfigurationRepository,
mockGenericInstanceFlowTrackingRepository,
mockGenericIntegrationRepository,
mockGenericResourceRepository,
mockGenericSourceApplicationRepository,
mockGenericValueConvertingRepository,
} from '../../utils/interceptions.js';

function fillAll() {
cy.get('#sourceApplicationId').select('2')
cy.get('#sourceApplicationIntegrationId').select('sak')
cy.get('#destination').select('fylkesrad')
cy.get('#sourceApplicationId').select('2');
cy.get('#sourceApplicationIntegrationId').select('sak');
cy.get('#destination').select('fylkesrad');
}

describe('Testing create new configuration from new integration', () => {
beforeEach(() => {
mockGenericAuthorizationRepository()
mockGenericAuthorizationRepository();
mockGenericIntegrationRepository();
mockGenericSourceApplicationRepository();
mockGenericValueConvertingRepository();
mockGenericResourceRepository();
})
});

function prep() {
cy.visit('/integration/new')
fillAll()
cy.get('#form-settings-confirm-btn').click()
cy.visit('/integration/new');
fillAll();
cy.get('#form-settings-confirm-btn').click();
cy.wait('@postIntegration').its('request.body').should('deep.equal', {
"sourceApplicationId": "2",
"sourceApplicationIntegrationId": "sak",
"destination": "fylkesrad",
"state": "DEACTIVATED"
}
)
sourceApplicationId: '2',
sourceApplicationIntegrationId: 'sak',
destination: 'fylkesrad',
state: 'DEACTIVATED',
});
}

it('should navigate to configuration form and show outgoing and incoming data', () => {
prep()
prep();
cy.url().should('contain', '/configuration/new');
cy.get('#incoming-form-panel').should("be.visible")
cy.get('#metadata-content-panel').should("be.visible")
cy.get('#value-converting-panel').should("be.visible")
cy.get('#outgoing-form-panel').should("be.visible")
cy.get('#incoming-form-panel').should('be.visible');
cy.get('#metadata-content-panel').should('be.visible');
cy.get('#value-converting-panel').should('be.visible');
cy.get('#outgoing-form-panel').should('be.visible');

cy.get('#metadata-content-panel > .navds-vstack').children().should('have.length', 16);
})
});

it('should open panels in outgoing data', () => {
prep()
cy.get('#column-0').should("be.visible")
cy.get('#mapping\\.valueMappingPerKey\\.type\\.mappingString').click()
cy.get('#menu-mapping\\.valueMappingPerKey\\.type\\.mappingString > .MuiPaper-root > .MuiList-root > [tabindex="0"]').type('{enter}')
cy.get('#toggle-panel-button').click()
cy.get('#column-1').should("be.visible")
prep();
cy.get('#column-0').should('be.visible');
cy.get('#mapping\\.valueMappingPerKey\\.type\\.mappingString').click();
cy.get(
'#menu-mapping\\.valueMappingPerKey\\.type\\.mappingString > .MuiPaper-root > .MuiList-root > [tabindex="0"]'
).type('{enter}');
cy.get('#toggle-panel-button').click();
cy.get('#column-1').should('be.visible');
cy.get('#column-1').should('contain', 'Sak');
})
});
});


describe('Testing creating new and editing configurations from integration overview', () => {
function prep() {
cy.visit('/integration/list')
cy.visit('/integration/list');
}

beforeEach(() => {
Expand All @@ -72,28 +75,42 @@ describe('Testing creating new and editing configurations from integration overv
});

it('should navigate to create new blank configuration form', () => {
prep()
cy.get(':nth-child(3) > .navds-table__toggle-expand-cell > .navds-table__toggle-expand-button').click()
cy.get('#panel-1-new-configuration-button').click()
})
prep();
cy.get(
':nth-child(3) > .navds-table__toggle-expand-cell > .navds-table__toggle-expand-button'
).click();
cy.get('#panel-1-new-configuration-button').click();
});

it('should navigate to create new configuration based on existing completed version', () => {
prep()
cy.get(':nth-child(3) > .navds-table__toggle-expand-cell > .navds-table__toggle-expand-button').click()
cy.get('#panel-1-action-toggle > .navds-dropdown__toggle').click()
cy.get('#panel-1-action-toggle > .navds-popover > dl.navds-dropdown__list > :nth-child(2) > .navds-dropdown__item').click()
prep();

cy.get('#mapping\\.valueMappingPerKey\\.type\\.mappingString').click()
cy.get('#menu-mapping\\.valueMappingPerKey\\.type\\.mappingString > .MuiPaper-root > .MuiList-root > [tabindex="0"]').type('{enter}')
cy.get('#toggle-panel-button').click()
cy.get('#dnd-value-component-mapping\\.objectMappingPerKey\\.newCase\\.valueMappingPerKey\\.tittel\\.mappingString > .MuiFormControl-root > .MuiInputBase-root').should("contain.text", "test basert på")
})
cy.get(
':nth-child(3) > .navds-table__toggle-expand-cell > .navds-table__toggle-expand-button'
).click();

cy.get('#completed-config-table #panel-1-action-toggle > button').click();
cy.get('[data-testid="action-menu-content"]')
.find('[data-testid="create-new-based-on-configuration"]')
.click();

cy.get('#mapping\\.valueMappingPerKey\\.type\\.mappingString').click();
cy.get(
'#menu-mapping\\.valueMappingPerKey\\.type\\.mappingString > .MuiPaper-root > .MuiList-root > [tabindex="0"]'
).type('{enter}');
cy.get('#toggle-panel-button').click();
cy.get(
'#dnd-value-component-mapping\\.objectMappingPerKey\\.newCase\\.valueMappingPerKey\\.tittel\\.mappingString > .MuiFormControl-root > .MuiInputBase-root'
).should('contain.text', 'test basert på');
});

it('should navigate to edit existing configuration draft', () => {
prep()
cy.get(':nth-child(3) > .navds-table__toggle-expand-cell > .navds-table__toggle-expand-button').click()
cy.get(':nth-child(1) > :nth-child(5) > #panel-1-action-toggle > .navds-button').click()
cy.get('#comment').should("contain.text", "rediger denne konfig")
})
prep();
cy.get(
':nth-child(3) > .navds-table__toggle-expand-cell > .navds-table__toggle-expand-button'
).click();
cy.get('#draft-config-table #panel-1-action-toggle > button').first().click();
cy.get('[data-testid="action-menu-content"]').find('[data-testid="edit-draft"]').click();
cy.get('#comment').should('contain.text', 'rediger denne konfig');
});
});

5 changes: 4 additions & 1 deletion cypress/e2e/integration_list_test.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ describe('Testing integration list', () => {
cy.wait('@getConfigCompleted2');

cy.get('#integration-panel-container').should('be.visible');
cy.get('label').should('contain.text', 'Aktiv konfigurasjon: ');
cy.get('[data-testid="active-configuration"]').should(
'contain.text',
'Ingen aktiv konfigurasjon'
);
cy.get('#integration-panel-container table').should('have.length', 2);
cy.get('#integration-panel-container table')
.first()
Expand Down
76 changes: 23 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@typescript-eslint/eslint-plugin": "^8.58.2",
"@typescript-eslint/parser": "^8.58.2",
"@vitejs/plugin-react": "^5.1.1",
"cypress": "^15.14.0",
"cypress": "^15.15.0",
"eslint": "^9.39.4",
"prettier": "^3.4.2",
"typescript": "~5.4.0",
Expand Down
4 changes: 4 additions & 0 deletions src/api/useConfigurationRepository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,25 @@ export default function useConfigurationRepository() {
},
});
};

const getConfigurationById = (configurationId: string, excludeElements?: boolean) => {
return get<IConfiguration>(API_URL, `/api/intern/konfigurasjoner/${configurationId}`, {
params: { ekskluderMapping: excludeElements },
});
};

const createConfiguration = (data: IConfiguration) => {
return post<IConfiguration>(API_URL, `/api/intern/konfigurasjoner`, data);
};

const updateConfiguration = (configurationId: string, data: IConfigurationPatch) => {
return patch<IConfiguration>(
API_URL,
`/api/intern/konfigurasjoner/${configurationId}`,
data
);
};

const deleteConfiguration = (configurationId: string) => {
return deleteFetch(API_URL, `/api/intern/konfigurasjoner/${configurationId}`);
};
Expand Down
23 changes: 22 additions & 1 deletion src/components/utils/version/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ export const ABOUT_VERSIONS_EN =
'FINT Flyt is under continuous development. We are continuously adding new functionality and improving the user experience based on feedback from our users. This page describes major changes and bug fixes in Flyt.';

export const VERSION_DATA_EN: VersionEntry[] = [
{
heading: 'May 2026',
updates: [
{
title: 'Clearer error messages in configuration setup:',
text: 'Error messages during configuration saving have been improved. It is now clearer which field contains an error, and whether it is caused by outdated references.',
},
{
title: 'Improved feedback when saving configurations:',
text: 'The form now clearly indicates when a save is in progress, and provides clear feedback on whether the save was successful or not.',
},
{
title: 'Improved design for versions and drafts:',
text: 'The tables for versions and drafts have been simplified. The active version is clearly highlighted, and the ID column has been removed. The ID is still available in the menu for each configuration.',
},
{
title: 'Support for deleting drafts:',
text: 'It is now possible to delete draft configurations.',
},
],
},
{
heading: 'February 2026',
updates: [
Expand Down Expand Up @@ -32,7 +53,7 @@ export const VERSION_DATA_EN: VersionEntry[] = [
updates: [
{
title: 'Visual changes:',
text: 'Several borders around tables and elements have been removed, and color usage has been adjusted to better align with the Novaria profile.',
text: 'Several borders around tables and elements have been removed, and color usage has been adjusted to better align with the Novari profile.',
},
{
title: 'Dashboard:',
Expand Down
Loading
Loading