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

chore: remove lodash-es #3864

Merged
merged 1 commit into from
Nov 1, 2024
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
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