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

[IA-3443] OUCRC web - create/update #1645

Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
91ae0ff
[IA-3443] OUCRC create - WIP
tdethier Sep 19, 2024
2ddd072
[IA-3443] OUCRC create - WIP
tdethier Sep 19, 2024
855fd46
[IA-3443] OUCRC creation - WIP
tdethier Sep 20, 2024
5461b34
[IA-3443] OUCRC create/update - WIP
tdethier Sep 20, 2024
ca15997
Merge branch 'IA-3389_add-oucrc-permissions' into IA-3443_oucrc-web-c…
tdethier Sep 20, 2024
f7c1a98
[IA-3443] OUCRC create v1.0
tdethier Sep 20, 2024
f1c9630
[IA-3443] OUCRC create/update - WIP
tdethier Sep 25, 2024
a731a71
Merge branch 'IA-2896_add-orgunit-change-request-configuration' into …
tdethier Sep 25, 2024
1650586
clean, types, fixes
beygorghor Sep 26, 2024
37f5601
working good
beygorghor Sep 26, 2024
98b47f2
fix translations and menu duplicate key
beygorghor Sep 26, 2024
fa49f8a
translations issues
beygorghor Sep 26, 2024
fff0020
fix delete
beygorghor Sep 26, 2024
1d91927
Merge branch 'main' into IA-3443_oucrc-web-create-update
beygorghor Sep 26, 2024
0bdc9d0
get group sets
beygorghor Sep 26, 2024
ee18560
align with benjamin
beygorghor Sep 27, 2024
afcb074
[IA-3443] Update editable_fields - WIP
tdethier Sep 27, 2024
8dd775e
fix validation, yup typing for custom command
beygorghor Sep 27, 2024
6307468
fix cypress tests
beygorghor Sep 27, 2024
dc08fb2
Merge branch 'main' into IA-3443_oucrc-web-create-update
beygorghor Sep 27, 2024
20b95e5
fix project filter
beygorghor Sep 27, 2024
7f6ec87
remove unused params
beygorghor Sep 27, 2024
be1007e
rename editable fields
beygorghor Sep 30, 2024
96c1076
filtering types by project
beygorghor Sep 30, 2024
d188755
Merge branch 'IA-2896_add-orgunit-change-request-configuration' into …
beygorghor Sep 30, 2024
662fa0f
code review
beygorghor Oct 1, 2024
be08c36
fix filter button
beygorghor Oct 1, 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
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
],

"rules": {
"prefer-arrow-callback": "error",
beygorghor marked this conversation as resolved.
Show resolved Hide resolved
"react/function-component-definition": "off",
"no-tabs": "off",
"no-console":["error",{"allow":["warn","error"]}],
Expand Down
4 changes: 2 additions & 2 deletions hat/assets/js/apps/Iaso/constants/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { DropdownOptions } from '../types/utils';
import { PluginsContext } from '../utils';
import { useCurrentUser } from '../utils/usersUtils';
import MESSAGES from './messages';
import { CHANGE_REQUEST, CONFIGURATION } from './urls';
import { CHANGE_REQUEST, CHANGE_REQUEST_CONFIG, CONFIGURATION } from './urls';

// !! remove permission property if the menu has a subMenu !!
const menuItems = (
Expand Down Expand Up @@ -206,7 +206,7 @@ const menuItems = (
},
{
label: formatMessage(MESSAGES.configuration),
key: CHANGE_REQUEST,
key: CHANGE_REQUEST_CONFIG,
icon: props => <Settings {...props} />,
subMenu: [
{
Expand Down
26 changes: 11 additions & 15 deletions hat/assets/js/apps/Iaso/constants/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ const orgUnitDetailsLogsParams = paginationPathParamsWithPrefix(LOGS_PREFIX);
const orgUnitDetailsFormsParams = paginationPathParamsWithPrefix(FORMS_PREFIX);

export const CHANGE_REQUEST = 'changeRequest';
export const CHANGE_REQUEST_CONFIG = 'changeRequestConfig';
export const CONFIGURATION = 'configuration';
const ORG_UNITS = 'orgunits';
const ORG_UNITS_CHANGE_REQUEST = `${ORG_UNITS}/${CHANGE_REQUEST}`;
const ORG_UNITS_CONFIGURATION_CHANGE_REQUESTS = `${ORG_UNITS_CHANGE_REQUEST}/${CONFIGURATION}`;
const ORG_UNITS_CHANGE_REQUEST_CONFIG = `${ORG_UNITS}/${CHANGE_REQUEST_CONFIG}`;
const ORG_UNITS_CONFIGURATION_CHANGE_REQUESTS = `${ORG_UNITS_CHANGE_REQUEST_CONFIG}/${CONFIGURATION}`;

// TODO export to blsq-comp
export type RouteConfig = {
Expand Down Expand Up @@ -195,21 +197,9 @@ export const baseRouteConfigs: Record<string, RouteConfig> = {
url: ORG_UNITS_CONFIGURATION_CHANGE_REQUESTS,
params: [
'accountId',
'parent_id',
'groups',
'org_unit_type_id',
'status',
'created_at_after',
'created_at_before',
'forms',
'userIds',
'userRoles',
'withLocation',
'projectIds',
'paymentStatus',
'project_id',
...paginationPathParams,
'paymentIds',
'potentialPaymentIds',
],
},
registry: {
Expand Down Expand Up @@ -350,7 +340,13 @@ export const baseRouteConfigs: Record<string, RouteConfig> = {
},
groupSets: {
url: 'orgunits/groupSets',
params: ['accountId', 'search', 'sourceVersion', 'projectsIds', ...paginationPathParams],
params: [
'accountId',
'search',
'sourceVersion',
'projectsIds',
...paginationPathParams,
],
},
groupSetDetail: {
url: 'orgunits/groupSet',
Expand Down
18 changes: 15 additions & 3 deletions hat/assets/js/apps/Iaso/domains/app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@
"iaso.groups.sourceVersion": "Source version",
"iaso.groups.update": "Update group",
"iaso.groupsets.dialog.delete": "Are you sure you want to delete this groupset?",
"iaso.groupsets.dialog.deleteText":"This operation cannot be undone.",
"iaso.groupsets.groupBelonging": "Groups belonging",
"iaso.groupsets.dialog.deleteText": "This operation cannot be undone.",
"iaso.groupsets.groupBelonging": "Groups belonging",
"iaso.groupsets.validation.field_required": "Ce champ est obligatoire",
"iaso.hospital": "Hospital",
"iaso.instance.coordinate": "Coordinates",
Expand Down Expand Up @@ -595,6 +595,7 @@
"iaso.label.name": "Name",
"iaso.label.needsAuthentication": "Authentification required",
"iaso.label.newOrgUnit": "New org. unit",
"iaso.label.next": "Next",
"iaso.label.no": "No",
"iaso.label.noDifference": "No difference",
"iaso.label.noGeographicalData": "Without geography",
Expand Down Expand Up @@ -900,6 +901,16 @@
"iaso.orgUnitsTypes.projects": "Projects",
"iaso.orgUnitsTypes.subTypesErrors": "A sub org unit type cannot be a parent too ({typeName})",
"iaso.orgUnitsTypes.update": "Update org unit type",
"iaso.oucrc.closedDate": "Closing Date",
"iaso.oucrc.editableReferenceFormIds": "Editable Reference Forms",
"iaso.oucrc.groupSetIds": "Group Sets",
"iaso.oucrc.orgUnitsEditable": "Should OrgUnits of this type be editable?",
"iaso.oucrc.otherGroupIds": "Other Groups",
"iaso.oucrc.oucrcCreateModalTitle": "OrgUnit Change Request Configuration - Creation",
"iaso.oucrc.oucrcCreateModalTitle2": "OrgUnit Change Request Configuration - Creation 2nd step",
"iaso.oucrc.oucrcCreateUpdateModalTitle": "OrgUnit Change Request Configuration - Update",
"iaso.oucrc.possibleParentTypeIds": "Possible New Parent Types",
"iaso.oucrc.possibleTypeIds": "Possible New Types",
"iaso.page.deleteError": "Error removing embedded link",
"iaso.page.deleteSuccess": "Embedded link successfully removed",
"iaso.page.viewpages": "View embedded link. {linebreak} New tab: ctrl + click",
Expand Down Expand Up @@ -1179,6 +1190,7 @@
"iaso.snackBar.fetchFormsError": "An error occurred while fetching forms list",
"iaso.snackBar.fetchFormVersionsError": "An error occurred while fetching form versions",
"iaso.snackBar.fetchGroupsError": "An error occurred while fetching groups list",
"iaso.snackBar.fetchGroupSetsError": "An error occurred while fetching group sets list",
"iaso.snackBar.fetchingLogDetailError": "An error occurred while fetching log details",
"iaso.snackBar.fetchInstanceDictError": "An error occurred while fetching instances list",
"iaso.snackBar.fetchInstanceError": "An error occurred while fetching instance detail",
Expand Down Expand Up @@ -1498,4 +1510,4 @@
"trypelim.permissions.zones": "Zones",
"trypelim.permissions.zones_edit": "Edit zones",
"trypelim.permissions.zones_shapes_edit": "Edit zone shapes"
}
}
12 changes: 12 additions & 0 deletions hat/assets/js/apps/Iaso/domains/app/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@
"iaso.label.name": "Nom",
"iaso.label.needsAuthentication": "Authentification requise",
"iaso.label.newOrgUnit": "Nouvelle unité d'org.",
"iaso.label.next": "Suivant",
"iaso.label.no": "Non",
"iaso.label.noDifference": "Aucune différence",
"iaso.label.noGeographicalData": "Sans données géographiques",
Expand Down Expand Up @@ -900,6 +901,16 @@
"iaso.orgUnitsTypes.projects": "Projets",
"iaso.orgUnitsTypes.subTypesErrors": "Un sous type d'unité d'organisation ne peut pas aussi être parent ({typeName})",
"iaso.orgUnitsTypes.update": "Mettre à jour le type d'unité d'organisation",
"iaso.oucrc.closedDate": "Date de fermeture",
"iaso.oucrc.editableReferenceFormIds": "Formulaires de référence modifiables",
"iaso.oucrc.groupSetIds": "Ensembles de groupes",
"iaso.oucrc.orgUnitsEditable": "Les unités d'organisation de ce type doivent-elles être modifiables ?",
"iaso.oucrc.otherGroupIds": "Autres groupes",
"iaso.oucrc.oucrcCreateModalTitle": "Configuration de demande de changement d'unité d'organisation - Création",
"iaso.oucrc.oucrcCreateModalTitle2": "Configuration de demande de changement d'unité d'organisation - Deuxième étape de création",
"iaso.oucrc.oucrcCreateUpdateModalTitle": "Configuration de demande de changement d'unité d'organisation - Mise à jour",
"iaso.oucrc.possibleParentTypeIds": "Types de parents possibles",
"iaso.oucrc.possibleTypeIds": "Nouveaux types possibles",
"iaso.page.deleteError": "Erreur lors de la suppression du lien intégré",
"iaso.page.deleteSuccess": "Lien intégré supprimée",
"iaso.page.viewpages": "Voir le lien intégré. {linebreak} Nouvel onglet: ctrl + click",
Expand Down Expand Up @@ -1179,6 +1190,7 @@
"iaso.snackBar.fetchFormsError": "Une erreur est survenue en récupérant la liste des formulaires",
"iaso.snackBar.fetchFormVersionsError": "Une erreur est survenue en récupérant les version du formulaire",
"iaso.snackBar.fetchGroupsError": "Une erreur est survenue en récupérant la liste des groupes",
"iaso.snackBar.fetchGroupSetsError": "Une erreur est survenue en récupérant la liste des group sets",
"iaso.snackBar.fetchingLogDetailError": "Une erreur est survenu en récupérant l'historique",
"iaso.snackBar.fetchInstanceDictError": "Une erreur est survenue en récupérant la liste des soumissions",
"iaso.snackBar.fetchInstanceError": "Une erreur est survenue en récupérant le detail de la soumission",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {
useSafeIntl,
} from 'bluesquare-components';

import MESSAGES from '../messages';
import { OrgUnitChangeRequestConfig } from '../types';
import { DeleteIconButton } from '../../../../components/Buttons/DeleteIconButton';
import { useDeleteOrgUnitChangeRequestConfig } from '../hooks/api/useDeleteOrgUnitChangeRequestConfig';
import MESSAGES from '../messages';
import { OrgUnitChangeRequestConfigurationFull } from '../types';

type Props = {
isOpen: boolean;
closeDialog: () => void;
config: OrgUnitChangeRequestConfig;
config: OrgUnitChangeRequestConfigurationFull;
};

const ConfirmDeleteModal: FunctionComponent<Props> = ({
Expand Down
Loading
Loading