Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ jobs:
action: 'upload'
app_location: '/' # App source code path
api_location: '' # Api source code path - optional
output_location: 'dist/' # Built app content directory - adjust to match your app’s dist folder
output_location: './dist' # Built app content directory - adjust to match your app’s dist folder
5 changes: 3 additions & 2 deletions src/app/components/auth/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export class AuthInterceptor implements HttpInterceptor {
next: HttpHandler
): Observable<HttpEvent<unknown>> {
// Retrieve the token from local storage
const authdata = JSON.parse(localStorage.getItem('authData') || '{}');
const token = authdata?.token;
const authDataStr = localStorage.getItem('authData');
const authdata = authDataStr ? JSON.parse(authDataStr) : {};
const token = authdata?.accessToken;

if (token) {
// Clone the request to add the new header
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export class AuthService {
return this.http.post<AuthResponse>(registerUrl, form).pipe(
tap((response: AuthResponse) => {
// Store authentication data in local storage
const authData = JSON.stringify(response);
localStorage.setItem('authData', authData);
localStorage.setItem('authData', JSON.stringify(response));
this.userRoleSubject.next(response.user.role); // Update user role
this.isAuthenticated.next(true);
this.router.navigate(['/dashboard']);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
<!-- Header Section -->
<div class="header">
<h1>View Inventory</h1>
<div class="actions">
<button>Add New Inventory</button>
<button>Add Stock</button>
<button>Bulk Import</button>
</div>
</div>

<!-- Inventory Tables -->
<div class="tables">
<!-- Raw Materials Table -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
// Sample Table Data
rawMaterials = [
{
picture: 'assets/ascorbicAcid.png',
picture: 'assets/default-product.png',
materialId: 'RM001',
name: 'Ascorbic Acid (Vitamin C)',
supplier: 'HealthPro Labs',
Expand All @@ -46,7 +46,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
priceLastUpdated: new Date('2024-01-25'),
},
{
picture: 'assets/manganeseSulfate.png',
picture: 'assets/default-product.png',
materialId: 'RM002',
name: 'Manganese Sulfate (Manganese)',
supplier: 'Mineral Essentials Co.',
Expand All @@ -69,7 +69,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
priceLastUpdated: new Date('2024-01-05'),
},
{
picture: 'assets/riboflavin.png',
picture: 'assets/default-product.png',
materialId: 'RM003',
name: 'Riboflavin (Vitamin B2)',
supplier: 'VitalSource Pharma',
Expand All @@ -92,7 +92,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
priceLastUpdated: new Date('2024-02-01'),
},
{
picture: 'assets/calciferol.png',
picture: 'assets/default-product.png',
materialId: 'RM004',
name: 'Ergocalciferol (Vitamin D2)',
supplier: 'Sunshine Extracts',
Expand All @@ -117,7 +117,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
];
components = [
{
picture: 'assets/bottleCap.png',
picture: 'assets/default-product.png',
componentId: 'CMP001',
name: 'Plastic Bottle Cap',
supplier: 'CapIt Industries',
Expand All @@ -138,7 +138,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'In Stock',
},
{
picture: 'assets/labels.png',
picture: 'assets/default-product.png',
componentId: 'CMP002',
name: 'Pill Bottle Labels',
supplier: 'LabelPro Supplies',
Expand All @@ -159,7 +159,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'Backordered',
},
{
picture: 'assets/silicaGel.png',
picture: 'assets/default-product.png',
componentId: 'CMP003',
name: 'Silica Gel Packets',
supplier: 'DryGuard Corp',
Expand All @@ -180,7 +180,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'In Stock',
},
{
picture: 'assets/cottonBalls.png',
picture: 'assets/default-product.png',
componentId: 'CMP004',
name: 'Cotton Balls',
supplier: 'PureSoft Materials',
Expand All @@ -201,7 +201,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'In Stock',
},
{
picture: 'assets/bottles.png',
picture: 'assets/default-product.png',
componentId: 'CMP005',
name: 'Plastic Pill Bottles',
supplier: 'PharmaContainer Ltd.',
Expand All @@ -225,7 +225,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {

wips = [
{
picture: 'assets/probioticCapsules.png', // Path to image
picture: 'assets/default-product.png', // Path to image
wipId: 'WIP001',
productName: 'Probiotic Capsules',
sku: 'PROB-CAP-001',
Expand All @@ -246,7 +246,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'In Progress',
},
{
picture: 'assets/vitaminDPowder.png', // Path to image
picture: 'assets/default-product.png', // Path to image
wipId: 'WIP002',
productName: 'Vitamin D Powder',
sku: 'VITD-PWD-001',
Expand All @@ -267,7 +267,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'Delayed',
},
{
picture: 'assets/fishOilLiquid.png', // Path to image
picture: 'assets/default-product.png', // Path to image
wipId: 'WIP003',
productName: 'Omega-3 Fish Oil',
sku: 'FISH-OIL-001',
Expand All @@ -290,7 +290,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
];
finishedGoods = [
{
picture: 'assets/probioticCapsules.png', // Path to image
picture: 'assets/default-product.png', // Path to image
productName: 'Probiotic Capsules',
sku: 'PROB-CAP-001',
batchIds: 'BATCHC123, BATCHC124',
Expand All @@ -309,7 +309,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'In Stock',
},
{
picture: 'assets/vitaminDPowder.png', // Path to image
picture: 'assets/default-product.png', // Path to image
productName: 'Vitamin D Powder',
sku: 'VITD-PWD-001',
batchIds: 'BATCHD456',
Expand All @@ -328,7 +328,7 @@ export class InventoryItemsTableComponent implements OnInit, AfterViewInit {
status: 'Backordered',
},
{
picture: 'assets/fishOilLiquid.png', // Path to image
picture: 'assets/default-product.png', // Path to image
productName: 'Omega-3 Fish Oil',
sku: 'FISH-OIL-001',
batchIds: 'BATCHF789',
Expand Down
Loading
Loading