-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove harcoding of base url Ensure all HTMX targets can be fetched from a single constant source * Purge unnecessary try catch blocks * get application port and JWT secret from .env file
- Loading branch information
1 parent
88a6e17
commit db6a9ab
Showing
24 changed files
with
192 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,7 @@ yarn-error.log* | |
**/*.tgz | ||
**/*.log | ||
package-lock.json | ||
**/*.bun | ||
**/*.bun | ||
|
||
# remove .env files | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
htmx.defineExtension('debug', { | ||
onEvent: function(name, evt) { | ||
if (console.debug) { | ||
console.debug(name, evt); | ||
} else if (console) { | ||
console.log("DEBUG:", name, evt); | ||
} else { | ||
throw "NO CONSOLE SUPPORTED" | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export enum HtmxTargets { | ||
CREATE_ORDER_SECTION = "create-order-section", | ||
INVENTORY_SECTION = "inventory-section", | ||
INVENTORY_DATA_LIST = "inventory-data-list", | ||
INVENTORY_SUBMIT_RESULT_VIEW = "inventory-submit-result-view", | ||
LOGIN_SUBMIT_RESULT_VIEW = "login-submit-result-view", | ||
MAIN_SECTION = "main-section", | ||
ORDERS_SECTION = "orders-section", | ||
ROOT_DIV = "root-div", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { HtmxTargets } from "../../common/constants" | ||
|
||
export const ViewInventorySection = () => { | ||
return ( | ||
<div> | ||
<div class="grid"> | ||
<div> | ||
<input type="search" id="search" name="search" placeholder="Search Inventory" hx-get="/inventory/list/search" hx-trigger="keyup changed delay:500ms" hx-target="#inventory-data"/> | ||
<input type="search" id="search" name="search" placeholder="Search Inventory" hx-get="/inventory/list/search" hx-trigger="keyup changed delay:500ms" hx-target={`#${HtmxTargets.INVENTORY_DATA_LIST}`} /> | ||
</div> | ||
<div> | ||
<div class="grid"> | ||
<div></div> | ||
<div> | ||
<button role="button" class="outline" hx-get="/inventory/create" hx-target="#inventory-section">Add New</button> | ||
<button role="button" class="outline" hx-get="/inventory/create" hx-target={`#${HtmxTargets.INVENTORY_SECTION}`}>Add New</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="inventory-data" hx-get="/inventory/list/all" hx-trigger="load" /> | ||
<div id={HtmxTargets.INVENTORY_DATA_LIST} hx-get="/inventory/list/all" hx-trigger="load" /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.