Skip to content

Commit

Permalink
Merge pull request #235 from project-inclusive/develop
Browse files Browse the repository at this point in the history
v1.2.0リリース
  • Loading branch information
Syuparn authored Jan 30, 2024
2 parents 4c1f5ef + 7cf9c7e commit cddc6b1
Show file tree
Hide file tree
Showing 228 changed files with 18,427 additions and 5,366 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8.18 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. Any potentiel difference in patches between jobs will lead to a cache not found error.
python-version: 3.11.6 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. Any potentiel difference in patches between jobs will lead to a cache not found error.
- name: Cache build
id: restore-build
uses: actions/cache@v3
Expand Down Expand Up @@ -39,11 +39,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8.18
python-version: 3.11.6
- name: Cache build
id: restore-build
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
- run: make test
- name: Lint source codes
run: make check-style
# TODO: 複数世帯対応が完了したら以下の指定を外す
continue-on-error: true
- name: Run backend tests
run: make test
3 changes: 3 additions & 0 deletions .github/workflows/test_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: Install packages
run: npm ci
working-directory: ./dashboard
- name: ESLint
run: npm run lint
working-directory: ./dashboard
- name: Prettier
run: npm run pretty:check
working-directory: ./dashboard
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ venv
# debugging images
tools/dependency_graph/dependency_graph
tools/dependency_graph/dependency_graph.png

# チュートリアル時の作成物
openfisca_japan/parameters/チュートリアル
openfisca_japan/tests/チュートリアル
openfisca_japan/variables/チュートリアル
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore artifacts:
build
coverage
.git
.gitignore
node_modules
package-lock.json
*.html
File renamed without changes.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-bullseye
FROM python:3.11-bullseye
USER root

# comment out upgrade pip for avoiding error
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_cloud
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-bullseye
FROM python:3.11-bullseye
USER root

#RUN pip install --upgrade pip
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ build: deps
check-syntax-errors:
python -m compileall -q .

format-style:
format-style: encode-jananese-filename
@# Do not analyse .gitignored files.
@# `make` needs `$$` to output `$`. Ref: http://stackoverflow.com/questions/2382764.
autopep8 `git ls-files | grep "\.py$$"`

check-style:
check-style: encode-jananese-filename
@# Do not analyse .gitignored files.
@# `make` needs `$$` to output `$`. Ref: http://stackoverflow.com/questions/2382764.
flake8 `git ls-files | grep "\.py$$"`
pylint `git ls-files | grep "\.py$$"`
@# check variables meet openfisca coding style
@# `grep` cannot be used here because it ignores Japanese file names.
ruff check

lint: clean check-syntax-errors check-style

Expand All @@ -51,3 +53,7 @@ serve-public:

calc:
curl -s -X POST -H "Content-Type: application/json" -d @calculate_api_example.json http://localhost:50000/calculate | jq .

encode-jananese-filename:
@# disable Japanese filename escape (by default Japanese characters are printed as `\346\211\200\345\276\227.py`)
git config --local core.quotepath false
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
- 障害児童育成手当(東京都)
- 重度心身障害者手当(東京都)
- 受験生チャレンジ支援貸付事業(東京都)
- 災害弔慰金(能登半島地震被災地)
- 災害障害見舞金(能登半島地震被災地)
- 被災者生活再建支援制度(能登半島地震被災地)
- 災害援護資金(能登半島地震被災地)

## 作成Webアプリ
[支援みつもりヤドカリくん](https://shien-yadokari.netlify.app/)に作成されたWebアプリが公開されています。
Expand Down
4 changes: 2 additions & 2 deletions calculate_api_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
}
}
},
"世帯": {
"世帯一覧": {
"世帯1": {
"自分一覧": ["太郎"],
"親一覧": ["太郎"],
"子一覧": ["一郎", "二郎"],
"児童手当": {
"2022-06": null,
Expand Down
57 changes: 57 additions & 0 deletions dashboard/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module.exports = {
settings: {
react: {
version: 'detect',
},
},
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
},
ignorePatterns: [
'build/',
'public/',
'**/node_modules/',
'*.config.js',
'.*lintrc.js',
'/*.*',
],
};
2 changes: 1 addition & 1 deletion dashboard/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ coverage
.gitignore
node_modules
package-lock.json
*.html
**/*.html
1 change: 1 addition & 0 deletions dashboard/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
12 changes: 9 additions & 3 deletions dashboard/cypress/e2e/DetailedCalculation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ describe('Renders main page and ', () => {

it('navigates to detailed calculate page', () => {
cy.contains('支援みつもりヤドカリくん');
cy.contains('くわしく計算');
cy.get('.css-1icvf0w').contains('くわしく計算').click();
cy.contains('くわしく見積もり');
cy.get('.css-1icvf0w').contains('くわしく見積もり').click();

cy.contains('利用規約に同意します。');
cy.get('.css-hrbmuv').contains('利用規約に同意します。').click();
cy.contains('利用開始する');
cy.get('.css-uwksks').contains('利用開始する').click();

cy.url().should('include', '/calculate');
cy.contains('あなたについて');
cy.contains('くわしく計算');
cy.contains('くわしく見積もり');
});
});
8 changes: 4 additions & 4 deletions dashboard/cypress/e2e/Homepage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ describe('Loads homepage', () => {
cy.contains('支援みつもりヤドカリくん');
});

it('Renders かんたん計算 button', () => {
cy.contains('かんたん計算');
it('Renders かんたん見積もり button', () => {
cy.contains('かんたん見積もり');
});

it('Renders くわしく計算 button', () => {
cy.contains('くわしく計算');
it('Renders くわしく見積もり button', () => {
cy.contains('くわしく見積もり');
});
});
10 changes: 8 additions & 2 deletions dashboard/cypress/e2e/SimpleCalculation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ describe('Renders main page and ', () => {

it('navigates to simple calculate page, fill in mandatory fields', () => {
cy.contains('支援みつもりヤドカリくん');
cy.contains('かんたん計算');
cy.get('.css-s00sbd').contains('かんたん計算').click();
cy.contains('かんたん見積もり');
cy.get('.css-s00sbd').contains('かんたん見積もり').click();

cy.contains('利用規約に同意します。');
cy.get('.css-hrbmuv').contains('利用規約に同意します。').click();
cy.contains('利用開始する');
cy.get('.css-uwksks').contains('利用開始する').click();

cy.url().should('include', '/calculate-simple');
cy.contains('あなたについて');

Expand Down
19 changes: 11 additions & 8 deletions dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<head>
<title>支援みつもりヤドカリくん</title>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HZ0PSM326S"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-HZ0PSM326S');
</script>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','%=YADOKARI_GTM_ID%');</script>
<!-- End Google Tag Manager -->

<meta charset="UTF-8" />
<meta
Expand Down Expand Up @@ -70,6 +69,10 @@
/>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=%=YADOKARI_GTM_ID%"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Expand Down
Loading

0 comments on commit cddc6b1

Please sign in to comment.