Skip to content

Commit

Permalink
Merge pull request #3875 from LibreSign/backport/3864/stable28
Browse files Browse the repository at this point in the history
[stable28] chore: remove lodash-es
  • Loading branch information
vitormattos authored Nov 1, 2024
2 parents 2b0a81a + 7e14984 commit 42c4316
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 32 deletions.
7 changes: 0 additions & 7 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"crypto-js": "^4.2.0",
"js-confetti": "^0.12.0",
"linkify-string": "^4.1.3",
"lodash-es": "^4.17.21",
"pinia": "^2.2.5",
"v-perfect-signature": "^1.4.0",
"vue": "^2.7.16",
Expand Down
3 changes: 1 addition & 2 deletions src/Components/Draw/FileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
</template>

<script>
import { isEmpty } from 'lodash-es'
import { Cropper } from 'vue-advanced-cropper'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand Down Expand Up @@ -85,7 +84,7 @@ export default {
},
computed: {
hasImage() {
return !isEmpty(this.image)
return !!this.image
},
},
methods: {
Expand Down
3 changes: 1 addition & 2 deletions src/Components/Draw/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

<script>
import '@fontsource/dancing-script'
import { isEmpty } from 'lodash-es'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
Expand All @@ -62,7 +61,7 @@ export default {
}),
computed: {
isValid() {
return !isEmpty(this.value)
return !!this.value
},
},
watch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
</template>

<script>
import { size } from 'lodash-es'
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
export default {
Expand All @@ -36,7 +34,7 @@ export default {
},
computed: {
size() {
return size(this.pages)
return this.pages.length
},
actual() {
return this.value
Expand Down
8 changes: 4 additions & 4 deletions src/domains/files/service.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { deburr } from 'lodash-es'

import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'

/* eslint-disable valid-jsdoc */
import '@nextcloud/password-confirmation/dist/style.css' // Required for dialog styles

// from https://gist.github.com/codeguy/6684588
const slugfy = val =>
deburr(val)
const slugfy = (val) =>
val
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
.replace(/\s+/g, '-') // collapse whitespace and replace by -
Expand Down
3 changes: 1 addition & 2 deletions src/domains/settings/service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable valid-jsdoc */
import { isEmpty } from 'lodash-es'

import axios from '@nextcloud/axios'
import { confirmPassword } from '@nextcloud/password-confirmation'
Expand All @@ -26,7 +25,7 @@ const buildService = (http) => ({

const { data: { data } } = await http.put(url, { phone })

return { data, success: !isEmpty(data.phone) }
return { data, success: !!data.phone }
},
})

Expand Down
17 changes: 9 additions & 8 deletions src/store/modules/settings.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { defaults } from 'lodash-es'

import { loadState } from '@nextcloud/initial-state'

const libresignState = loadState('libresign', 'config', {})

export default {
namespaced: true,

state: defaults({}, libresignState?.settings || {}, {
hasSignatureFile: false,
identificationDocumentsFlow: false,
isApprover: false,
phoneNumber: '',
}),
state: {
...{
hasSignatureFile: false,
identificationDocumentsFlow: false,
isApprover: false,
phoneNumber: '',
},
...(libresignState?.settings || {}),
},
}
4 changes: 1 addition & 3 deletions src/views/Account/partials/Documents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
</template>

<script>
import { find, get } from 'lodash-es'
import axios from '@nextcloud/axios'
import { showError, showWarning, showSuccess } from '@nextcloud/dialogs'
import { FilePickerVue as FilePicker } from '@nextcloud/dialogs/filepicker.js'
Expand All @@ -73,7 +71,7 @@ const FILE_TYPE_INFO = {
}
const findDocumentByType = (list, type) => {
return find(list, row => get(row, ['file_type', 'type']) === type) || {
return list.find(row => row?.file_type?.type === type) || {
nodeId: 0,
uuid: '',
status: -1,
Expand Down

0 comments on commit 42c4316

Please sign in to comment.