Skip to content

Commit

Permalink
notificationsAdded + final commit 00
Browse files Browse the repository at this point in the history
  • Loading branch information
adityadeshlahre committed Jun 6, 2024
1 parent 69c3d0e commit 4cb7473
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions frontend/src/components/admin/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
Settings,
ListDropdown,
CicsSystemGroup,
QrCode,
} from "@carbon/icons-react";
import PathRoute from "../utils/PathRoute";
import CalculatedValue from "./calculatedValue/CalculatedValueForm";
Expand All @@ -36,6 +37,7 @@ import { CommonProperties } from "./menu/CommonProperties";
import ConfigMenuDisplay from "./formEntry/common/ConfigMenuDisplay";

import ProviderMenu from "./ProviderMenu/ProviderMenu";
import BarcodeConfiguration from "./barcodeConfiguration/BarcodeConfiguration";

function Admin() {
const intl = useIntl();
Expand Down Expand Up @@ -63,6 +65,9 @@ function Admin() {
<SideNavLink renderIcon={CicsSystemGroup} href="#providerMenu">
<FormattedMessage id="provider.browse.title" />
</SideNavLink>
<SideNavLink renderIcon={QrCode} href="#barcodeConfiguration">
<FormattedMessage id="sidenav.label.admin.barcodeconfiguration" />
</SideNavLink>
<SideNavMenu
title={intl.formatMessage({ id: "sidenav.label.admin.menu" })}
renderIcon={TableOfContents}
Expand Down Expand Up @@ -145,6 +150,9 @@ function Admin() {
<PathRoute path="#providerMenu">
<ProviderMenu />
</PathRoute>
<PathRoute path="#barcodeConfiguration">
<BarcodeConfiguration />
</PathRoute>
<PathRoute path="#globalMenuManagement">
<GlobalMenuManagement />
</PathRoute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,20 @@ function BarcodeConfiguration() {
<Section>
<Form onSubmit={handleModify}>
<Column lg={16} md={8} sm={4}>
<Button disabled={saveButton} type="submit">
<Button
disabled={saveButton}
onClick={() => {
setNotificationVisible(true);
addNotification({
kind: NotificationKinds.success,
title: intl.formatMessage({
id: "notification.title",
}),
message: "BarCode Configurations has been saved.",
});
}}
type="submit"
>
<FormattedMessage id="label.button.save" />
</Button>{" "}
<Button
Expand Down
1 change: 1 addition & 0 deletions frontend/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@
"provider.telephone": "Telephone",
"provider.fax": "Fax",
"barcodeconfiguration.browse.title": "Barcode Configuration",
"sidenav.label.admin.barcodeconfiguration": "Barcode Configuration",
"siteInfo.section.number": "Number Bar Code Label",
"siteInfo.title.default.barcode": "Default Bar Code Labels",
"siteInfo.title.max.barcode": "Maximum Bar Code Labels",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@
"provider.telephone": "Téléphone",
"provider.fax": "Fax",
"breadcrums.admin.managment": "Gestion d'administration",
"sidenav.label.admin.barcodeconfiguration": "Gestion d'administration",
"siteInfo.title.default.barcode.specimen": "Échantillon",
"siteInfo.title.default.barcode.order": "Commande",
"siteInfo.title.default.barcode.block": "Bloc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
Expand Down Expand Up @@ -153,7 +154,7 @@ private void setFields(BarcodeConfigurationForm form) {

@PostMapping(value = "/BarcodeConfiguration")
public Object barcodeConfigurationSave(HttpServletRequest request,
@ModelAttribute("form") @Valid BarcodeConfigurationForm form, BindingResult result,
@RequestBody @Valid BarcodeConfigurationForm form, BindingResult result,
RedirectAttributes redirectAttributes) {
if (!form.getPrePrintDontUseAltAccession()
&& GenericValidator.isBlankOrNull(form.getPrePrintAltAccessionPrefix())) {
Expand Down

0 comments on commit 4cb7473

Please sign in to comment.