Skip to content

Commit

Permalink
feat: build governance UI
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstefanequilobe committed Jun 10, 2022
1 parent 8e15fc8 commit 02da026
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
49 changes: 49 additions & 0 deletions src/store/actions/climateWarehouseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,55 @@ export const updateGovernancePickLists = data => {
};
};

export const initiateGovernance = () => {
return async dispatch => {
try {
dispatch(activateProgressIndicator);

const url = `${constants.API_HOST}/governance`;
const payload = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
};

const response = await fetchWrapper(url, payload);

if (response.ok) {
dispatch(setConnectionCheck(true));
dispatch(
setNotificationMessage(
NotificationMessageTypeEnum.success,
'governance-initiating-please-wait',
),
);
} else {
const errorResponse = await response.json();
dispatch(
setNotificationMessage(
NotificationMessageTypeEnum.error,
formatApiErrorResponse(
errorResponse,
'governance-initiating-failed',
),
),
);
}
} catch {
dispatch(
setNotificationMessage(
NotificationMessageTypeEnum.error,
'governance-initiating-failed',
),
);
dispatch(setConnectionCheck(false));
} finally {
dispatch(deactivateProgressIndicator);
}
};
};

export const updateGovernanceOrgLists = data => {
return async dispatch => {
try {
Expand Down
3 changes: 2 additions & 1 deletion src/translations/tokens/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@
"comment": "Comment",
"governance": "Governance",
"initiate-governance": "Initiate Governance",
"governance-initiating-please0wait": "Your governance body is initiating, please 5 minutes then refresh.",
"governance-initiating-please-wait": "Your governance body is initiating, please 5 minutes then refresh.",
"governance-initiating-failed": "Your governance body could not be initiated.",
"picklists": "All pick lists",
"json-is-valid": "JSON is valid",
"json-not-valid": "Please add valid JSON",
Expand Down
3 changes: 2 additions & 1 deletion src/translations/tokens/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@
"comment": "Comentario",
"governance": "Gobernancia",
"initiate-governance": "Iniciar Gobernanza",
"governance-initiating-please0wait": "Su órgano de gobierno está iniciando, por favor 5 minutos y luego actualice.",
"governance-initiating-please-wait": "Su órgano de gobierno está iniciando, por favor 5 minutos y luego actualice.",
"governance-initiating-failed": "No se pudo iniciar su órgano de gobierno.",
"picklists": "Todas las listas de selección",
"json-is-valid": "JSON es válida",
"json-not-valid": "Agregue JSON válido",
Expand Down
3 changes: 2 additions & 1 deletion src/translations/tokens/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@
"comment": "コメント",
"governance": "Governance",
"initiate-governance": "ガバナンス",
"governance-initiating-please0wait": "ガバナンス機関が開始しています。5分後に更新してください。",
"governance-initiating-please-wait": "ガバナンス機関が開始しています。5分後に更新してください。",
"governance-initiating-failed": "ガバナンス機関を開始できませんでした。",
"picklists": "すべての選択リスト",
"json-is-valid": "JSONは有効です",
"json-not-valid": "JSONは有効です",
Expand Down

0 comments on commit 02da026

Please sign in to comment.