Skip to content

Commit

Permalink
Release: v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
XPH0816 committed Jun 21, 2024
1 parent 6ee9766 commit 3c63fe2
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 16 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ jobs:
node-version: 20
cache: 'pnpm' # Set this to npm, yarn or pnpm.

- name: setup key (windows only)
if: matrix.settings.platform == 'windows-latest'
run: |
./setup-key.bat
- name: setup key (macos and linux only)
if: matrix.settings.platform != 'windows-latest'
run: |
chmod +x ./setup-key.sh
./setup-key.sh
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libraryroombookingsystem",
"private": true,
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "LibraryRoomBookingSystem"
version = "1.0.2"
version = "1.0.3"
description = "A Library Room Booking System built with Tauri and Rust"
authors = ["Lim Shi Song limshisong123@gmail.com"]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"build": {
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm build && setup-key",
"beforeBuildCommand": "pnpm build",
"devPath": "http://localhost:1420",
"distDir": "../build"
},
"package": {
"productName": "LibraryRoomBookingSystem",
"version": "1.0.2"
"version": "1.0.3"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/forms/BookingForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
let endDateTime = new Date(dateTime);
endDateTime = GetEndDateTime(endDateTime, room.duration);
checkOutTime = formatTime(endDateTime);
changeDate();
if (checkInDate !== checkOutDate && isNotHikmahRoomAndEksplorasiRoom(roomName)) changeDate();
};
let changeEndTime = () => {
Expand Down
13 changes: 12 additions & 1 deletion src/lib/components/forms/FeedBackForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
<Input type="text" bind:value={data.user_id} disabled />
</FormGroup>
</Col>
{#if data.username}
<Col>
<FormGroup floating label="Username">
<Input
type="text"
bind:value={data.username}
disabled
/>
</FormGroup>
</Col>
{/if}
<Col>
<FormGroup floating label="Date">
<Input type="date" bind:value={data.date} disabled />
Expand All @@ -105,7 +116,7 @@
/>
</FormGroup>
{#if data.admin_id}
<FormGroup floating label="Admin ID">
<FormGroup floating label="Reply By">
<Input type="text" bind:value={data.admin_id} disabled />
</FormGroup>
{/if}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getRoomType } from "./store";
* @returns
*/
export function SnakeCaseToCapitalized(str) {
if (typeof str !== "string") return "";
return str.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
}

Expand Down Expand Up @@ -153,7 +154,7 @@ export function isNotHikmahRoomAndEksplorasiRoom(roomName) {
* @param {String} roomName
* @returns boolean
*/
export function isFreeRoom(roomName){
export function isFreeRoom(roomName) {
let regex = /[a-z]*[_](room|stage|lounge)|[A-Z][a-z]* (Room|Stage|Lounge)|[aA]uditorium/g;
if (regex.test(roomName)) {
regex.lastIndex = 0;
Expand All @@ -168,7 +169,7 @@ export function isFreeRoom(roomName){
* @param {String} roomName
* @returns boolean
*/
export function isNoRoomNumber(roomName){
export function isNoRoomNumber(roomName) {
let regex = /[a-z]*[_](stage|lounge)|[A-Z][a-z]* (Stage|Lounge)|[aA]uditorium/g;
if (regex.test(roomName)) {
regex.lastIndex = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/repos/feedbackRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class FeedBackRepo {
edit: "/feedback/form?id=" + feedback.id + "&edit=true",
};
data = {
id: feedback.id,
feedback_id: feedback.id,
date: feedback.date,
content: feedback.content,
status: feedback.status,
Expand All @@ -37,7 +37,7 @@ export class FeedBackRepo {
reply: "/manage/feedback/form?id=" + feedback.id + "&edit=true",
}
data = {
id: feedback.id,
feedback_id: feedback.id,
user_id: feedback.user_id,
date: feedback.date,
content: feedback.content,
Expand Down
1 change: 1 addition & 0 deletions src/lib/repos/userManageRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export class userManageRepo {
constructor(users = []) {
this.datas = users.map(user => {
return {
user_id: user.user_id,
username: user.username,
email: user.email,
phone: user.phone,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(admin)/manage/feedback/form/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function load({ url }) {
user = await getUserById(feedback.user_id, 'user');
if (feedback.admin_id) {
admin = await getUserById(feedback.admin_id, 'admin');
reply = { user_id: user.username, admin_id: admin.username, feedback_id: feedback.id, comment: feedback.comment, date: feedback.date, status: feedback.status };
reply = { user_id: user.user_id, username:user.username, admin_id: admin.username, feedback_id: feedback.id, comment: feedback.comment, date: feedback.date, status: feedback.status };
}
data = reply ? { feedback, reply, disabled: true } : { feedback, user, disabled: true };
} else if (url.searchParams.get('edit')) {
Expand All @@ -31,7 +31,7 @@ export async function load({ url }) {
user = await getUserById(feedback.user_id, 'user');
if (feedback.admin_id) {
admin = await getUserById(feedback.admin_id, 'admin');
reply = { user_id: user.username, admin_id: admin.username, comment: feedback.comment, date: feedback.date };
reply = { user_id: user.user_id, username:user.username, admin_id: admin.username, comment: feedback.comment, date: feedback.date };
}
data = reply ? { feedback, reply, disabled: false } : { feedback, user, disabled: false };
}
Expand Down
8 changes: 5 additions & 3 deletions src/routes/(admin)/manage/feedback/form/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
else
reply = data.disabled
? {
user_id: data.user.username,
user_id: data.user.user_id,
username: data.user.username,
date: formatDate(new Date()),
status: data.feedback.status,
}
: {
user_id: data.user.username,
admin_id: $user.id,
user_id: data.user.user_id,
username: data.user.username,
admin_id: $user.username,
date: formatDate(new Date()),
status: data.feedback.status,
};
Expand Down

0 comments on commit 3c63fe2

Please sign in to comment.