Compare commits
20 Commits
Applicatio
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ea355d9d8 | |||
| 4d19f26f01 | |||
| 445c15b797 | |||
| 406f61a612 | |||
| f7daa1bb19 | |||
| 8a7ca9c2f9 | |||
| 1730714737 | |||
| 8dc11ee34d | |||
| 2a841ebf27 | |||
| d7908570b2 | |||
| 629fd59a7c | |||
| 333bf20d86 | |||
| bd3c3564a9 | |||
| c74b5b280b | |||
| 0a1704b60b | |||
| 97119dec97 | |||
| 7a6020febb | |||
| fb64b35807 | |||
| a8165e2ae5 | |||
| 79cf77dc63 |
@@ -48,12 +48,12 @@ jobs:
|
|||||||
cd /var/www/html/milsim-site-v4
|
cd /var/www/html/milsim-site-v4
|
||||||
version=`git log -1 --format=%H`
|
version=`git log -1 --format=%H`
|
||||||
echo "Current Revision: $version"
|
echo "Current Revision: $version"
|
||||||
echo "Updating to: ${{ github.sha }}
|
echo "Updating to: ${{ github.sha }}"
|
||||||
sudo -u nginx git reset --hard
|
sudo -u nginx git reset --hard
|
||||||
sudo -u nginx git pull origin main
|
sudo -u nginx git fetch --tags
|
||||||
sudo -u nginx git pull origin main
|
sudo -u nginx git pull origin main
|
||||||
new_version=`git log -1 --format=%H`
|
new_version=`git log -1 --format=%H`
|
||||||
echo "Sucessfully updated to: $new_version
|
echo "Successfully updated to: $new_version"
|
||||||
|
|
||||||
- name: Update Shared Dependencies and Fix Permissions
|
- name: Update Shared Dependencies and Fix Permissions
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ CLIENT_URL= # This is whatever URL the client web app is served on
|
|||||||
CLIENT_DOMAIN= #whatever.com
|
CLIENT_DOMAIN= #whatever.com
|
||||||
APPLICATION_VERSION= # Should match release tag
|
APPLICATION_VERSION= # Should match release tag
|
||||||
APPLICATION_ENVIRONMENT= # dev / prod
|
APPLICATION_ENVIRONMENT= # dev / prod
|
||||||
|
CONFIG_ID= # configures
|
||||||
|
|
||||||
# Glitchtip
|
# Glitchtip
|
||||||
GLITCHTIP_DSN=
|
GLITCHTIP_DSN=
|
||||||
|
|||||||
@@ -7,9 +7,27 @@ import { MemberState, setUserState } from '../services/memberService';
|
|||||||
import { getRankByName, insertMemberRank } from '../services/rankService';
|
import { getRankByName, insertMemberRank } from '../services/rankService';
|
||||||
import { ApplicationFull, CommentRow } from "@app/shared/types/application"
|
import { ApplicationFull, CommentRow } from "@app/shared/types/application"
|
||||||
import { assignUserToStatus } from '../services/statusService';
|
import { assignUserToStatus } from '../services/statusService';
|
||||||
import { Request, Response } from 'express';
|
import { Request, response, Response } from 'express';
|
||||||
import { getUserRoles } from '../services/rolesService';
|
import { getUserRoles } from '../services/rolesService';
|
||||||
|
|
||||||
|
//get CoC
|
||||||
|
router.get('/coc', async (req: Request, res: Response) => {
|
||||||
|
const output = await fetch(`${process.env.DOC_HOST}/api/pages/714`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Token ${process.env.DOC_TOKEN_ID}:${process.env.DOC_TOKEN_SECRET}`,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (output.ok) {
|
||||||
|
const out = await output.json();
|
||||||
|
res.status(200).json(out.html);
|
||||||
|
} else {
|
||||||
|
console.error("Failed to fetch LOA policy from bookstack");
|
||||||
|
res.sendStatus(500);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
// POST /application
|
// POST /application
|
||||||
router.post('/', async (req, res) => {
|
router.post('/', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
@@ -141,8 +159,9 @@ router.get('/:id', async (req: Request, res: Response) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// POST /application/approve/:id
|
// POST /application/approve/:id
|
||||||
router.post('/approve/:id', async (req, res) => {
|
router.post('/approve/:id', async (req: Request, res: Response) => {
|
||||||
const appID = req.params.id;
|
const appID = Number(req.params.id);
|
||||||
|
const approved_by = req.user.id;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const app = await getApplicationByID(appID);
|
const app = await getApplicationByID(appID);
|
||||||
@@ -153,14 +172,14 @@ router.post('/approve/:id', async (req, res) => {
|
|||||||
throw new Error("Something went wrong approving the application");
|
throw new Error("Something went wrong approving the application");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(app.member_id);
|
|
||||||
//update user profile
|
//update user profile
|
||||||
await setUserState(app.member_id, MemberState.Member);
|
await setUserState(app.member_id, MemberState.Member);
|
||||||
|
|
||||||
let nextRank = await getRankByName('Recruit')
|
await pool.query('CALL sp_accept_new_recruit_validation(?, ?, ?, ?)', [Number(process.env.CONFIG_ID), app.member_id, approved_by, approved_by])
|
||||||
await insertMemberRank(app.member_id, nextRank.id);
|
// let nextRank = await getRankByName('Recruit')
|
||||||
//assign user to "pending basic"
|
// await insertMemberRank(app.member_id, nextRank.id);
|
||||||
await assignUserToStatus(app.member_id, 1);
|
// //assign user to "pending basic"
|
||||||
|
// await assignUserToStatus(app.member_id, 1);
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Approve failed:', err);
|
console.error('Approve failed:', err);
|
||||||
@@ -282,4 +301,5 @@ router.post('/restart', async (req: Request, res: Response) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ router.get('/', async (req, res) => {
|
|||||||
AND UTC_TIMESTAMP() BETWEEN l.start_date AND l.end_date
|
AND UTC_TIMESTAMP() BETWEEN l.start_date AND l.end_date
|
||||||
) THEN 1 ELSE 0
|
) THEN 1 ELSE 0
|
||||||
END AS on_loa
|
END AS on_loa
|
||||||
FROM view_member_rank_status_all v;`);
|
FROM view_member_rank_unit_status_latest v;`);
|
||||||
return res.status(200).json(result);
|
return res.status(200).json(result);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error fetching users:', err);
|
console.error('Error fetching users:', err);
|
||||||
@@ -63,7 +63,7 @@ router.get('/me', async (req, res) => {
|
|||||||
router.get('/:id', async (req, res) => {
|
router.get('/:id', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const userId = req.params.id;
|
const userId = req.params.id;
|
||||||
const result = await pool.query('SELECT * FROM view_member_rank_status_all WHERE id = $1;', [userId]);
|
const result = await pool.query('SELECT * FROM view_member_rank_unit_status_latest WHERE id = $1;', [userId]);
|
||||||
if (result.rows.length === 0) {
|
if (result.rows.length === 0) {
|
||||||
return res.status(404).json({ error: 'User not found' });
|
return res.status(404).json({ error: 'User not found' });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ r.get('/', async (req, res) => {
|
|||||||
const membersRoles = await con.query(`
|
const membersRoles = await con.query(`
|
||||||
SELECT mr.role_id, v.*
|
SELECT mr.role_id, v.*
|
||||||
FROM members_roles mr
|
FROM members_roles mr
|
||||||
JOIN view_member_rank_status_all v ON mr.member_id = v.member_id
|
JOIN view_member_rank_unit_status_latest v ON mr.member_id = v.member_id
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ export async function insertMemberRank(member_id: number, rank_id: number): Prom
|
|||||||
|
|
||||||
export async function insertMemberRank(member_id: number, rank_id: number, date?: Date): Promise<void> {
|
export async function insertMemberRank(member_id: number, rank_id: number, date?: Date): Promise<void> {
|
||||||
const sql = date
|
const sql = date
|
||||||
? `INSERT INTO members_ranks (member_id, rank_id, event_date) VALUES (?, ?, ?);`
|
? `INSERT INTO members_ranks (member_id, rank_id, start_date) VALUES (?, ?, ?);`
|
||||||
: `INSERT INTO members_ranks (member_id, rank_id, event_date) VALUES (?, ?, NOW());`;
|
: `INSERT INTO members_ranks (member_id, rank_id, start_date) VALUES (?, ?, NOW());`;
|
||||||
|
|
||||||
const params = date
|
const params = date
|
||||||
? [member_id, rank_id, date]
|
? [member_id, rank_id, date]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import pool from "../db"
|
import pool from "../db"
|
||||||
|
|
||||||
export async function assignUserToStatus(userID: number, statusID: number) {
|
export async function assignUserToStatus(userID: number, statusID: number) {
|
||||||
const sql = `INSERT INTO members_statuses (member_id, status_id, event_date) VALUES (?, ?, NOW())`
|
const sql = `INSERT INTO members_statuses (member_id, status_id, start_date) VALUES (?, ?, NOW())`
|
||||||
await pool.execute(sql, [userID, statusID]);
|
await pool.execute(sql, [userID, statusID]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export async function getMyApplication(id: number): Promise<ApplicationFull> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function approveApplication(id: Number) {
|
export async function approveApplication(id: Number) {
|
||||||
const res = await fetch(`${addr}/application/approve/${id}`, { method: 'POST' })
|
const res = await fetch(`${addr}/application/approve/${id}`, { method: 'POST', credentials: 'include' })
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
console.error("Something went wrong approving the application")
|
console.error("Something went wrong approving the application")
|
||||||
@@ -97,7 +97,7 @@ export async function approveApplication(id: Number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function denyApplication(id: Number) {
|
export async function denyApplication(id: Number) {
|
||||||
const res = await fetch(`${addr}/application/deny/${id}`, { method: 'POST' })
|
const res = await fetch(`${addr}/application/deny/${id}`, { method: 'POST', credentials: 'include' })
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
console.error("Something went wrong denying the application")
|
console.error("Something went wrong denying the application")
|
||||||
@@ -113,4 +113,20 @@ export async function restartApplication() {
|
|||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
console.error("Something went wrong restarting your application")
|
console.error("Something went wrong restarting your application")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getCoC(): Promise<string> {
|
||||||
|
const res = await fetch(`${addr}/application/coc`, {
|
||||||
|
method: "GET",
|
||||||
|
credentials: 'include',
|
||||||
|
});
|
||||||
|
if (res.ok) {
|
||||||
|
const out = res.json();
|
||||||
|
if (!out) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,8 @@ export type Member = {
|
|||||||
member_name: string;
|
member_name: string;
|
||||||
rank: string | null;
|
rank: string | null;
|
||||||
rank_date: string | null;
|
rank_date: string | null;
|
||||||
|
unit: string | null;
|
||||||
|
unit_date: string | null;
|
||||||
status: string | null;
|
status: string | null;
|
||||||
status_date: string | null;
|
status_date: string | null;
|
||||||
on_loa: boolean | null;
|
on_loa: boolean | null;
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Root container */
|
/* Root container */
|
||||||
.ListRendererV2-container {
|
.bookstack-container {
|
||||||
font-family: var(--font-sans, system-ui), sans-serif;
|
font-family: var(--font-sans, system-ui), sans-serif;
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
@@ -178,56 +178,53 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Headers */
|
/* Headers */
|
||||||
.ListRendererV2-container h4 {
|
.bookstack-container h4 {
|
||||||
margin: 0.9rem 0 0.4rem 0;
|
margin: 0.9rem 0 0.4rem 0;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.35;
|
line-height: 1.35;
|
||||||
font-size: 1.05rem;
|
font-size: 1.05rem;
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
/* PURE WHITE */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ListRendererV2-container h5 {
|
.bookstack-container h5 {
|
||||||
margin: 0.9rem 0 0.4rem 0;
|
margin: 0.9rem 0 0.4rem 0;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.35;
|
line-height: 1.35;
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
/* Still white (change to muted if desired) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lists */
|
/* Lists */
|
||||||
.ListRendererV2-container ul {
|
.bookstack-container ul {
|
||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
margin-left: 1.1rem;
|
margin-left: 1.1rem;
|
||||||
margin-bottom: 0.6rem;
|
margin-bottom: 0.6rem;
|
||||||
padding-left: 0.6rem;
|
padding-left: 0.6rem;
|
||||||
color: var(--muted-foreground);
|
color: var(--muted-foreground);
|
||||||
/* dim text */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nested lists */
|
/* Nested lists */
|
||||||
.ListRendererV2-container ul ul {
|
.bookstack-container ul ul {
|
||||||
list-style-type: circle;
|
list-style-type: circle;
|
||||||
margin-left: 0.9rem;
|
margin-left: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List items */
|
/* List items */
|
||||||
.ListRendererV2-container li {
|
.bookstack-container li {
|
||||||
margin: 0.15rem 0;
|
margin: 0.15rem 0;
|
||||||
padding-left: 0.1rem;
|
padding-left: 0.1rem;
|
||||||
color: var(--muted-foreground);
|
color: var(--muted-foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bullet color */
|
/* Bullet color */
|
||||||
.ListRendererV2-container li::marker {
|
.bookstack-container li::marker {
|
||||||
color: var(--muted-foreground);
|
color: var(--muted-foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inline elements */
|
/* Inline elements */
|
||||||
.ListRendererV2-container li p,
|
.bookstack-container li p,
|
||||||
.ListRendererV2-container li span,
|
.bookstack-container li span,
|
||||||
.ListRendererV2-container p {
|
.bookstack-container p {
|
||||||
display: inline;
|
display: inline;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -235,6 +232,45 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Top-level spacing */
|
/* Top-level spacing */
|
||||||
.ListRendererV2-container>ul>li {
|
.bookstack-container>ul>li {
|
||||||
margin-top: 0.3rem;
|
margin-top: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* links */
|
||||||
|
.bookstack-container a {
|
||||||
|
color: var(--color-primary);
|
||||||
|
margin-top: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bookstack-container a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Scrollbar stuff */
|
||||||
|
/* Firefox */
|
||||||
|
.scrollbar-themed {
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: #555 #1f1f1f;
|
||||||
|
padding-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chrome, Edge, Safari */
|
||||||
|
.scrollbar-themed::-webkit-scrollbar {
|
||||||
|
width: 10px;
|
||||||
|
/* slightly wider to allow padding look */
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollbar-themed::-webkit-scrollbar-track {
|
||||||
|
background: #1f1f1f;
|
||||||
|
margin-left: 6px;
|
||||||
|
/* ❗ adds space between content + scrollbar */
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollbar-themed::-webkit-scrollbar-thumb {
|
||||||
|
background: #555;
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollbar-themed::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: #777;
|
||||||
}
|
}
|
||||||
@@ -13,10 +13,18 @@ import Input from '@/components/ui/input/Input.vue';
|
|||||||
import Textarea from '@/components/ui/textarea/Textarea.vue';
|
import Textarea from '@/components/ui/textarea/Textarea.vue';
|
||||||
import { toTypedSchema } from '@vee-validate/zod';
|
import { toTypedSchema } from '@vee-validate/zod';
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
import { onMounted, ref } from 'vue';
|
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||||
import * as z from 'zod';
|
import * as z from 'zod';
|
||||||
import DateInput from '../form/DateInput.vue';
|
import DateInput from '../form/DateInput.vue';
|
||||||
import { ApplicationData } from '@shared/types/application';
|
import { ApplicationData } from '@shared/types/application';
|
||||||
|
import Dialog from '../ui/dialog/Dialog.vue';
|
||||||
|
import DialogTrigger from '../ui/dialog/DialogTrigger.vue';
|
||||||
|
import DialogContent from '../ui/dialog/DialogContent.vue';
|
||||||
|
import DialogHeader from '../ui/dialog/DialogHeader.vue';
|
||||||
|
import DialogTitle from '../ui/dialog/DialogTitle.vue';
|
||||||
|
import DialogDescription from '../ui/dialog/DialogDescription.vue';
|
||||||
|
import { getCoC } from '@/api/application';
|
||||||
|
import { startBrowserTracingPageLoadSpan } from '@sentry/vue';
|
||||||
|
|
||||||
const regexA = /^https?:\/\/steamcommunity\.com\/id\/[A-Za-z0-9_]+\/?$/;
|
const regexA = /^https?:\/\/steamcommunity\.com\/id\/[A-Za-z0-9_]+\/?$/;
|
||||||
const regexB = /^https?:\/\/steamcommunity\.com\/profiles\/\d+\/?$/;
|
const regexB = /^https?:\/\/steamcommunity\.com\/profiles\/\d+\/?$/;
|
||||||
@@ -61,7 +69,7 @@ async function onSubmit(val: any) {
|
|||||||
emit('submit', val);
|
emit('submit', val);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
if (props.data !== null) {
|
if (props.data !== null) {
|
||||||
const parsed = typeof props.data === "string"
|
const parsed = typeof props.data === "string"
|
||||||
? JSON.parse(props.data)
|
? JSON.parse(props.data)
|
||||||
@@ -71,8 +79,35 @@ onMounted(() => {
|
|||||||
} else {
|
} else {
|
||||||
initialValues.value = { ...fallbackInitials };
|
initialValues.value = { ...fallbackInitials };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CoCbox.value.innerHTML = await getCoC()
|
||||||
|
CoCString.value = await getCoC();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const showCoC = ref(false);
|
||||||
|
const CoCbox = ref<HTMLElement>();
|
||||||
|
const CoCString = ref<string>();
|
||||||
|
|
||||||
|
async function onDialogToggle(state: boolean) {
|
||||||
|
showCoC.value = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
function enforceExternalLinks() {
|
||||||
|
if (!CoCbox.value) return;
|
||||||
|
|
||||||
|
const links = CoCbox.value.querySelectorAll("a");
|
||||||
|
links.forEach(a => {
|
||||||
|
a.setAttribute("target", "_blank");
|
||||||
|
a.setAttribute("rel", "noopener noreferrer");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(() => showCoC.value, async () => {
|
||||||
|
if (showCoC) {
|
||||||
|
await nextTick(); // wait for v-html to update
|
||||||
|
enforceExternalLinks();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -273,7 +308,8 @@ onMounted(() => {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<Checkbox :model-value="value" @update:model-value="handleChange" :disabled="readOnly" />
|
<Checkbox :model-value="value" @update:model-value="handleChange" :disabled="readOnly" />
|
||||||
<span>By checking this box, you accept the <Button variant="link" class="p-0 h-min">Code of
|
<span>By checking this box, you accept the <Button variant="link" class="p-0 h-min"
|
||||||
|
@click.prevent.stop="showCoC = true">Code of
|
||||||
Conduct</Button>.</span>
|
Conduct</Button>.</span>
|
||||||
</div>
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -284,7 +320,19 @@ onMounted(() => {
|
|||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
<div class="pt-2" v-if="!readOnly">
|
<div class="pt-2" v-if="!readOnly">
|
||||||
<Button type="submit" :onClick="() => console.log('hi')" :disabled="readOnly">Submit Application</Button>
|
<Button type="submit" :disabled="readOnly">Submit Application</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Dialog :open="showCoC" @update:open="onDialogToggle">
|
||||||
|
<DialogContent class="sm:max-w-fit">
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Community Code of Conduct</DialogTitle>
|
||||||
|
<DialogDescription class="w-full max-h-[75vh] overflow-y-auto scrollbar-themed">
|
||||||
|
<div v-html="CoCString" ref="CoCbox" class="bookstack-container w-full"></div>
|
||||||
|
</DialogDescription>
|
||||||
|
</DialogHeader>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
@@ -132,7 +132,7 @@ const maxEndDate = computed(() => {
|
|||||||
<div class="flex flex-row-reverse gap-6 mx-auto w-full" :class="!adminMode ? 'max-w-5xl' : 'max-w-5xl'">
|
<div class="flex flex-row-reverse gap-6 mx-auto w-full" :class="!adminMode ? 'max-w-5xl' : 'max-w-5xl'">
|
||||||
<div v-if="!adminMode" class="flex-1 flex flex-col space-x-4 rounded-md border p-4">
|
<div v-if="!adminMode" class="flex-1 flex flex-col space-x-4 rounded-md border p-4">
|
||||||
<p class="scroll-m-20 text-2xl font-semibold tracking-tight">LOA Policy</p>
|
<p class="scroll-m-20 text-2xl font-semibold tracking-tight">LOA Policy</p>
|
||||||
<div ref="policyRef">
|
<div ref="policyRef" class="bookstack-container">
|
||||||
<!-- LOA policy gets loaded here -->
|
<!-- LOA policy gets loaded here -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { getAllApplications, approveApplication, denyApplication } from '@/api/application';
|
import { getAllApplications, approveApplication, denyApplication } from '@/api/application';
|
||||||
import { ApplicationStatus } from '@shared/types/application'
|
import { ApplicationStatus } from '@shared/types/application'
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
@@ -96,39 +96,50 @@ onMounted(async () => {
|
|||||||
<!-- application list -->
|
<!-- application list -->
|
||||||
<div :class="openPanel == false ? 'w-full' : 'w-2/5'" class="pr-9">
|
<div :class="openPanel == false ? 'w-full' : 'w-2/5'" class="pr-9">
|
||||||
<h1 class="scroll-m-20 text-2xl font-semibold tracking-tight">Manage Applications</h1>
|
<h1 class="scroll-m-20 text-2xl font-semibold tracking-tight">Manage Applications</h1>
|
||||||
<Table>
|
<div class="max-h-[80vh] overflow-hidden">
|
||||||
<TableHeader>
|
<Table class="w-full">
|
||||||
<TableRow>
|
<TableHeader>
|
||||||
<TableHead>User</TableHead>
|
<TableRow>
|
||||||
<TableHead>Date Submitted</TableHead>
|
<TableHead>User</TableHead>
|
||||||
<TableHead class="text-right">Status</TableHead>
|
<TableHead>Date Submitted</TableHead>
|
||||||
</TableRow>
|
<TableHead class="text-right">Status</TableHead>
|
||||||
</TableHeader>
|
</TableRow>
|
||||||
<TableBody class="overflow-y-auto scrollbar-themed">
|
</TableHeader>
|
||||||
<TableRow v-for="app in appList" :key="app.id" class="cursor-pointer"
|
</Table>
|
||||||
:onClick="() => { openApplication(app.id) }">
|
|
||||||
<TableCell class="font-medium">{{ app.member_name }}</TableCell>
|
<!-- Scrollable body container -->
|
||||||
<TableCell :title="formatExact(app.submitted_at)">
|
<div class="overflow-y-auto max-h-[70vh] scrollbar-themed">
|
||||||
{{ formatAgo(app.submitted_at) }}
|
<Table class="w-full">
|
||||||
</TableCell>
|
<TableBody>
|
||||||
<TableCell v-if="app.app_status === ApplicationStatus.Pending"
|
<TableRow v-for="app in appList" :key="app.id" class="cursor-pointer"
|
||||||
class="inline-flex items-end gap-2">
|
@click="openApplication(app.id)">
|
||||||
<Button variant="success" @click.stop="() => { handleApprove(app.id) }">
|
<TableCell class="font-medium">{{ app.member_name }}</TableCell>
|
||||||
<CheckIcon></CheckIcon>
|
<TableCell :title="formatExact(app.submitted_at)">
|
||||||
</Button>
|
{{ formatAgo(app.submitted_at) }}
|
||||||
<Button variant="destructive" @click.stop="() => { handleDeny(app.id) }">
|
</TableCell>
|
||||||
<XIcon></XIcon>
|
|
||||||
</Button>
|
<TableCell v-if="app.app_status === ApplicationStatus.Pending"
|
||||||
</TableCell>
|
class="inline-flex items-end gap-2">
|
||||||
<TableCell class="text-right font-semibold" :class="[
|
<Button variant="success" @click.stop="handleApprove(app.id)">
|
||||||
,
|
<CheckIcon />
|
||||||
app.app_status === ApplicationStatus.Pending && 'text-yellow-500',
|
</Button>
|
||||||
app.app_status === ApplicationStatus.Accepted && 'text-green-500',
|
<Button variant="destructive" @click.stop="handleDeny(app.id)">
|
||||||
app.app_status === ApplicationStatus.Denied && 'text-destructive'
|
<XIcon />
|
||||||
]">{{ app.app_status }}</TableCell>
|
</Button>
|
||||||
</TableRow>
|
</TableCell>
|
||||||
</TableBody>
|
|
||||||
</Table>
|
<TableCell class="text-right font-semibold" :class="[
|
||||||
|
app.app_status === ApplicationStatus.Pending && 'text-yellow-500',
|
||||||
|
app.app_status === ApplicationStatus.Accepted && 'text-green-500',
|
||||||
|
app.app_status === ApplicationStatus.Denied && 'text-destructive'
|
||||||
|
]">
|
||||||
|
{{ app.app_status }}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="openPanel" class="pl-9 border-l w-3/5" :key="$route.params.id">
|
<div v-if="openPanel" class="pl-9 border-l w-3/5" :key="$route.params.id">
|
||||||
<div class="mb-5 flex justify-between">
|
<div class="mb-5 flex justify-between">
|
||||||
@@ -144,32 +155,4 @@ onMounted(async () => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
/* Firefox */
|
|
||||||
.scrollbar-themed {
|
|
||||||
scrollbar-width: thin;
|
|
||||||
scrollbar-color: #555 #1f1f1f;
|
|
||||||
padding-right: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Chrome, Edge, Safari */
|
|
||||||
.scrollbar-themed::-webkit-scrollbar {
|
|
||||||
width: 10px;
|
|
||||||
/* slightly wider to allow padding look */
|
|
||||||
}
|
|
||||||
|
|
||||||
.scrollbar-themed::-webkit-scrollbar-track {
|
|
||||||
background: #1f1f1f;
|
|
||||||
margin-left: 6px;
|
|
||||||
/* ❗ adds space between content + scrollbar */
|
|
||||||
}
|
|
||||||
|
|
||||||
.scrollbar-themed::-webkit-scrollbar-thumb {
|
|
||||||
background: #555;
|
|
||||||
border-radius: 9999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scrollbar-themed::-webkit-scrollbar-thumb:hover {
|
|
||||||
background: #777;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -65,6 +65,7 @@ const searchedMembers = computed(() => {
|
|||||||
Member
|
Member
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableHead>Rank</TableHead>
|
<TableHead>Rank</TableHead>
|
||||||
|
<TableHead>Unit</TableHead>
|
||||||
<TableHead>Status</TableHead>
|
<TableHead>Status</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
@@ -75,6 +76,7 @@ const searchedMembers = computed(() => {
|
|||||||
{{ member.member_name }}
|
{{ member.member_name }}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{{ member.rank }}</TableCell>
|
<TableCell>{{ member.rank }}</TableCell>
|
||||||
|
<TableCell>{{ member.unit }}</TableCell>
|
||||||
<TableCell>{{ member.status }}</TableCell>
|
<TableCell>{{ member.status }}</TableCell>
|
||||||
<TableCell><Badge v-if="member.on_loa">On LOA</Badge></TableCell>
|
<TableCell><Badge v-if="member.on_loa">On LOA</Badge></TableCell>
|
||||||
<TableCell @click.stop="" class="text-right">
|
<TableCell @click.stop="" class="text-right">
|
||||||
|
|||||||
Reference in New Issue
Block a user