Skip to content

Commit

Permalink
Fix/ff offline service worker (#122)
Browse files Browse the repository at this point in the history
* v4 datamodel enum implementation

* identification component, tabs navigation
contactAttempt medium

* identification component
contactOutcomeConfiguration handling
contactAttemptConfiguration handling
navigation refactor

* prevent full package import with destructuration

* remove dead code

* ES2020 syntax

* syntax update

* transmission controls handle identification

* extends data managed by identification hook
minor graphical/typo fixes

* identification questionnaire internal state OK

* missing answer

* selected tab text color

* fix identification component when no data

* IASCO transmission control implementation
log removal

* fix undefined identification evaluation

* fix enum entry for API compliance

* identification generate valid starting state

* typo

* label changes

* prevent tab switching when saving

* fix transmission control

* fix panel navigation

* save each identification

* filter contactOutcome by COconfiguration

* UI refactor

* fix contact outcome enums by medium

* fix enum typo for API compliance

* fix selected question highlight
prevent valid answers erasure

* update identification tab label

* sticky tabs bar & prevent overlap on scrolls

* extend comment length

* new GUI components

* fix background color in UE page

* GUI improvements : nex compos & CSS

* remove previous component

* remove unused dictionnary entries

* split info in column

* update contact data display

* update contact component display

* fuse individual, phone, mail forms

* new components graphical enhancement

* GUI AppBar update

* contact[attempt/ouctome] GUI update

* minor code fix

* remove unused imports

* update infoTile test : minr GUI change

* GUI forms refactor - WIP

* user form birthdate change fix

* fixes

* working phoneNumber

* prevent updating fiscal/directory phone numbers

* fix missing phone number crash

* theme integration for buttons

* delete phoneNumbers
lateral menu css fix
email edition fix
birthdate display fix

* remove unused import

* itw phone number duplicate removal

* fix transmission control

* GUI fixes

* CSS clean-up, dead code removal

* rename folder

* CSS, fix default contactoutcome

* remove unused components

* address form refactor

* CSS i18n new address data function

* infoTile text overflow

* fix minor bug

* fix tests

* Migration vite & DramaQueen integration (#109)

* change extension js -> jsx

* remove jsx extension in custom hook

* vite migration

:warning:  The build path is now dist

* Update package.json

* let output dir as build

* remove react script

* migration jest to vitest

* revert changes in ci and script related to dist path

* make service worker works

* drama queen integration

* make build esnext

* endpoint service worker

* disable queen healthcheck when synchronize

* remove code smell in vite.config.js

* remove k8s files

* bump version 1.0.0

* Service worker update, retro compatibility with prod (#111)

* update sw

* retro compatibility with service worker

we must be retrocompatible with service worker already loaded in user navigator so the update works

* bump version to 1.0.1

* fix: upgrade workbox version for FF compliance

---------

Co-authored-by: Nicolas Turban <[email protected]>
Co-authored-by: Dylan Decrulle <[email protected]>
  • Loading branch information
3 people authored Sep 14, 2023
1 parent 8ef6f31 commit 217044d
Show file tree
Hide file tree
Showing 104 changed files with 2,772 additions and 9,932 deletions.
42 changes: 22 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
build
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
23 changes: 0 additions & 23 deletions deployment.yml

This file was deleted.

26 changes: 26 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="/static/images/logo-insee-header.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" />

<script type="text/javascript"
src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js"></script>
<title>Collecte Enquêteurs</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="./src/index.jsx"></script>
</body>

</html>
18 changes: 0 additions & 18 deletions ingress.yml

This file was deleted.

2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"compilerOptions": {
"baseUrl": "./src"
"baseUrl": "src"
}
}
31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pearl",
"version": "0.6.0",
"version": "1.0.2",
"private": true,
"dependencies": {
"@date-io/date-fns": "1.x",
Expand All @@ -24,19 +24,19 @@
"react-dom": "^17.0.2",
"react-modal": "^3.11.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-swipeable-views": "^0.14.0",
"workbox-cacheable-response": "^5.1.3",
"workbox-core": "^5.1.3",
"workbox-precaching": "^5.1.3",
"workbox-routing": "^5.1.3",
"workbox-strategies": "^5.1.3"
"workbox-cacheable-response": "^7.0.0",
"workbox-core": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0"
},
"scripts": {
"start": "react-scripts start ",
"build": "react-scripts build && copy-and-watch configuration/configuration.json build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"dev": "vite",
"build": "vite build && copy-and-watch configuration/configuration.json build",
"preview": "vite preview",
"format": "prettier --write .",
"test": "vitest"
},
"eslintConfig": {
"extends": [
Expand Down Expand Up @@ -98,8 +98,10 @@
]
},
"devDependencies": {
"@originjs/vite-plugin-federation": "^1.2.1",
"@types/react": "^16.9.23",
"@types/react-router-dom": "^5.1.3",
"@vitejs/plugin-react": "^3.1.0",
"copy-and-watch": "^0.1.4",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
Expand All @@ -111,7 +113,12 @@
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest-sonar-reporter": "^2.0.0",
"jsdom": "^21.1.1",
"prettier": "^1.19.1",
"react-test-renderer": "^17.0.2"
"react-test-renderer": "^17.0.2",
"vite": "^4.2.1",
"vite-plugin-pwa": "^0.14.7",
"vite-tsconfig-paths": "^3.6.0",
"vitest": "^0.29.7"
}
}
44 changes: 0 additions & 44 deletions public/index.html

This file was deleted.

11 changes: 0 additions & 11 deletions service.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/Root.js → src/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export const AppContext = React.createContext();

function Root() {
const { configuration } = useConfiguration();
useQueenFromConfig(configuration);

const [online, setOnline] = useState(navigator.onLine);

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ const Navigation = ({ textSearch, setTextSearch, setOpenDrawer }) => {
};
export default Navigation;
Navigation.propTypes = {
location: PropTypes.shape({
pathname: PropTypes.string.isRequired,
}).isRequired,
textSearch: PropTypes.string.isRequired,
setTextSearch: PropTypes.func.isRequired,
setOpenDrawer: PropTypes.func.isRequired,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`renders correctly 1`] = `
<body>
<div>
<div
class="MuiPaper-root MuiCard-root makeStyles-root-1 MuiPaper-elevation0 MuiPaper-rounded"
>
<div
class="MuiCardContent-root makeStyles-column-3"
>
<div
class="makeStyles-row-2"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
/>
</svg>
<p
class="MuiTypography-root makeStyles-bold-7 makeStyles-overflow-8 MuiTypography-body1"
>
FirstName LastName
</p>
</div>
<div
class="makeStyles-row-2"
>
<p
class="MuiTypography-root makeStyles-rounded-6 makeStyles-title-4 MuiTypography-body1 MuiTypography-colorTextSecondary MuiTypography-alignCenter"
>
1
</p>
<p
class="MuiTypography-root makeStyles-title-4 makeStyles-overflow-8 MuiTypography-body1 MuiTypography-colorTextSecondary"
>
Mocked campaign
</p>
</div>
<h6
class="MuiTypography-root makeStyles-title-4 makeStyles-bold-7 MuiTypography-h6 MuiTypography-colorError"
>
# 1
</h6>
</div>
</div>
</div>
</body>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@ import React from 'react';
import { SurveyUnitProvider } from '../UEContext';
import { act } from 'react-dom/test-utils';
import { render } from '@testing-library/react';
import { vi } from 'vitest';

jest.mock('utils/hooks/database', () => ({
useSurveyUnit: () => ({
id: '1',
persons: [{ firstName: 'FirstName', lastName: 'LastName', privileged: true }],
campaign: 'Mocked campaign',
sampleIdentifiers: { ssech: '1' },
}),
}));
vi.mock('utils/hooks/database', () => {
return {
default: {
useSurveyUnit: () => ({
id: '1',
persons: [{ firstName: 'FirstName', lastName: 'LastName', privileged: true }],
campaign: 'Mocked campaign',
sampleIdentifiers: { ssech: '1' },
}),
},
};
});

const dataBaseHooks = require('utils/hooks/database');
import dataBaseHooks from 'utils/hooks/database';

const mockSurveyUnit = {
id: '1',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 0 additions & 17 deletions src/components/panel-body/queen-container/component.js

This file was deleted.

Loading

0 comments on commit 217044d

Please sign in to comment.