Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with main #2367

Closed
wants to merge 7 commits into from
Closed
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</a>
<h2>Frappe HR</h2>
<p align="center">
<p>Open Source, modern, and easy-to-use HR and Payroll Software for all organizations</p>
<p>Open Source, modern, and easy-to-use HR and Payroll Software for all organizations. Modified by Arkone Softwares</p>
</p>

[![CI](https://github.com/frappe/hrms/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/frappe/hrms/actions/workflows/ci.yml)
Expand Down
2 changes: 1 addition & 1 deletion frappe-ui
Submodule frappe-ui updated 53 files
+2 −3 package.json
+2 −4 src/components/Autocomplete.vue
+2 −11 src/components/Avatar.vue
+0 −1 src/components/Breadcrumbs.vue
+0 −247 src/components/Calendar.story.md
+0 −138 src/components/Calendar.story.vue
+0 −432 src/components/Calendar/Calendar.vue
+0 −113 src/components/Calendar/CalendarDaily.vue
+0 −512 src/components/Calendar/CalendarEvent.vue
+0 −143 src/components/Calendar/CalendarMonthly.vue
+0 −49 src/components/Calendar/CalendarTimeMarker.vue
+0 −252 src/components/Calendar/CalendarWeekly.vue
+0 −63 src/components/Calendar/EventModalContent.vue
+0 −46 src/components/Calendar/FloatingPopover.vue
+0 −210 src/components/Calendar/NewEventModal.vue
+0 −37 src/components/Calendar/ShowMoreCalendarEvent.vue
+0 −277 src/components/Calendar/calendarUtils.js
+0 −54 src/components/Calendar/composables/useCalendarData.js
+0 −41 src/components/Calendar/composables/useEventModal.js
+4 −7 src/components/Checkbox.vue
+0 −36 src/components/DatePicker.story.vue
+72 −108 src/components/DatePicker.vue
+0 −333 src/components/DateRangePicker.vue
+0 −405 src/components/DateTimePicker.vue
+3 −11 src/components/Dialog.vue
+3 −3 src/components/FeatherIcon.vue
+6 −6 src/components/FileUploader.vue
+4 −4 src/components/ListFilter/ListFilter.vue
+2 −2 src/components/ListFilter/SearchComplete.vue
+1 −1 src/components/ListView/ListHeader.vue
+7 −19 src/components/ListView/ListRow.vue
+2 −2 src/components/ListView/ListView.vue
+10 −19 src/components/Popover.vue
+4 −4 src/components/Switch.vue
+3 −17 src/components/TabButtons.vue
+2 −2 src/components/TextEditor/InsertVideo.vue
+1 −1 src/components/TextEditor/TextEditor.vue
+1 −1 src/components/TextEditor/image-extension.js
+1 −1 src/components/TextEditor/mention.js
+1 −1 src/components/Tooltip/Tooltip.vue
+2 −2 src/components/toast.js
+2 −4 src/fonts/Inter/inter.css
+0 −4 src/index.js
+6 −6 src/resources/documentResource.js
+8 −8 src/resources/listResource.js
+1 −1 src/resources/plugin.js
+1 −1 src/utils/call.js
+1 −1 src/utils/confirmDialog.js
+1 −1 src/utils/debounce.ts
+1 −1 src/utils/frappeRequest.js
+1 −1 src/utils/markdown.js
+1 −1 src/utils/pageMeta.js
+0 −4 src/utils/tailwind.config.js
209 changes: 28 additions & 181 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,186 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover maximum-scale=1.0, user-scalable=no"
/>
<title>Frappe HR</title>

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Frappe HR" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<!-- required for setting the status bar bg as white -->
<meta name="theme-color" content="#fff" />
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover maximum-scale=1.0, user-scalable=no" />
<title>HR - Mobile</title>

<!-- PWA -->
<link
rel="icon"
type="image/png"
sizes="196x196"
href="/assets/hrms/manifest/favicon-196.png"
/>
<link
rel="apple-touch-icon"
href="/assets/hrms/manifest/apple-icon-180.png"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="HR - Mobile" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<!-- required for setting the status bar bg as white -->
<meta name="theme-color" content="#fff" />

<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2048-2732.jpg"
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2732-2048.jpg"
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1668-2388.jpg"
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2388-1668.jpg"
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1536-2048.jpg"
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2048-1536.jpg"
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1668-2224.jpg"
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2224-1668.jpg"
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1620-2160.jpg"
media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2160-1620.jpg"
media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1290-2796.jpg"
media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2796-1290.jpg"
media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1179-2556.jpg"
media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2556-1179.jpg"
media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1284-2778.jpg"
media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2778-1284.jpg"
media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1170-2532.jpg"
media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2532-1170.jpg"
media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1125-2436.jpg"
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2436-1125.jpg"
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1242-2688.jpg"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2688-1242.jpg"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-828-1792.jpg"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1792-828.jpg"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1242-2208.jpg"
media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-2208-1242.jpg"
media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-750-1334.jpg"
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1334-750.jpg"
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-640-1136.jpg"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
/>
<link
rel="apple-touch-startup-image"
href="/assets/hrms/manifest/apple-splash-1136-640.jpg"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
/>
</head>
<body class="antialiased">
<div id="app"></div>
<div id="modals"></div>
<div id="popovers"></div>
<!-- PWA -->
<link rel="icon" type="image/png" sizes="196x196" href="/assets/hrms/manifest/favicon-196.png" />
<link rel="apple-touch-icon" href="/assets/hrms/manifest/apple-icon-180.png" />

<script>
window.csrf_token = "{{ csrf_token }}"
Expand All @@ -189,6 +24,18 @@
frappe.boot = {{ boot }}
</script>

<script type="module" src="/src/main.js"></script>
</body>
</html>
<body class="antialiased">
<div id="app"></div>
<div id="modals"></div>
<div id="popovers"></div>

<script>
window.csrf_token = "{{ csrf_token }}"
if (!window.frappe) window.frappe = {}
frappe.boot = {{ boot }}
</script>

<script type="module" src="/src/main.js"></script>
</body>

</html>
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"dev": "vite --host 0.0.0.0",
"serve": "vite preview",
"build": "vite build --base=/assets/hrms/frontend/ && yarn copy-html-entry",
"ionic:build": "npm run build",
Expand All @@ -13,6 +13,7 @@
"dependencies": {
"@ionic/vue": "^7.4.3",
"@ionic/vue-router": "^7.4.3",
"@popperjs/core": "^2.11.8",
"@vitejs/plugin-vue": "^4.4.0",
"autoprefixer": "^10.4.2",
"dayjs": "^1.11.7",
Expand All @@ -21,6 +22,7 @@
"frappe-ui": "^0.1.67",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.15",
"v-calendar": "^3.1.2",
"vite": "^5.1.4",
"vite-plugin-pwa": "^0.19.0",
"vue": "^3.2.25",
Expand Down
104 changes: 104 additions & 0 deletions frontend/src/components/AttendanceCalendar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<template>
<v-calendar ref="calendar" :first-day-of-week="2" expanded v-model="selectedDate" :attributes='attrs'
@update:pages="pageChange">
<template #footer>
<div class="w-full px-4 pb-3">
<p class="bg-indigo-600 hover:bg-indigo-700 font-bold w-full px-3 py-1 rounded-md">
Present: {{ presentData.length }} | Absent: {{ absentData.length }}
</p>
</div>

<slot></slot>
</template>
</v-calendar>
</template>

<script setup>
import { createResource, createListResource, toast, FeatherIcon } from "frappe-ui"
import { computed, inject, ref, onMounted, onBeforeUnmount } from "vue"
const DOCTYPE = "Attendance"

const socket = inject("$socket")
const employee = inject("$employee")
const dayjs = inject("$dayjs")
const selectedDate = ref(new Date())
const startDate = ref(dayjs().startOf('month').format('YYYY-MM-DD'))
const endDate = ref(dayjs().endOf('month').format('YYYY-MM-DD'))
const attendance = createListResource({
doctype: DOCTYPE,
fields: ["status", "employee_name", "attendance_date", "employee", "late_entry", "early_exit"],
filters: [
["employee", "=", employee.data.name],
["attendance_date", ">=", startDate.value],
["attendance_date", "<=", endDate.value],
],
orderBy: "attendance_date desc",
pageLength: 31,
})
attendance.reload()


const presentData = computed(() => {
if (!attendance.data) return [];

const presentDates = attendance.data
.filter(att => att.status === 'Present')
.map(att => att.attendance_date)
.filter(date => date); // Filter out undefined values

return presentDates;
});

const absentData = computed(() => {
if (!attendance.data) return [];

const presentDates = attendance.data
.filter(att => att.status === 'Absent')
.map(att => att.attendance_date)
.filter(date => date); // Filter out undefined values

return presentDates;
});

const attrs = computed(() => [
{
key: 'today',
highlight: true,
dates: new Date(),
},
{
bar: 'green',
dates: presentData.value,
},
{
bar: 'red',
dates: absentData.value,
},
]);

function pageChange(page) {
const startDateX = `${page[0].id}-01`
const endDateX = `${page[0].id}-${dayjs(page[0].id).daysInMonth()}`
if (startDateX !== startDate.value || endDateX !== endDate.value) {
attendance.filters = [
["employee", "=", employee.data.name],
["attendance_date", ">=", startDateX],
["attendance_date", "<=", endDateX],
]
startDate.value = startDateX
endDate.value = endDateX
attendance.reload()
}
}

onMounted(() => {
socket.emit("doctype_subscribe", DOCTYPE)
socket.on("list_update", (data) => {
if (data.doctype == DOCTYPE) {
checkins.reload()
}
})
})


</script>
Loading
Loading