Skip to content

Commit

Permalink
fix lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hadijahkyampeire committed Dec 14, 2023
1 parent 3fd2ed6 commit 310c764
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React, { useState, useEffect } from "react";
import { showToast, UserHasAccess, useStore } from "@openmrs/esm-framework";
import {
implementerToolsStore,
showModuleDiagnostics,
togglePopup,
} from "./store";
import React, { useState, useEffect } from 'react';
import { showToast, UserHasAccess, useStore } from '@openmrs/esm-framework';
import { implementerToolsStore, showModuleDiagnostics, togglePopup } from './store';

import { useBackendDependencies } from './backend-dependencies/useBackendDependencies';
import { hasInvalidDependencies } from './backend-dependencies/openmrs-backend-dependencies';
Expand All @@ -30,10 +26,10 @@ function PopupHandler() {
if (shouldShowNotification) {
showToast({
critical: false,
kind: "error",
kind: 'error',
description: t(
"checkImplementerToolsMessage",
"Check the Backend Modules tab in the Implementer Tools for more details"
'checkImplementerToolsMessage',
'Check the Backend Modules tab in the Implementer Tools for more details',
),
title: t('modulesWithMissingDependenciesWarning', 'Some modules have unresolved backend dependencies'),
actionButtonLabel: t('viewModules', 'View modules'),
Expand Down
16 changes: 5 additions & 11 deletions packages/framework/esm-globals/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,7 @@ export interface ShowToastEvent {
/** @category UI */
export interface ShowSnackbarEvent {
subtitle?: any;
kind?:
| "error"
| "info"
| "info-square"
| "success"
| "warning"
| "warning-alt";
kind?: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
title: string;
actionButtonLabel?: string | any;
onActionButtonClick?: () => void;
Expand All @@ -82,10 +76,10 @@ export interface ShowSnackbarEvent {
timeoutInMs?: number;
}

const notificationShownName = "openmrs:notification-shown";
const actionableNotificationShownName = "openmrs:actionable-notification-shown";
const toastShownName = "openmrs:toast-shown";
const snackbarShownName = "openmrs:snack-bar-shown";
const notificationShownName = 'openmrs:notification-shown';
const actionableNotificationShownName = 'openmrs:actionable-notification-shown';
const toastShownName = 'openmrs:toast-shown';
const snackbarShownName = 'openmrs:snack-bar-shown';

export function dispatchNotificationShown(data: ShowNotificationEvent) {
window.dispatchEvent(new CustomEvent(notificationShownName, { detail: data }));
Expand Down
4 changes: 2 additions & 2 deletions packages/framework/esm-globals/src/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export {
subscribeActionableNotificationShown,
subscribeToastShown,
subscribeSnackbarShown,
} from "./events";
export * from "./types";
} from './events';
export * from './types';
26 changes: 13 additions & 13 deletions packages/framework/esm-styleguide/src/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
@import '@carbon/charts/styles.css';
@import './vars';

@import "./components/general";
@import "./components/canvas";
@import "./components/colors";
@import "./components/breadcrumbs";
@import "./components/main-content";
@import "./icons/icons";
@import "./logo/logo";
@import "./spinner/spinner";
@import "./notifications/notifications";
@import "./notifications/actionable-notifications";
@import "./toasts/toasts";
@import "./snackbars/snackbars";
@import "./modals/modals";
@import './components/general';
@import './components/canvas';
@import './components/colors';
@import './components/breadcrumbs';
@import './components/main-content';
@import './icons/icons';
@import './logo/logo';
@import './spinner/spinner';
@import './notifications/notifications';
@import './notifications/actionable-notifications';
@import './toasts/toasts';
@import './snackbars/snackbars';
@import './modals/modals';

@import './overrides';
18 changes: 9 additions & 9 deletions packages/framework/esm-styleguide/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { setupBranding } from './brand';
import { defineConfigSchema } from '@openmrs/esm-framework';
import { esmStyleGuideSchema } from './config-schema';

export * from "./breakpoints";
export * from "./spinner";
export * from "./notifications";
export * from "./toasts";
export * from "./snackbars";
export * from "./modals";
export * from "./left-nav";
export * from "./error-state";
export * from "./datepicker";
export * from './breakpoints';
export * from './spinner';
export * from './notifications';
export * from './toasts';
export * from './snackbars';
export * from './modals';
export * from './left-nav';
export * from './error-state';
export * from './datepicker';

defineConfigSchema('@openmrs/esm-styleguide', esmStyleGuideSchema);
setupBranding();
Expand Down
27 changes: 9 additions & 18 deletions packages/framework/esm-styleguide/src/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@ export { type NotificationDescriptor, type InlineNotificationType } from './noti
export {
type ActionableNotificationDescriptor,
type ActionableNotificationType,
} from "./notifications/actionable-notification.component";
export { showToast } from "./toasts";
export { showModal } from "./modals";
export {
type ToastDescriptor,
type ToastType,
type ToastNotificationMeta,
} from "./toasts/toast.component";
export { showSnackbar } from "./snackbars";
export {
type SnackbarDescriptor,
type SnackbarType,
type SnackbarMeta,
} from "./snackbars/snackbar.component";

export * from "./left-nav";
export * from "./error-state";
export * from "./datepicker";
} from './notifications/actionable-notification.component';
export { showToast } from './toasts';
export { showModal } from './modals';
export { type ToastDescriptor, type ToastType, type ToastNotificationMeta } from './toasts/toast.component';
export { showSnackbar } from './snackbars';
export { type SnackbarDescriptor, type SnackbarType, type SnackbarMeta } from './snackbars/snackbar.component';
export * from './left-nav';
export * from './error-state';
export * from './datepicker';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @module @category UI */
import React, { useEffect, useState, useCallback } from "react";
import { ActionableNotification } from "@carbon/react";
import React, { useEffect, useCallback } from 'react';
import { ActionableNotification } from '@carbon/react';

const defaultOptions = {
millis: 5000,
Expand Down Expand Up @@ -53,10 +53,10 @@ export const Toast: React.FC<ToastProps> = ({ toast, closeToast }) => {
return (
<ActionableNotification
actionButtonLabel={actionButtonLabel}
kind={kind || "info"}
kind={kind || 'info'}
lowContrast={critical}
subtitle={description}
title={title || ""}
title={title || ''}
onActionButtonClick={handleActionClick}
onClose={closeToast}
/>
Expand Down

0 comments on commit 310c764

Please sign in to comment.