Skip to content

Commit

Permalink
Merge branch '13317-add-combination-and-referanse-types-to-dropdown-m…
Browse files Browse the repository at this point in the history
…enu-in-felter-section-in-datamodel' of https://github.com/Altinn/altinn-studio into 13317-add-combination-and-referanse-types-to-dropdown-menu-in-felter-section-in-datamodel
  • Loading branch information
JamalAlabdullah committed Sep 14, 2024
2 parents cb23621 + d16e22d commit 46fb75f
Show file tree
Hide file tree
Showing 256 changed files with 5,117 additions and 3,268 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy-designer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
construct-environments-array:
uses: ./.github/workflows/template-construct-environments.yaml
with:
environments: ${{ github.event.inputs.environments || 'staging,prod' }}
environments: ${{ github.event.inputs.environments || 'staging,preapproved-prod' }}

determine-tag:
needs: get-short-sha
Expand Down Expand Up @@ -103,9 +103,10 @@ jobs:
tag: ${{ needs.determine-tag.outputs.tag }}
registry-name: altinntjenestercontainerregistry.azurecr.io
environment: ${{ matrix.environment }}
artifact-environment: ${{ matrix.environment == 'preapproved-prod' && 'prod' || matrix.environment }}
config-chart-name: altinn-designer-config
artifact-name: altinn-designer
helm-set-arguments: environmentName=${{ matrix.environment }},chartVersion=0.1.0+${{ needs.determine-tag.outputs.tag }},imageTag=${{ needs.determine-tag.outputs.tag }},dbMigrationsTag=${{ needs.determine-tag.outputs.tag }}
helm-set-arguments: environmentName=${{ matrix.environment == 'preapproved-prod' && 'prod' || matrix.environment }},chartVersion=0.1.0+${{ needs.determine-tag.outputs.tag }},imageTag=${{ needs.determine-tag.outputs.tag }},dbMigrationsTag=${{ needs.determine-tag.outputs.tag }}
secrets:
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/template-flux-config-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
environment:
required: true
type: string
artifact-environment:
required: false
type: string
config-chart-name:
required: true
type: string
Expand Down Expand Up @@ -72,12 +75,14 @@ jobs:
- name: Push config artifact
run: |
flux push artifact oci://${{ inputs.registry-name }}/configs/${{ inputs.artifact-name }}-${{ inputs.environment }}:${{ inputs.tag }} \
artifact_env=${{ inputs.artifact-environment || inputs.environment }}
flux push artifact oci://${{ inputs.registry-name }}/configs/${{ inputs.artifact-name }}-${artifact_env}:${{ inputs.tag }} \
--path="./${{ inputs.config-chart-name }}-rendered" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"
- name: Tag artifact as latest
run: |
flux tag artifact oci://${{ inputs.registry-name }}/configs/${{ inputs.artifact-name }}-${{ inputs.environment }}:${{ inputs.tag }} --tag latest
artifact_env=${{ inputs.artifact-environment || inputs.environment }}
flux tag artifact oci://${{ inputs.registry-name }}/configs/${{ inputs.artifact-name }}-${artifact_env}:${{ inputs.tag }} --tag latest
348 changes: 174 additions & 174 deletions .yarn/releases/yarn-4.4.0.cjs → .yarn/releases/yarn-4.4.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ enableTelemetry: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.0.cjs
yarnPath: .yarn/releases/yarn-4.4.1.cjs
28 changes: 28 additions & 0 deletions backend/src/Designer/Controllers/OptionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ public ActionResult<string[]> GetOptionsListIds(string org, string repo)
return Ok(optionsListIds);
}

/// <summary>
/// Fetches the contents of all the options lists belonging to the app.
/// </summary>
/// <param name="org">Unique identifier of the organisation responsible for the app.</param>
/// <param name="repo">Application identifier which is unique within an organisation.</param>
/// <returns>Dictionary of all option lists belonging to the app</returns>
[HttpGet]
[Route("option-lists")]
public async Task<ActionResult<Dictionary<string, List<Option>>>> GetOptionLists(string org, string repo)
{
try
{
string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext);
string[] optionListIds = _optionsService.GetOptionsListIds(org, repo, developer);
Dictionary<string, List<Option>> optionLists = [];
foreach (string optionListId in optionListIds)
{
List<Option> optionList = await _optionsService.GetOptionsList(org, repo, developer, optionListId);
optionLists.Add(optionListId, optionList);
}
return Ok(optionLists);
}
catch (NotFoundException)
{
return NoContent();
}
}

/// <summary>
/// Fetches a specific option list.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion development/azure-devops-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"author": "The Altinn Studio Team",
"dependencies": {
"axios": "1.7.4",
"axios": "1.7.7",
"cors": "2.8.5",
"express": "4.19.2",
"morgan": "1.10.0",
Expand Down
2 changes: 1 addition & 1 deletion eidlogger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<version>3.3.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>no.altinn</groupId>
Expand Down
3 changes: 2 additions & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ language/old/*
script.js
/testing/playwright/test-results

*storybook.log
*storybook.log
/libs/studio-components/storybook-static/*
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useStudioEnvironmentParams } from 'app-shared/hooks/useStudioEnvironmen
import { toast } from 'react-toastify';
import { Alert, Link } from '@digdir/designsystemet-react';
import { useDeployPermissionsQuery } from 'app-development/hooks/queries';
import { StudioSpinner } from '@studio/components';
import { StudioError, StudioSpinner } from '@studio/components';

export interface DeployProps {
appDeployedVersion: string;
Expand Down Expand Up @@ -47,8 +47,7 @@ export const Deploy = ({
);
}

if (permissionsIsError)
return <Alert severity='danger'>{t('app_deployment.permission_error')}</Alert>;
if (permissionsIsError) return <StudioError>{t('app_deployment.permission_error')}</StudioError>;

const deployPermission =
permissions.findIndex((e) => e.toLowerCase() === envName.toLowerCase()) > -1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import classes from './DeployDropdown.module.css';
import { AltinnConfirmDialog } from 'app-shared/components';
import { StudioButton, StudioSpinner } from '@studio/components';
import { Alert, Combobox, Spinner } from '@digdir/designsystemet-react';
import { StudioButton, StudioError, StudioSpinner } from '@studio/components';
import { Combobox, Spinner } from '@digdir/designsystemet-react';
import type { ImageOption } from './ImageOption';
import { useTranslation } from 'react-i18next';
import { useAppReleasesQuery } from 'app-development/hooks/queries';
Expand Down Expand Up @@ -42,7 +42,7 @@ export const DeployDropdown = ({
<StudioSpinner showSpinnerTitle={false} spinnerTitle={t('app_deployment.releases_loading')} />
);

if (releasesIsError) return <Alert severity='danger'>{t('app_deployment.releases_error')}</Alert>;
if (releasesIsError) return <StudioError>{t('app_deployment.releases_error')}</StudioError>;

const imageOptions: ImageOption[] = releases
.filter((image) => image.build.result === BuildResult.succeeded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Alert, Heading, Link, Paragraph, Spinner } from '@digdir/designsystemet
import { Trans, useTranslation } from 'react-i18next';
import type { KubernetesDeployment } from 'app-shared/types/api/KubernetesDeployment';
import { DateUtils } from '@studio/pure-functions';
import { ExternalLinkIcon } from '@studio/icons';

export interface DeploymentEnvironmentStatusProps {
lastPublishedDate?: string;
Expand Down Expand Up @@ -88,19 +89,18 @@ export const DeploymentEnvironmentStatus = ({
version: kubernetesDeployment.version,
}}
components={{
a: <Link href={urlToApp}> </Link>,
a: (
<Link href={urlToApp} rel='noopener noreferrer' target='_blank'>
{' '}
</Link>
),
ext: <ExternalLinkIcon title={t('app_deployment.status.open_app_in_new_window')} />,
}}
/>
}
footer={
lastPublishedDate && (
<Trans
i18nKey={'app_deployment.last_published'}
values={{
lastPublishedDate: formatDateTime(lastPublishedDate),
}}
/>
)
lastPublishedDate &&
t('app_deployment.last_published', { lastPublishedDate: formatDateTime(lastPublishedDate) })
}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { useStudioEnvironmentParams } from 'app-shared/hooks/useStudioEnvironmen
import { DeploymentEnvironment } from '../components/DeploymentEnvironment';
import { getAppLink } from 'app-shared/ext-urls';
import { useTranslation } from 'react-i18next';
import { Alert } from '@digdir/designsystemet-react';
import { PROD_ENV_TYPE } from 'app-shared/constants';
import { StudioError } from '@studio/components';

export const DeploymentContainer = () => {
const { org, app } = useStudioEnvironmentParams();
Expand Down Expand Up @@ -58,9 +58,7 @@ export const DeploymentContainer = () => {
if (environmentListIsError || orgsIsError || appDeploymentIsError)
return (
<div className={classes.deployContainer}>
<Alert severity='danger' className={classes.alert}>
{t('app_deployment.error')}
</Alert>
<StudioError className={classes.alert}>{t('app_deployment.error')}</StudioError>
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { CreateRelease } from '../components/CreateRelease';
import { Release } from '../components/Release';
import { UploadIcon, CheckmarkIcon } from '@studio/icons';
import { gitCommitPath } from 'app-shared/api/paths';
import { StudioSpinner, StudioPopover, StudioParagraph } from '@studio/components';
import { StudioSpinner, StudioPopover, StudioParagraph, StudioError } from '@studio/components';
import { useBranchStatusQuery, useAppReleasesQuery } from '../../../hooks/queries';
import { Trans, useTranslation } from 'react-i18next';
import { useQueryClient } from '@tanstack/react-query';
import { QueryKey } from 'app-shared/types/QueryKey';

import { useRepoStatusQuery } from 'app-shared/hooks/queries';
import { useStudioEnvironmentParams } from 'app-shared/hooks/useStudioEnvironmentParams';
import { Alert, Link } from '@digdir/designsystemet-react';
import { Link } from '@digdir/designsystemet-react';

export function ReleaseContainer() {
const { org, app } = useStudioEnvironmentParams();
Expand Down Expand Up @@ -76,7 +76,7 @@ export function ReleaseContainer() {
}
if (!masterBranchStatus) {
return (
<Alert severity='danger'>
<StudioError>
<StudioParagraph>
<Trans
i18nKey={'app_create_release_errors.fetch_release_failed'}
Expand All @@ -85,7 +85,7 @@ export function ReleaseContainer() {
}}
></Trans>
</StudioParagraph>
</Alert>
</StudioError>
);
}
// Check if latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { Trans, useTranslation } from 'react-i18next';
import { AltinnContentLoader } from 'app-shared/components/molecules/AltinnContentLoader';
import { useInvalidator } from '../../../hooks/useInvalidator';
import { useStudioEnvironmentParams } from 'app-shared/hooks/useStudioEnvironmentParams';
import { Alert, Link } from '@digdir/designsystemet-react';
import { Link } from '@digdir/designsystemet-react';
import { EmailContactProvider } from 'app-shared/getInTouch/providers';
import { GetInTouchWith } from 'app-shared/getInTouch';
import { StudioError } from '@studio/components';

export function DeployPage() {
const { org, app } = useStudioEnvironmentParams();
Expand All @@ -34,11 +35,7 @@ export function DeployPage() {
}

if (orgsIsError || permissionsIsError)
return (
<Alert severity='danger' className={classes.alert}>
{t('app_deployment.error')}
</Alert>
);
return <StudioError className={classes.alert}>{t('app_deployment.error')}</StudioError>;

// If org isn't listed, or doesn't have any environments
if (!orgs[org] || !orgs[org].environments || !orgs[org].environments.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { QueryClient } from '@tanstack/react-query';
import userEvent from '@testing-library/user-event';
import { createApiErrorMock } from 'app-shared/mocks/apiErrorMock';
import { app, org } from '@studio/testing/testids';

import { user as userMock } from 'app-shared/mocks/mocks';
// workaround for https://jestjs.io/docs/26.x/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(window, 'matchMedia', {
writable: true,
Expand Down Expand Up @@ -99,7 +99,9 @@ describe('DataModelling', () => {
);
queryClient.setQueryData([QueryKey.DataModelsJson, org, app], [jsonMetadata1Mock]);
queryClient.setQueryData([QueryKey.DataModelsXsd, org, app], []);
queryClient.setQueryData([QueryKey.CurrentUser], userMock);
render({ generateModels }, queryClient);

const errorsPanel = screen.queryByText(textMock('api_errors.DM_01'));
expect(errorsPanel).not.toBeInTheDocument();

Expand All @@ -125,6 +127,7 @@ describe('DataModelling', () => {
);
queryClient.setQueryData([QueryKey.DataModelsJson, org, app], [jsonMetadata1Mock]);
queryClient.setQueryData([QueryKey.DataModelsXsd, org, app], []);
queryClient.setQueryData([QueryKey.CurrentUser], userMock);
render({ generateModels }, queryClient);

const generateModelButton = screen.getByRole('button', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ReactNode } from 'react';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { StudioPageSpinner, StudioCenter } from '@studio/components';
import { Alert, ErrorMessage, Paragraph } from '@digdir/designsystemet-react';
import { StudioPageSpinner, StudioCenter, StudioError } from '@studio/components';
import { ErrorMessage, Paragraph } from '@digdir/designsystemet-react';
import { SchemaEditorWithToolbar } from './SchemaEditorWithToolbar';
import { useDataModelsJsonQuery, useDataModelsXsdQuery } from 'app-shared/hooks/queries';
import { useParams } from 'react-router-dom';
Expand All @@ -25,12 +25,12 @@ export function DataModelling({ createPathOption = false }: DataModellingProps):
case 'error':
return (
<StudioCenter>
<Alert severity='danger'>
<StudioError>
<Paragraph>{t('general.fetch_error_message')}</Paragraph>
<Paragraph>{t('general.error_message_with_colon')}</Paragraph>
{jsonError && <ErrorMessage>{jsonError.message}</ErrorMessage>}
{xsdError && <ErrorMessage>{xsdError.message}</ErrorMessage>}
</Alert>
</StudioError>
</StudioCenter>
);
case 'success': {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
.landingDialog {
background-color: #e3f7ff;
border-radius: 0;
display: flex;
flex-direction: column;
background-color: var(--fds-semantic-surface-info-subtle);
box-shadow: 1px 1px 3px 2px rgb(0 0 0 / 25%);
height: 229px;
padding: var(--fds-spacing-10);
gap: 2rem;
width: 40%;
height: fit-content;
margin-top: var(--fds-spacing-10);
margin-left: auto;
margin-right: auto;
margin-top: 36px;
padding: 3rem 3rem 3rem 96px;
width: 783px;
}

.landingDialog h1 {
font-size: 18px;
font-weight: bold;
}

.background {
background-color: #f7f7f7;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classes from './LandingPagePanel.module.css';
import { StudioButton } from '@studio/components';
import { StudioButton, StudioHeading, StudioParagraph } from '@studio/components';
import { XSDUpload } from './TopToolbar/XSDUpload';
import { useTranslation } from 'react-i18next';
import { ButtonContainer } from 'app-shared/primitives';
Expand All @@ -13,15 +13,12 @@ export function LandingPagePanel({ openCreateNew }: LandingPagePanelProps) {
const { t } = useTranslation();
return (
<div className={classes.landingDialog}>
<h1>{t('app_data_modelling.landing_dialog_header')}</h1>
<p>{t('app_data_modelling.landing_dialog_paragraph')}</p>
<StudioHeading size='small'>{t('app_data_modelling.landing_dialog_header')}</StudioHeading>
<StudioParagraph>{t('app_data_modelling.landing_dialog_paragraph')}</StudioParagraph>
<ButtonContainer>
<XSDUpload
submitButtonRenderer={(fileInputClickHandler) => (
<StudioButton color='first' onClick={fileInputClickHandler}>
{t('app_data_modelling.landing_dialog_upload')}
</StudioButton>
)}
uploadButtonText={t('app_data_modelling.landing_dialog_upload')}
uploaderButtonVariant='primary'
/>
<StudioButton color='second' onClick={openCreateNew}>
{t('app_data_modelling.landing_dialog_create')}
Expand Down
Loading

0 comments on commit 46fb75f

Please sign in to comment.