Skip to content

Commit

Permalink
chore: remove lodash-es
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>

[skip ci]
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Nov 1, 2024
1 parent 7bc7fbb commit e8bb7c1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 26 deletions.
6 changes: 0 additions & 6 deletions package-lock.json

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

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
6 changes: 4 additions & 2 deletions src/domains/files/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,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
@@ -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
15 changes: 9 additions & 6 deletions src/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,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 @@ -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 e8bb7c1

Please sign in to comment.