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

feat: Mobile App Starter (PWA) #595

Merged
merged 54 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
f969cbd
feat: init frappe-ui
ruchamahabal Apr 7, 2023
e25495d
chore: update build scripts and gitignore config
ruchamahabal Apr 7, 2023
7ead16b
chore: add frappe-ui as git submodule
ruchamahabal Apr 12, 2023
4a635b6
chore: setup prettier and auto-format frontend code
ruchamahabal Apr 12, 2023
9e57c62
chore: ionic init, add ionic/vue & ionic/vue-router packages
ruchamahabal Apr 12, 2023
258cd03
refactor: setup views, router, theme with ionic
ruchamahabal Apr 13, 2023
1d61f0b
fix: config and setup
ruchamahabal Apr 13, 2023
c69d8d2
feat: Login
ruchamahabal Apr 18, 2023
758235c
feat: Dashboard
ruchamahabal Apr 19, 2023
d1a59f2
fix: navigation button padding
ruchamahabal Apr 26, 2023
fb451c3
fix: font style and inject user resource
ruchamahabal Apr 26, 2023
d9eb275
feat: Added Navigation Drawer/Side Menu
ruchamahabal Apr 27, 2023
9a36fdf
feat: set current route and highlight in menu
ruchamahabal Apr 27, 2023
7bfdec8
fix: build
ruchamahabal May 3, 2023
2243624
feat: extract Menu component
ruchamahabal May 4, 2023
1cc2172
feat: extract BaseLayout
ruchamahabal May 4, 2023
a7176b1
feat: Profile view with logout button
ruchamahabal May 5, 2023
f18d197
feat: show employee info in profile
ruchamahabal May 5, 2023
83042f3
feat: quicklinks in Profile
ruchamahabal May 5, 2023
9e423e2
feat: Checkin Panel design
ruchamahabal May 10, 2023
3c9314b
feat: add dayjs for date utilities
ruchamahabal May 11, 2023
317d34e
feat: complete CheckInPanel
ruchamahabal May 17, 2023
d0d858a
feat(UX): show toast message on checkin submission
ruchamahabal May 17, 2023
acf78e6
chore: change app logo
ruchamahabal May 17, 2023
25897da
style: fix login screen bg
ruchamahabal May 19, 2023
d110a7a
chore: upgrade vite
ruchamahabal May 26, 2023
201590b
chore: minimal VitePWA config
ruchamahabal May 26, 2023
08ac8ce
feat: add PWA config and assets
ruchamahabal May 26, 2023
b5aab37
fix: viewport and style on ios
ruchamahabal May 27, 2023
ee9d137
feat: Requests Panel
ruchamahabal May 27, 2023
2f95179
refactor: Requests Panel style and naming
ruchamahabal May 27, 2023
f9afca7
refactor: Leave Application APIs
ruchamahabal May 27, 2023
fc30f65
refactor: set leave dates and total leave days in leave resource tran…
ruchamahabal May 28, 2023
1c9f5c2
refactor: Extract Leave Request Item component
ruchamahabal May 28, 2023
d0f6717
feat: request action sheet on clicking leave record
ruchamahabal May 28, 2023
d726b38
feat: format field values in action sheets
ruchamahabal May 29, 2023
8944e6b
fix: handle checkbox field formatting
ruchamahabal May 29, 2023
a7843ea
fix: handle Text fields formatting
ruchamahabal May 29, 2023
3fea6b8
feat: Approve/Reject Leave Applications
ruchamahabal May 31, 2023
7a2825c
refactor: rename Requests -> Request
ruchamahabal May 31, 2023
effaa76
feat: Leave Balance dashboard
ruchamahabal May 31, 2023
a2628a5
feat: Upcoming Holidays
ruchamahabal Jun 2, 2023
6005f65
feat(Holidays): show complete holiday list on clicking View All
ruchamahabal Jun 2, 2023
d9a056c
refactor: separate out leave resources to a separate data file
ruchamahabal Jun 5, 2023
dada98f
feat: show leaves this month
ruchamahabal Jun 5, 2023
6b87298
feat: cancel button for submitted leave
ruchamahabal Jun 5, 2023
f50c311
style: add bottom margin for leave layout
ruchamahabal Jun 6, 2023
a552039
refactor: use List Resource for employee list
ruchamahabal Jun 6, 2023
6a873fa
feat: use socketio for realtime leave updates
ruchamahabal Jun 6, 2023
54508f4
refactor: register dayjs utils globally
ruchamahabal Jun 14, 2023
f37f15b
chore: bulk format code using prettier
ruchamahabal Jun 26, 2023
425af0d
chore: ignore formatting changes in blame
ruchamahabal Jun 26, 2023
b4fcec2
Merge branch 'mobile' into pwa-starter
ruchamahabal Jun 26, 2023
fff0eea
ci(temp): use develop branch for frappe and erpnext
ruchamahabal Jun 26, 2023
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
5 changes: 4 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
76c895a6c659356151433715a1efe9337e348c11

# bulk formatting
b55d6e27af6bd274dfa47e66a3012ddec68ce798
b55d6e27af6bd274dfa47e66a3012ddec68ce798

# bulk formatting PWA frontend code
f37f15b2b5329e3b0b35891e1c4fd82f48562c6d
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
run: |
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
BRANCH_TO_CLONE: ${{ env.HR_BRANCH }}
BRANCH_TO_CLONE: develop


- name: Run Tests
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ hrms/docs/current
node_modules/
dist/
__pycache__/

# build/
.vscode
.vs
node_modules
*debug.log
hrms/docs/current
hrms/public/frontend
hrms/www/hrms.html
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "frappe-ui"]
path = frappe-ui
url = https://github.com/frappe/frappe-ui
1 change: 1 addition & 0 deletions frappe-ui
Submodule frappe-ui added at bafe71
22 changes: 22 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
root: true,
env: {
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:vue/vue3-essential",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/no-deprecated-slot-attribute": "off",
"vue/multi-word-component-names": "off",
},
plugins: ["vue", "prettier"],
}
6 changes: 6 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.DS_Store
dev-dist
dist
dist-ssr
*.local
5 changes: 5 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"tabWidth": 2,
"useTabs": true
}
42 changes: 42 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Frappe UI Starter

This template should help get you started developing custom frontend for Frappe
apps with Vue 3 and the Frappe UI package.

This boilerplate sets up Vue 3, Vue Router, TailwindCSS, and Frappe UI out of
the box.

## Usage

This template is meant to be cloned inside an existing Frappe App. Assuming your
apps name is `todo`. Clone this template in the root folder of your app using `degit`.

```
cd apps/todo
npx degit netchampfaris/frappe-ui-starter frontend
cd frontend
yarn
yarn dev
```

In a development environment, you need to put the below key-value pair in your `site_config.json` file:

```
"ignore_csrf": 1
```

This will prevent `CSRFToken` errors while using the vite dev server. In production environment, the `csrf_token` is attached to the `window` object in `index.html` for you.

The Vite dev server will start on the port `8080`. This can be changed from `vite.config.js`.
The development server is configured to proxy your frappe app (usually running on port `8000`). If you have a site named `todo.test`, open `http://todo.test:8080` in your browser. If you see a button named "Click to send 'ping' request", congratulations!

If you notice the browser URL is `/frontend`, this is the base URL where your frontend app will run in production.
To change this, open `src/router.js` and change the base URL passed to `createWebHistory`.

## Resources

- [Vue 3](https://v3.vuejs.org/guide/introduction.html)
- [Vue Router](https://next.router.vuejs.org/guide/)
- [Frappe UI](https://github.com/frappe/frappe-ui)
- [TailwindCSS](https://tailwindcss.com/docs/utility-first)
- [Vite](https://vitejs.dev/guide/)
188 changes: 188 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<!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" />

<!-- 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"
/>

<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>

<script>
window.csrf_token = "{{ csrf_token }}"
</script>
<script type="module" src="/src/main.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions frontend/ionic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "FrappeHR",
"integrations": {},
"type": "vue",
"server": {
"url": "http://localhost:8080/"
}
}
5 changes: 5 additions & 0 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"allowJs": true
}
}
33 changes: 33 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "frappe-hr-ui",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"serve": "vite preview",
"build": "vite build --base=/assets/hrms/frontend/ && yarn copy-html-entry",
"ionic:build": "npm run build",
"ionic:serve": "vite dev --host",
"copy-html-entry": "cp ../hrms/public/frontend/index.html ../hrms/www/hrms.html"
},
"dependencies": {
"@ionic/vue": "^7.0.4",
"@ionic/vue-router": "^7.0.4",
"dayjs": "^1.11.7",
"feather-icons": "^4.28.0",
"frappe-ui": "^0.0.112",
"vue": "^3.2.25",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.1.2",
"autoprefixer": "^10.4.2",
"eslint": "^8.39.0",
"eslint-plugin-vue": "^9.11.0",
"postcss": "^8.4.5",
"prettier": "^2.8.8",
"tailwindcss": "^3.0.15",
"vite": "^3.1.6",
"vite-plugin-pwa": "^0.15.0"
}
}
6 changes: 6 additions & 0 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file added frontend/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<ion-app>
<Menu />
<ion-router-outlet id="main-content" />
<Toasts />
</ion-app>
</template>

<script setup>
import { IonApp, IonRouterOutlet } from "@ionic/vue"
import { defineComponent } from "vue"

import { Toasts } from "frappe-ui"

import Menu from "@/components/Menu.vue"
</script>
Binary file added frontend/src/assets/Inter/Inter-Black.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Black.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Bold.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Italic.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Italic.woff2
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Light.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Light.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Medium.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Medium.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Regular.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Regular.woff2
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-SemiBold.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Thin.woff
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter-Thin.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added frontend/src/assets/Inter/Inter.var.woff2
Binary file not shown.
Loading