Skip to content

Commit

Permalink
Adding hospitals and health systems interfaces (#10)
Browse files Browse the repository at this point in the history
* Created component of svg icon

* Fixed issue of lab record success message

* Change the hover color of delete icon

* Fixed issue for all table if record lenght is zero

* Fixed enrollment search issue

* Fixed active days negative scroller issue

* Fixed issue of delete msg for assets

* Text changes

* Fixed tenant create issue

* Fixed tags view issue for careplan

* Hide the obesity distribution chart

* Image loading fixes

* Fixed edit issue of badge

* Fixed badge create issue

* Fixed issue of schema create

* Text changes

* Added hospital and health system service files.

* Added preliminary code for hospitals

* Fixed tables, create and view routes for Hospital.

* formatting issues

* Fix edit for hospitals

* Adding health-system pipeline

---------

Co-authored-by: RupaliD <rupali.dinde@inflectionzone.com>
  • Loading branch information
kiran-rean and rupali-inflection authored Nov 16, 2023
1 parent c98de9b commit 8550713
Show file tree
Hide file tree
Showing 43 changed files with 2,578 additions and 779 deletions.
19 changes: 12 additions & 7 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
"useTabs": false,
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"endOfLine": "lf",
"bracketSpacing": true,
"printWidth": 120,
"singleAttributePerLine": true,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
43 changes: 22 additions & 21 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@
// for information about these interfaces
// and what to do when importing types
declare namespace App {
interface Locals {
sessionUser: {
sessionId? : string;
userId? : string;
email? : string;
username? : string;
profileImageUrl?: string
fullName? : string;
firstName? : string;
roleId? : string;
}
interface Locals {
sessionUser: {
sessionId ?: string;
userId ?: string;
email ?: string;
username ?: string;
profileImageUrl?: string;
fullName ?: string;
firstName ?: string;
roleId ?: string;
};

// interface PageData {}
// interface Platform {}
}
// interface PageData {}
// interface Platform {}
}

interface Error {
message: string;
code?: number;
userId?: string;
interface Error {
message : string;
code ?: number;
userId ?: string;
stack ?: string;
}

interface PageData {
flash?: { type: 'success' | 'error'; message: string };
}
interface PageData {
flash?: { type: 'success' | 'error'; message: string; };
}
}

3 changes: 2 additions & 1 deletion src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const handleError: HandleServerError = (obj) => {
return {
message: error?.message,
code: code,
userId: sessionUser?.userId ?? null
userId: sessionUser?.userId ?? null,
stack: error?.stack
};
};

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/input-chips.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
function validate() {
if (!inputValue) return false;
if (validation !== void 0 && !validation(inputValue)) return false;
if (validation !== void 0 && !validation()) return false;
if (max !== -1 && value.length >= max) return false;
if (minlength !== -1 && inputValue.length < minlength) return false;
if (maxlength !== -1 && inputValue.length > maxlength) return false;
Expand Down
237 changes: 118 additions & 119 deletions src/lib/components/navbar/navbar.svelte
Original file line number Diff line number Diff line change
@@ -1,119 +1,118 @@
<script lang="ts">
import { page } from '$app/stores';
import Icon from '@iconify/svelte';
import type { DrawerSettings } from '@skeletonlabs/skeleton';
import { AppBar, AppShell, Drawer, getDrawerStore} from '@skeletonlabs/skeleton';
import { afterUpdate, onMount } from 'svelte';
import { navbarMenu, sidebarMenu, type TabDefinition } from './navigation.tabs';
import SettingMenu from './setting.menus.svelte';
import Sidebar from './sidebar.svelte';
export let userId = undefined;
const navbarTabs: TabDefinition[] = navbarMenu(userId);
const sidebarTabs: TabDefinition[] = sidebarMenu(userId);
const drawerStore = getDrawerStore();
function drawerLeftOpen(): void {
const settings: DrawerSettings = {
id: 'leftSidebar',
position: 'left',
width: '800px',
bgDrawer: 'bg-primary-50 text-on-primary-token',
bgBackdrop: 'bg-primary-500/50'
};
drawerStore.open(settings);
}
function drawerRightOpen(): void {
const settings: DrawerSettings = {
id: 'rightSidebar',
position: 'right',
width: '900px',
bgDrawer:
'bg-secondary-50 dark:bg-surface-900 border-l border-l-surface-200 dark:border-l-surface-700 flex flex-col gap-4 p-4'
};
drawerStore.open(settings);
}
function drawerRightClose(): void {
drawerStore.close();
}
let showSidebar = false;
</script>

<AppShell class="w-full">
<svelte:fragment slot="header">
<AppBar
gridColumns="grid-cols-3"
background="bg-secondary-500"
class="text-white"
slotDefault="place-self-center"
slotTrail="place-content-end"
>
<svelte:fragment slot="lead">
<div class="flex items-center">
<img class="block w-10 ml-2" src="/rean-logo-white.png" alt="REAN" />
<div class="relative ml-6 w-64 max-[450px]:w-40">
<input type="text" class="input pl-10" placeholder="Search" />
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
<Icon icon="material-symbols:search-rounded" class="text-lg text-primary-300" />

</div>
</div>
</div>
</svelte:fragment>
<svelte:fragment slot="trail">
<button
on:click={() => (showSidebar = !showSidebar)}
class="md:hidden btn btn-icon p-1 rounded hover:bg-white/10 text-white"
>
<Icon icon="material-symbols:menu-rounded" class="text-3xl" />
</button>

<button
class="btn p-1 rounded hover:bg-white/10 text-white mr-6"
on:click={drawerRightOpen}
>
<!-- <Icon icon="material-symbols:person-outline-rounded" class="text-3xl" /> -->
<img class="w-8 ml-2 text-lg invert dark:filter-none" src="/user.png" alt="" />
</button>
</svelte:fragment>
</AppBar>
</svelte:fragment>
<svelte:fragment slot="sidebarLeft">
<Sidebar {userId} bind:showSidebar />
</svelte:fragment>
<div class="m-4 md:m-8">
<slot />
</div>
<svelte:fragment slot="footer">
<p class="bg-secondary-500 text-center p-2">
<a href="https://reanfoundation.org" class="!text-white">&#xa9; 2022 REAN Foundation</a>
</p>
</svelte:fragment>
</AppShell>

<Drawer>
{#if $drawerStore.id === 'rightSidebar'}
<SettingMenu on:click={drawerRightClose} on:logout />
{:else if $drawerStore.id === 'leftSidebar'}
<div class="grid justify-center w-60 space-y-4 mt-5">
{#each sidebarTabs as t}
<a
href={t.path}
class="hover:bg-surface-700 hover:text-white p-2 hover:no-underline text-start no-underline rounded-md text-md font-medium
{$page.url.pathname == t.path ? 'active: bg-surface-800 ' : 'text-white'}">{t.name}</a
>
{/each}
{#each navbarTabs as t}
<a
href={t.path}
class="hover:bg-surface-700 lg:hidden sm:first:hidden hover:text-white p-2 hover:no-underline text-start no-underline rounded-md text-md font-medium
{$page.url.pathname == t.path ? 'active: bg-surface-800 ' : 'text-white'}">{t.name}</a
>
{/each}
</div>
{:else}
<p>(fallback contents)</p>
{/if}
</Drawer>
<script lang="ts">
import { page } from '$app/stores';
import Icon from '@iconify/svelte';
import type { DrawerSettings } from '@skeletonlabs/skeleton';
import { AppBar, AppShell, Drawer, getDrawerStore} from '@skeletonlabs/skeleton';
import { afterUpdate, onMount } from 'svelte';
import { navbarMenu, sidebarMenu, type TabDefinition } from './navigation.tabs';
import SettingMenu from './setting.menus.svelte';
import Sidebar from './sidebar.svelte';
export let userId = undefined;
const navbarTabs: TabDefinition[] = navbarMenu(userId);
const sidebarTabs: TabDefinition[] = sidebarMenu(userId);
const drawerStore = getDrawerStore();
function drawerLeftOpen(): void {
const settings: DrawerSettings = {
id: 'leftSidebar',
position: 'left',
width: '800px',
bgDrawer: 'bg-primary-50 text-on-primary-token',
bgBackdrop: 'bg-primary-500/50'
};
drawerStore.open(settings);
}
function drawerRightOpen(): void {
const settings: DrawerSettings = {
id: 'rightSidebar',
position: 'right',
width: '900px',
bgDrawer:
'bg-secondary-50 dark:bg-surface-900 border-l border-l-surface-200 dark:border-l-surface-700 flex flex-col gap-4 p-4'
};
drawerStore.open(settings);
}
function drawerRightClose(): void {
drawerStore.close();
}
let showSidebar = false;
</script>

<AppShell class="w-full">
<svelte:fragment slot="header">
<AppBar
gridColumns="grid-cols-3"
background="bg-secondary-500"
class="text-white"
slotDefault="place-self-center"
slotTrail="place-content-end"
>
<svelte:fragment slot="lead">
<div class="flex items-center">
<img class="block w-10 ml-2" src="/rean-logo-white.png" alt="REAN" />
<!-- <div class="relative ml-6 w-64 max-[450px]:w-40">
<input type="text" class="input pl-10" placeholder="Search" />
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
<Icon icon="material-symbols:search-rounded" class="text-lg text-primary-300" />
</div>
</div> -->
</div>
</svelte:fragment>
<svelte:fragment slot="trail">
<button
on:click={() => (showSidebar = !showSidebar)}
class="md:hidden btn btn-icon p-1 rounded hover:bg-white/10 text-white"
>
<Icon icon="material-symbols:menu-rounded" class="text-3xl" />
</button>

<button
class="btn p-1 rounded hover:bg-white/10 text-white mr-6"
on:click={drawerRightOpen}
>
<!-- <Icon icon="material-symbols:person-outline-rounded" class="text-3xl" /> -->
<img class="w-8 ml-2 text-lg invert dark:filter-none" src="/user.png" alt="" />
</button>
</svelte:fragment>
</AppBar>
</svelte:fragment>
<svelte:fragment slot="sidebarLeft">
<Sidebar {userId} bind:showSidebar />
</svelte:fragment>
<div class="m-4 md:m-8">
<slot />
</div>
<svelte:fragment slot="footer">
<p class="bg-secondary-500 text-center p-2">
<a href="https://reanfoundation.org" class="!text-white">&#xa9; 2022 REAN Foundation</a>
</p>
</svelte:fragment>
</AppShell>

<Drawer>
{#if $drawerStore.id === 'rightSidebar'}
<SettingMenu on:click={drawerRightClose} on:logout />
{:else if $drawerStore.id === 'leftSidebar'}
<div class="grid justify-center w-60 space-y-4 mt-5">
{#each sidebarTabs as t}
<a
href={t.path}
class="hover:bg-surface-700 hover:text-white p-2 hover:no-underline text-start no-underline rounded-md text-md font-medium
{$page.url.pathname == t.path ? 'active: bg-surface-800 ' : 'text-white'}">{t.name}</a
>
{/each}
{#each navbarTabs as t}
<a
href={t.path}
class="hover:bg-surface-700 lg:hidden sm:first:hidden hover:text-white p-2 hover:no-underline text-start no-underline rounded-md text-md font-medium
{$page.url.pathname == t.path ? 'active: bg-surface-800 ' : 'text-white'}">{t.name}</a
>
{/each}
</div>
{:else}
<p>(fallback contents)</p>
{/if}
</Drawer>
Loading

0 comments on commit 8550713

Please sign in to comment.