Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ob 5386 #1031

Closed
wants to merge 30 commits into from
Closed

Ob 5386 #1031

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3539123
chore: rebase to fork state
web-mi Mar 16, 2024
43819e8
fix: registration data loading
web-mi Mar 19, 2024
7d19db3
Merge pull request #77 from virtualidentityag/OB-Rebase
web-mi Mar 22, 2024
df790d4
fix: registration bugs
web-mi Mar 22, 2024
1449f3a
Merge pull request #78 from virtualidentityag/OB-Rebase
web-mi Mar 22, 2024
debe507
fix: unused import
web-mi Mar 22, 2024
978c4a5
fix: add topic provider and remove consultingTypes where possible
janrembold Mar 26, 2024
0b26d2d
fix: update dependency array
janrembold Mar 26, 2024
7ecb370
fix: remove log
janrembold Mar 27, 2024
330cb1d
fix: quickfix
janrembold Mar 27, 2024
1b45d39
chore: remove unused import
janrembold Mar 27, 2024
83609bb
fix: remove consultingTypes for topics
janrembold Mar 27, 2024
b173c12
fix: auto load topics
janrembold Mar 28, 2024
0d0e56a
fix: revert changes until final topic solution
janrembold Mar 28, 2024
82fdcc5
fix: tests
web-mi Mar 28, 2024
28e3017
Merge pull request #79 from virtualidentityag/fix/OB-11479-existing-chat
web-mi Mar 28, 2024
72a61e2
fix: undefined consultingType title
janrembold Apr 3, 2024
795b824
fix: stage layout expanding to full screen height
janrembold Apr 3, 2024
1aea32b
fix: sync inconsistency to upstream for stage layout
web-mi Apr 3, 2024
925d53b
fix: fix registration ids set and added error notification
web-mi Apr 3, 2024
7675c8e
Merge pull request #82 from virtualidentityag/fix/DIAKONIE-175
web-mi Apr 3, 2024
2c11deb
Merge pull request #81 from virtualidentityag/fix/DIAKONIE-251-login-…
web-mi Apr 3, 2024
4f56c38
fix: center stage layout and add bottom margin
janrembold Apr 5, 2024
f9b8d17
Merge branch 'develop' into fix/DIAKONIE-251-login-layout-broken
janrembold Apr 8, 2024
50f14b8
fix: linting error
janrembold Apr 8, 2024
a19fc87
Merge pull request #80 from virtualidentityag/fix/DIAKONIE-251-login-…
janrembold Apr 8, 2024
cd56c22
feat: legalLinks in registration
web-mi Apr 8, 2024
8bc65b5
fix: fixed consulting type id 0
web-mi Apr 8, 2024
779d39d
fix: paddings
web-mi Apr 8, 2024
5b6a50d
Merge branch 'develop' into OB-5386
web-mi Apr 8, 2024
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
45 changes: 45 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy storybook to Pages

on:
push:
branches: ['develop']

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: set env
run: |
echo REACT_APP_API_URL=https://dev.diakonie.dev.virtual-identity.com >> $GITHUB_ENV
- name: Run build
run: npm run build-storybook
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './storybook-static'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.env.test.local
.env.production.local
.idea
storybook-static
.storage

# cypress
Expand Down
73 changes: 73 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import type { StorybookConfig } from '@storybook/react-webpack5';
import * as webpackConfigFactory from '../config/webpack.config';
import { Configuration } from 'webpack';

const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-react-i18next'
],
framework: {
name: '@storybook/react-webpack5',
options: {}
},
webpackFinal: async (config, { configType }) => {
// @ts-ignore
const webpackConfig = webpackConfigFactory.default(
configType.toLowerCase()
);

return {
...config,
resolve: {
...config.resolve,
modules: [
...webpackConfig.resolve.modules,
...config.resolve.modules
],
extensions: [
...webpackConfig.resolve.extensions,
...config.resolve.extensions
],
alias: {
...webpackConfig.resolve.alias,
...config.resolve.alias
},
plugins: [...webpackConfig.resolve.plugins]
},
plugins: [...webpackConfig.plugins, ...config.plugins],
module: {
...config.module,
rules: [
// Exclude svg from storybook file-loader
...config.module.rules.map((r: any) => {
if (r.test && /svg/.test(r.test)) {
// Silence the Storybook loaders for SVG files
return { ...r, exclude: /\.svg$/i };
}
return r;
}),
// Filter the last catch all because storybook needs to handle mjs files
...webpackConfig.module.rules.map((r) => {
if (!r.oneOf) {
return r;
}
return {
...r,
oneOf: r.oneOf.filter(
(o) => o.type !== 'asset/resource'
)
};
})
]
}
} as Configuration;
},
docs: {
autodocs: 'tag'
}
};
export default config;
82 changes: 82 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import '../src/resources/styles/styles.scss';
import '../src/resources/styles/mui-variables-mapping.scss';
import i18n from 'i18next';
import { ThemeProvider } from '@mui/material';
import { Preview } from '@storybook/react';
import * as React from 'react';
import theme from '../src/extensions/theme';
import { config } from '../src/resources/scripts/config';
import { LegalLinksProvider } from '../src/globalState/provider/LegalLinksProvider';
import { init, FALLBACK_LNG } from '../src/i18n';
import { BrowserRouter as Router } from 'react-router-dom';
import { Loading } from '../src/components/app/Loading';
import { Suspense } from 'react';
import {
AppConfigContext,
AppConfigProvider,
RegistrationContext
} from '../src/globalState';

export const withMuiTheme = (Story) => (
<Router>
<Suspense fallback={<Loading />}>
<AppConfigContext.Provider value={config}>
<RegistrationContext.Provider
value={{
setDisabledNextButton: () => null,
registrationData: {
agency: null,
agencyId: null,
username: null,
password: null,
zipcode: null,
mainTopic: {
id: 1,
name: 'Topic',
slug: 'topic1',
description: '',
internalIdentifier: 'topic1',
status: '',
createDate: '',
updateDate: ''
},
mainTopicId: 1
}
}}
>
<ThemeProvider theme={theme}>
<LegalLinksProvider legalLinks={[]}>
<Story />
</LegalLinksProvider>
</ThemeProvider>
</RegistrationContext.Provider>
</AppConfigContext.Provider>
</Suspense>
</Router>
);

export const decorators = [withMuiTheme];
init(config.i18n, null);

const preview: Preview = {
parameters: {
i18n,
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
}
},
globals: {
locale: FALLBACK_LNG,
locales: {
de: { icon: '🇩🇪', title: 'Deutsch', right: 'DE' },
en: { icon: '🇺🇸', title: 'Englisch', right: 'EN' }
}
},
decorators: [withMuiTheme]
};

export default preview;
3 changes: 3 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = defineConfig(
_.mergeWith(
{
e2e: {
testIsolation: true,
baseUrl: 'http://localhost:9001',
supportFile: 'cypress/support/e2e.{js,jsx,ts,tsx}',
setupNodeEvents(on, config) {
Expand All @@ -47,6 +48,8 @@ module.exports = defineConfig(
retries: {
runMode: 2
},
experimentalMemoryManagement: true,
numTestsKeptInMemory: 20,
video: false,
chromeWebSecurity: false,
viewportWidth: 1200,
Expand Down
33 changes: 33 additions & 0 deletions cypress/e2e/messages/attachments/base.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { SUB_STREAM_ROOM_MESSAGES } from '../../../../src/components/app/RocketChat';
import {
closeWebSocketServer,
mockWebSocket,
startWebSocketServer
} from '../../../support/websocket';

describe('Messages - Attachments', () => {
before(() => {
startWebSocketServer();
});

after(() => {
closeWebSocketServer();
});

beforeEach(() => {
mockWebSocket();
});

it('should allow to send a message with attachment', () => {
cy.fastLogin();

cy.get('[data-cy=session-list-item]').click();
cy.wait('@sessionRooms');
cy.wait('@messages');

cy.get('.textarea__attachmentInput').attachFile('empty.pdf');
cy.get('.textarea__iconWrapper').click();

cy.wait('@attachmentUpload');
});
});
45 changes: 45 additions & 0 deletions cypress/e2e/messages/attachments/formal.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {
closeWebSocketServer,
mockWebSocket,
startWebSocketServer
} from '../../../support/websocket';

describe('Messages - Attachments - Formal', () => {
before(() => {
startWebSocketServer();
});

after(() => {
closeWebSocketServer();
});

beforeEach(() => {
mockWebSocket();
});

it('should show inline error when quota is reached', () => {
cy.willReturn('attachmentUpload', {
statusCode: 403,
headers: {
'X-Reason': 'QUOTA_REACHED'
}
});

cy.fastLogin();

cy.get('[data-cy=session-list-item]').click();
cy.wait('@messages');

cy.get('.textarea__attachmentInput').attachFile('empty.pdf');
cy.get('.textarea__iconWrapper').click();

cy.wait('@attachmentUpload');

cy.window()
.its('i18n')
.then((i18n) => {
i18n.changeLanguage('cimode');
cy.contains('attachments.error.quota.headline');
});
});
});
49 changes: 49 additions & 0 deletions cypress/e2e/messages/attachments/informal.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {
closeWebSocketServer,
mockWebSocket,
startWebSocketServer
} from '../../../support/websocket';

describe('Messages - Attachments - Informal', () => {
before(() => {
startWebSocketServer();
});

after(() => {
closeWebSocketServer();
});

beforeEach(() => {
mockWebSocket();
});

it('should show inline error when quota is reached', () => {
cy.willReturn('userData', {
formalLanguage: false
});

cy.willReturn('attachmentUpload', {
statusCode: 403,
headers: {
'X-Reason': 'QUOTA_REACHED'
}
});

cy.fastLogin();

cy.get('[data-cy=session-list-item]').click();
cy.wait('@messages');

cy.get('.textarea__attachmentInput').attachFile('empty.pdf');
cy.get('.textarea__iconWrapper').click();

cy.wait('@attachmentUpload');

cy.window()
.its('i18n')
.then((i18n) => {
i18n.changeLanguage('cimode');
cy.contains('attachments.error.quota.headline');
});
});
});
Loading
Loading