Skip to content

Commit

Permalink
Merge pull request #3874 from LibreSign/backport/3864/stable30
Browse files Browse the repository at this point in the history
[stable30] chore: remove lodash-es
  • Loading branch information
vitormattos authored Nov 1, 2024
2 parents 361750c + d4594ae commit 5c3c167
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 30 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 @@ -39,7 +39,6 @@
"blueimp-md5": "^2.19.0",
"crypto-js": "^4.2.0",
"js-confetti": "^0.12.0",
"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 @@ -58,7 +58,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 @@ -89,7 +88,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 @@ -41,7 +41,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 @@ -66,7 +65,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 @@ -17,8 +17,6 @@
</template>

<script>
import { size } from 'lodash-es'

import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'

export default {
Expand All @@ -40,7 +38,7 @@ export default {
},
computed: {
size() {
return size(this.pages)
return this.pages.length
},
actual() {
return this.value
Expand Down
7 changes: 4 additions & 3 deletions src/domains/files/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { deburr } from 'lodash-es'

import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
Expand All @@ -11,8 +10,10 @@ import { generateOcsUrl } from '@nextcloud/router'
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
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/* eslint-disable valid-jsdoc */
import { isEmpty } from 'lodash-es'

import axios from '@nextcloud/axios'
import { confirmPassword } from '@nextcloud/password-confirmation'
Expand All @@ -30,7 +29,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
16 changes: 9 additions & 7 deletions src/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { defaults } from 'lodash-es'

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

Expand All @@ -11,10 +10,13 @@ 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 @@ -58,8 +58,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 @@ -77,7 +75,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 5c3c167

Please sign in to comment.