Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
glibersat committed May 13, 2024
2 parents 4a9de18 + 38873c1 commit 87924c5
Show file tree
Hide file tree
Showing 233 changed files with 27,477 additions and 21,230 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[flake8]
max-line-length = 88
exclude = .git,__pycache__,settings

4 changes: 2 additions & 2 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:

steps:
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v4.1.5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ venv
screenshots
.idea
.tool-versions
.python-version
.env

## Ignore Jupyter Notebooks files
Expand All @@ -43,3 +44,5 @@ notebooks/**/.ipynb_checkpoints/
dsrc_doc/*.md
!dsrc_doc/README.md

docker/docker-compose.local.yml
**/.vite
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.2.2"
rev: "v0.4.3"
hooks:
- id: ruff
- repo: https://github.com/PyCQA/bandit
Expand All @@ -19,3 +19,8 @@ repos:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.16.0"
hooks:
- id: django-upgrade
args: [--target-version, "5.0"]
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
**/*.html
recoco/apps/**/*.html
recoco/templates/**/*.html
recoco/templates/**/*.html
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
recursive-include recoco/static *.*
recursive-include recoco/frontend/dist/ *.*
recursive-exclude recoco/frontend/modules *.*
recursive-exclude recoco/frontend/node_modules *.*
recursive-include recoco/apps/home/static *.*
recursive-include recoco/apps/projects *.txt
recursive-include recoco/apps/projects *.md
Expand All @@ -9,4 +10,5 @@ recursive-include recoco/apps/resources/static *.*
recursive-include recoco/apps/survey/static *.*
recursive-include recoco/apps/resources *.md
recursive-include recoco/sql/ *.sql
recursive-include recoco *.html
recursive-include recoco/apps/ *.html
recursive-include recoco/templates *.html
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,24 @@ Initialisez ou synchronisez la base de données en tapant :

*Les commandes suivantes ne sont pas nécessaire si vous êtes avec Docker.*

Pour lancer l'applicatif en mode `développement`, générez les statiques à l'aide de :
Pour lancer l'applicatif en mode `développement`:

- compilez le module `dsrc_ui`:

```sh
cd recoco/frontend/modules/dsrc_ui
yarn install
yarn build
```

- installez les dépendances:

```sh
cd recoco/frontend
yarn install
```

- montez le serveur dev des static sur le port 3000:

```sh
cd recoco/frontend && yarn dev
Expand Down
2 changes: 1 addition & 1 deletion data/geomatics.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docker/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"workspaceFolder": "/workspace",

// Set *default* container specific settings.json values on container create.
"settings": {
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
NODE_VERSION: "lts/*"
volumes:
- ..:/workspace:cached
working_dir: /workspace/recoco/frontend
working_dir: /workspace/recoco/frontend
command: bash -c "yarn install && yarn dev"
ports:
- 3000:3000
Expand Down
2 changes: 1 addition & 1 deletion docs/permissions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Projects

There are 3 permission levels::
- **Read-only** : you can only see some info (mostly public) about a project.
- **Manage** : you can manage a project, except for internal team data.
- **Manage** : you can manage a project, except for internal team data.
- **Administrate** : you can administrate most of the data of a project, except for
site-level administrator data

Expand Down
8 changes: 4 additions & 4 deletions docs/workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Conversations externes

"Message d'un collaborateur" -> "N: aiguilleurs du projet";


}

Conversations internes
Expand All @@ -66,7 +66,7 @@ Conversations internes
"N: aiguilleurs du projet"[shape="diamond"];

"Message d'un aiguilleur" -> "N: aiguilleurs du projet";

}


Expand All @@ -83,7 +83,7 @@ A chaque nouvelle notification
"Emission d'une notification" -> "Ajouter aux notifications de l'usager" [label="pour chaque usager souscrit aux notifications du projet"];

"Ajouter aux notifications de l'usager" -> "Envoyer un mail immédiatement" [label="si notification email immédiate activée"];

}


Expand All @@ -97,5 +97,5 @@ Toutes les semaines
"Pour chaque notification personnelles non envoyées par email" -> "Compiler" [label="si résumé par email activé"];

"Compiler" -> "Envoyer un mail de résumé immédiatement";

}
52 changes: 26 additions & 26 deletions frontend_tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
overrides: [
{
env: {
node: true
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script'
}
}
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always']
}
env: {
browser: true,
es2021: true,
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
},
};
12 changes: 6 additions & 6 deletions frontend_tests/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"trailingComma": "es5",
"useTabs": true,
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
"trailingComma": "es5",
"useTabs": false,
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
2 changes: 1 addition & 1 deletion frontend_tests/cypress/e2e/auth/loginWithUi.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import users from '../../fixtures/users/users.json'


describe('The Login Page', () => {

let currentUser = {}

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
describe('As a visitor, I can access the menu and content on different devices', () => {
const testLayouts = ['phone', 'tablet', 'desktop'];
const breakpoint = 690
const testLayouts = ['phone', 'tablet', 'desktop'];
const breakpoint = 690;

before(() => {
cy.visit(`/`);
cy.acceptCookies()
});
before(() => {
cy.visit(`/`);
cy.acceptCookies();
});

testLayouts.forEach((testItem) => {
testLayouts.forEach((testItem) => {
it(`displays correctly on a ${testItem}`, () => {
cy.fixture('utils/devices').then((testDevices) => {
const devices = testDevices.devices.filter(
({ layout }) => layout === testItem
);
const layouts = testDevices.layouts.find(
({ name }) => name === testItem
);

it(`displays correctly on a ${testItem}`, () => {
cy.fixture('utils/devices').then((testDevices) => {
const devices = testDevices.devices.filter(({layout})=> layout === testItem);
const layouts = testDevices.layouts.find(({name})=> name === testItem);
devices.forEach(({ dimensions }) => {
const [width, height] = dimensions;
let menuIsHidden = breakpoint > width;

devices.forEach(({ dimensions }) => {
const [width, height] = dimensions;
let menuIsHidden = breakpoint > width;

layouts.config.forEach((orientation) => {
cy.visit(`/`);
if(orientation === "portrait") {
cy.viewport(width, height)
}
if(orientation === "landscape") {
cy.viewport(height, width)
menuIsHidden = breakpoint > height;
}
// Test here
if(menuIsHidden) {
cy.get('[data-test-id="secondary-menu"]').should('not.be.visible')
cy.get('[data-test-id="toggler-secondary-menu"]').should('be.visible').click()
cy.get('[data-test-id="secondary-menu"]').find('[data-test-id="link-ressources"]').should('be.visible')
cy.get('[data-test-id="toggler-secondary-menu"]').click()
} else {
cy.get('[data-test-id="secondary-menu"]').should('be.visible')
cy.get('[data-test-id="secondary-menu"]').find('[data-test-id="link-ressources"]').should('be.visible')
}
});
});
})
});
layouts.config.forEach((orientation) => {
cy.visit(`/`);
if (orientation === 'portrait') {
cy.viewport(width, height);
}
if (orientation === 'landscape') {
cy.viewport(height, width);
menuIsHidden = breakpoint > height;
}
// Test here
if (menuIsHidden) {
cy.get('[data-test-id="secondary-menu"]').should(
'not.be.visible'
);
cy.get('[data-test-id="toggler-secondary-menu"]')
.should('be.visible')
.click();
cy.get('[data-test-id="secondary-menu"]')
.find('[data-test-id="link-ressources"]')
.should('be.visible');
cy.get('[data-test-id="toggler-secondary-menu"]').click();
} else {
cy.get('[data-test-id="secondary-menu"]').should('be.visible');
cy.get('[data-test-id="secondary-menu"]')
.find('[data-test-id="link-ressources"]')
.should('be.visible');
}
});
});
});
});
});
})
});
Loading

0 comments on commit 87924c5

Please sign in to comment.