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

#patch (2295) Ajouter une colonne indiquant si une action financée RB est présente #1071

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

ch-benard
Copy link
Contributor

🧾 Ticket Trello

https://trello.com/c/SVMFGvge/XXX

🛠 Description de la PR

  • Dans l'export des sites, ajouter une colonne indiquant si une action financée RB est présente.
  • N'afficher la colonne qui si l'utilisateur a le droit d'accès en lecture aux actions

🚨 Notes pour la mise en production

  • ràs

@ch-benard ch-benard self-assigned this Dec 20, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibilité de créer un type spécifique qui serait utilisé dans Action.d.ts et Shantytown.d.ts:

export type FinancedShantytownAction = {
    shantytown_id?: number,
    hasAtLeastOneActionFinanced: boolean,
};


const clauseGroup = where().can(user).do('read', 'action');
const passedYear = moment(date).format('YYYY');
const townsWithFinancedActions = await actionModel.fetchFinancedActionsByYear(null, parseInt(passedYear, 10), clauseGroup);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type ActionSelectRow[]?

const clauseGroup = where().can(user).do('read', 'action');
const passedYear = moment(date).format('YYYY');
const townsWithFinancedActions = await actionModel.fetchFinancedActionsByYear(null, parseInt(passedYear, 10), clauseGroup);
const transformedShantytowns = enrichShantytown(townsWithFinancedActions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type FinancedShantytownAction[]?


const clauseGroup = where().can(user).do('read', 'action');
const currentYear = moment(new Date()).format('YYYY');
const townsWithFinancedActions = await actionModel.fetchFinancedActionsByYear(null, parseInt(currentYear, 10), clauseGroup);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type ActionSelectRow[]?

const clauseGroup = where().can(user).do('read', 'action');
const currentYear = moment(new Date()).format('YYYY');
const townsWithFinancedActions = await actionModel.fetchFinancedActionsByYear(null, parseInt(currentYear, 10), clauseGroup);
const transformedShantytowns = enrichShantytown(townsWithFinancedActions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type FinancedShantytownAction[]?

@@ -0,0 +1,20 @@
import { ActionSelectRow } from '#server/models/actionModel/fetchByShantytown/fetchFinancedActionsByYear';

type FinancedShantytownAction = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourrait être sorti dans un fichier de typage à lui tout seul, appelé ici et dans Shantytown.d.ts et Action.d.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants