Skip to content
Merged
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
14 changes: 11 additions & 3 deletions mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@
"workbox-precaching": "^7.3.0"
},
"resolutions": {
"@babel/plugin-transform-modules-systemjs": "^7.29.4"
"@babel/plugin-transform-modules-systemjs": "^7.29.4",
"ws": ">=8.21.0",
"dompurify": ">=3.4.11",
"protobufjs": "^7.6.3",
"js-yaml": "^4.2.0"
},
"overrides": {
"@babel/plugin-transform-modules-systemjs": "^7.29.4"
"@babel/plugin-transform-modules-systemjs": "^7.29.4",
"ws": ">=8.21.0",
"dompurify": ">=3.4.11",
"protobufjs": "^7.6.3",
"js-yaml": "^4.2.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
Expand All @@ -34,6 +42,6 @@
"eslint-plugin-vue": "^9.30.0",
"postcss": "^8.4.5",
"tailwindcss": "^3.4.14",
"vite": "^6.0.0"
"vite": "^6.4.3"
}
}
1 change: 0 additions & 1 deletion mobile/src/composables/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class FileAttachment {
})

reader.onload = () => {
console.log('Loaded successfully ✅')
this.fileContents = reader.result.toString().split(',')[1]

uploader.submit({
Expand Down
32 changes: 21 additions & 11 deletions mobile/src/pages/AllocateEmployees.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@
<div class="text-right">
<PrimaryButton
name="+ New"
:disabled="showNewAllocation"
:disabled="showNewAllocation || !projectInstructionId"
@click="openNewAllocation"
></PrimaryButton>
</div>
<div class="pb-3"></div>
<div class="pt-2 pb-1 pl-2 pr-2" v-if="showNewAllocation">
<div class="flex items-center gap-3 bg-white pt-4 pb-2 pl-4">
<p>Select Employee</p>
<select v-model="allocationEmployee" class="w-40">
<option :value="e.name" v-for="e in employeeResource.data">
{{ e.employee_name }}
</option>
</select>
<Autocomplete
v-model="allocationEmployee"
:options="employeeOptions"
placeholder="Select..."
class="w-40"
/>
</div>
<textarea class="w-full" v-model="instruction"></textarea>
<div class="pt-2 text-center">
<PrimaryButton
name="Add"
@click="add"
:disabled="allocationEmployee == ''"
:disabled="!allocationEmployee"
:loading="employeeInstructionListResource.insert.loading"
></PrimaryButton>
</div>
Expand Down Expand Up @@ -77,14 +78,15 @@
/>
</template>
<script setup>
import { ref } from 'vue'
import { ref, computed } from 'vue'
import { useRoute } from 'vue-router'
import {
createResource,
createListResource,
FeatherIcon,
Dialog,
toast,
Autocomplete,
} from 'frappe-ui'
import PrimaryButton from '../components/PrimaryButton.vue'

Expand All @@ -98,7 +100,7 @@ const showNewAllocation = ref(false)
const showRemove = ref(false)

const instruction = ref('')
const allocationEmployee = ref('')
const allocationEmployee = ref(null)

const employeeResource = createResource({
url: 'projectit.api.get_employee_with_workit',
Expand All @@ -107,6 +109,13 @@ const employeeResource = createResource({
},
})

const employeeOptions = computed(() =>
(employeeResource.data || []).map((e) => ({
label: e.employee_name,
value: e.name,
}))
)

const projectAllocationInstructionResource = createListResource({
doctype: 'Project Allocation and Instrucions',
filters: { project_name: route.params.project_name },
Expand All @@ -126,7 +135,7 @@ const employeeInstructionListResource = createListResource({
insert: {
onSuccess() {
instruction.value = ''
allocationEmployee.value = ''
allocationEmployee.value = null
toast.success('Inserted')
employeeResource.fetch()
},
Expand Down Expand Up @@ -154,11 +163,12 @@ function remove(ei_name) {
}

function add() {
if (!projectInstructionId.value) return
employeeInstructionListResource.insert.submit({
parenttype: 'Project Allocation and Instrucions',
parentfield: 'allocation',
parent: projectInstructionId.value,
employee: allocationEmployee.value,
employee: allocationEmployee.value?.value,
instructions: instruction.value,
})
}
Expand Down
32 changes: 17 additions & 15 deletions mobile/src/pages/EditInstructions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,13 @@
<div>
<div class="flex items-center gap-3 bg-white pt-4 pb-2 pl-4">
<p>Select Employee</p>
<select
<Autocomplete
v-model="employeeInstructionId"
@change="updateInstructions"
:options="employeeOptions"
placeholder="Select..."
class="w-40"
>
<option
:value="e.name"
v-for="e in employeeInstructionListResource.data"
>
{{ e.employee_name }}
</option>
</select>
@change="updateInstructions"
/>
</div>
<div v-if="employeeInstructionId">
<textarea
Expand All @@ -65,16 +60,16 @@
<script setup>
import { useRoute } from 'vue-router'
import PrimaryButton from '../components/PrimaryButton.vue'
import { ref } from 'vue'
import { createListResource, toast } from 'frappe-ui'
import { ref, computed } from 'vue'
import { createListResource, toast, Autocomplete } from 'frappe-ui'

const route = useRoute()

const projectInstruction = ref('')
const projectInstructionId = ref('')

const employeeInstruction = ref('')
const employeeInstructionId = ref('')
const employeeInstructionId = ref(null)

const employeeInstructionListResource = createListResource({
doctype: 'Employee Allocation Instruction',
Expand All @@ -89,6 +84,13 @@ const employeeInstructionListResource = createListResource({
},
})

const employeeOptions = computed(() =>
(employeeInstructionListResource.data || []).map((e) => ({
label: e.employee_name,
value: e.name,
}))
)

const projectAllocationInstructionResource = createListResource({
doctype: 'Project Allocation and Instrucions',
filters: { project_name: route.params.project_name },
Expand All @@ -115,15 +117,15 @@ function setInstructions() {

function setEmployeeInstruction() {
employeeInstructionListResource.setValue.submit({
name: employeeInstructionId.value,
name: employeeInstructionId.value?.value,
instructions: employeeInstruction.value,
})
}

function updateInstructions() {
if (employeeInstructionId.value) {
let instructions = employeeInstructionListResource.data.find(
(d) => d.name === employeeInstructionId.value
(d) => d.name === employeeInstructionId.value?.value
)
employeeInstruction.value = instructions.instructions
}
Expand Down
60 changes: 33 additions & 27 deletions mobile/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1588,11 +1588,6 @@
resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==

"@protobufjs/inquire@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.2.tgz#ae64fbc014ff44c8bfad03dd4c93cd2d6a4c82db"
integrity sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==

"@protobufjs/path@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
Expand Down Expand Up @@ -2103,13 +2098,20 @@
dependencies:
"@types/unist" "*"

"@types/node@>=12.12.47", "@types/node@>=13.7.0":
"@types/node@>=12.12.47":
version "25.9.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-25.9.1.tgz#3bda556db500ae4319c08e7fc9ab94f19013ba0b"
integrity sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==
dependencies:
undici-types ">=7.24.0 <7.24.7"

"@types/node@>=13.7.0":
version "26.0.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-26.0.1.tgz#4a60e2c7a6d68bd261e265f8983bfe1601263ce3"
integrity sha512-fc3KiUoBt6kie0N9bIW3E47vZsuaMf0PM2AaUpLCLT0s/LvX1nxAim6Fc049cNxODPpGm6qRAuUOB86SkRuPQw==
dependencies:
undici-types "~8.3.0"

"@types/resolve@1.20.2":
version "1.20.2"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975"
Expand Down Expand Up @@ -2813,10 +2815,10 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dompurify@^3.2.6:
version "3.4.6"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.4.6.tgz#8f73010d14a46cd9781bbd3630f3bcef025a2111"
integrity sha512-+7gzEI8trIIQkVCvQ3ucGtNfH3nOmDgVTzc62rAAOlMxLth78pwpPoZCPc7CyRzAQF89MqcfPdEWkDwnjgqktg==
dompurify@>=3.4.11, dompurify@^3.2.6:
version "3.4.11"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.4.11.tgz#29c8ba496475f279ef4015784068452fb14a0680"
integrity sha512-zhlUV12GsaRzMsf9q5M254YhA4+VuF0fG+QFqu6aYpoGlKtz+w8//jBcGVYBgQkR5GHjUomejY84AV+/uPbWdw==
optionalDependencies:
"@types/trusted-types" "^2.0.7"

Expand Down Expand Up @@ -3923,10 +3925,10 @@ js-tokens@^9.0.1:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-9.0.1.tgz#2ec43964658435296f6761b34e10671c2d9527f4"
integrity sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==

js-yaml@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b"
integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==
js-yaml@^4.1.0, js-yaml@^4.2.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.0.tgz#d1900572a7f7cf0b5f540c83673e60bad3436592"
integrity sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==
dependencies:
argparse "^2.0.1"

Expand Down Expand Up @@ -4600,18 +4602,17 @@ prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.27.0, pros
prosemirror-state "^1.0.0"
prosemirror-transform "^1.1.0"

protobufjs@^7.2.5:
version "7.6.1"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.6.1.tgz#6320bb08c3be7dcfc6f9193ee03d3a4643f1eb37"
integrity sha512-4K0myLaWL5EteuSAro91EGFgcfVgxb64Jx+7oDAY6GOkXD4M69yuSEljNcInGVCA5sOPxmZ/EqDLj2x0Q0+Ygg==
protobufjs@^7.2.5, protobufjs@^7.6.3:
version "7.6.4"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.6.4.tgz#8bb000300026efd63eb7951d26e5dbb38f5658f2"
integrity sha512-RJJPTTpvFfHcWLkIa2JFWK4XvtSzS0yEWDmunqHXli1h3JlkbcQZXDZdcWxv+JK3Xsl5/UFDPZ0iGm7DAengYw==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.5"
"@protobufjs/eventemitter" "^1.1.1"
"@protobufjs/fetch" "^1.1.1"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.2"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.1"
Expand Down Expand Up @@ -5382,6 +5383,11 @@ unbox-primitive@^1.1.0:
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.24.6.tgz#61275b485d7fd4e9d269c7cf04ec2873c9cc0f91"
integrity sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==

undici-types@~8.3.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-8.3.0.tgz#44e9fc9f3244648cdea35e4f9bb2d681e9410809"
integrity sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==

unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2"
Expand Down Expand Up @@ -5528,10 +5534,10 @@ vite-plugin-pwa@^0.21.1:
workbox-build "^7.3.0"
workbox-window "^7.3.0"

vite@^6.0.0:
version "6.4.2"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.4.2.tgz#a4e548ca3a90ca9f3724582cab35e1ba15efc6f2"
integrity sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ==
vite@^6.4.3:
version "6.4.3"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.4.3.tgz#85a164db7ce706f2a776812efa2b340f1721858e"
integrity sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==
dependencies:
esbuild "^0.25.0"
fdir "^6.4.4"
Expand Down Expand Up @@ -5865,10 +5871,10 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==

ws@~8.20.1:
version "8.20.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.20.1.tgz#91a9ae2b312ccf98e0a85ec499b48cef45ab0ddb"
integrity sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==
ws@>=8.21.0, ws@~8.20.1:
version "8.21.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.21.0.tgz#012e413fc07429945121b0c153158c4343086951"
integrity sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==

xml-name-validator@^4.0.0:
version "4.0.0"
Expand Down
Loading