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

(feat) Billable Exemption config #503

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

Ogollah
Copy link
Contributor

@Ogollah Ogollah commented Dec 3, 2024

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • I checked for feature overlap with existing widgets.

Summary

What does this PR do?

  • This PR Billable Schema Exemption and preview feature
  • View the existing billable schema exemption in a Tree View
  • Edit and update the schema through a schema editor
  • Allows for input of a dummy schema when no schema exists to ensure a user can quickly start editing and preview the exemptions in the preview tab.

Screenshots

  • Preview

Screenshot from 2024-12-02 22-08-04

*Schema editor
Screenshot from 2024-12-01 18-58-52

None.

Related Issue

None.

Other

None.

@Ogollah Ogollah requested a review from donaldkibet December 3, 2024 17:14
@ojwanganto
Copy link
Contributor

Please share a screenshot of the new look.

@Ogollah
Copy link
Contributor Author

Ogollah commented Dec 4, 2024

The shared Preview screen is the new screen. I tried to maintain the same look as the previous one. The edit schema screen did not change.

@ojwanganto
Copy link
Contributor

ojwanganto commented Dec 4, 2024

The shared Preview screen is the new screen. I tried to maintain the same look as the previous one. The edit schema screen did not change.

This is appropriate to the directory and files' presentation. You can use the default tree view look from carbon. Sorry for taking you round

image

@Ogollah
Copy link
Contributor Author

Ogollah commented Dec 4, 2024

Do you mean without the icons?

<div>
{errors.length && validationOn ? <ErrorMessages /> : null}
<AceEditor
style={{ height: '100vh', width: '100%', border: errors.length ? '3px solid #DA1E28' : 'none' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should extract these syles to scss file

gap: 0.5rem;

:global(.cds--actionable-notification) {
max-width: 38rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be responsive on a small screen

.pagination {
display: flex;
align-items: center;
gap: 0.5rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets use the carbon tokens for size

icon: React.ReactNode;
}

const transformDataToTree = (data: Record<string, any>, parentKey = 'root'): TreeNode[] => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const transformDataToTree = (data: Record<string, any>, parentKey = 'root'): TreeNode[] => {
const transformDataToTree = (data: Record<string, any>, parentKey = 'root'): Array<TreeNode> => {

import useSWRImmutable from 'swr/immutable';
import { openmrsFetch } from '@openmrs/esm-framework';

export function useStandardSchema(key: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we rename this to useExemptionSchema

headers,
body,
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should we combine the functionality in useStandardSchema.tsx and this file to one hook. They all access and manipulate the same endpoint

@@ -46,6 +47,7 @@ const RootComponent: React.FC = () => {
<Route path="/bill-manager" element={<BillManager />} />
<Route path="/charge-items" element={<ChargeItemsDashboard />} />
<Route path="/payment-modes" element={<PaymentModeHome />} />
<Route path="/billable-exemptions" element={<BillableExemptions />} />
Copy link
Contributor

Choose a reason for hiding this comment

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

After this PR is merged. Add a ticket to add control access by adding correct config for it


export interface Schema {
services: {
all: Service[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
all: Service[];
all: Array<Service>

its a nit but that the convention we are using on the project

@donaldkibet
Copy link
Contributor

@Ogollah merging this in to test it out. you can follow up with PR to fix the recommended changes

@donaldkibet donaldkibet enabled auto-merge (squash) December 6, 2024 04:53
@donaldkibet donaldkibet merged commit b40fe59 into palladiumkenya:main Dec 6, 2024
1 check passed
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.

4 participants