Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updated babel config and fixed some eslint warnings
Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Aug 4, 2022
commit dc818991a1af0d6c6460b136e273a340e8e5d64b
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const babelConfig = require('@nextcloud/babel-config')

module.exports = babelConfig
330 changes: 50 additions & 280 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@babel/core": "^7.18.9",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.16.11",
"@nextcloud/babel-config": "^1.0.0",
"@nextcloud/browserslist-config": "^2.2.0",
"@nextcloud/eslint-config": "^8.0.0",
"@nextcloud/eslint-plugin": "^1.5.0",
Expand Down
5 changes: 3 additions & 2 deletions src/components/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<template>
<DashboardWidget id="recommendations" :items="recommendedFiles">
<template v-slot:default="{ item }">
<RecommendedFile :id="item.id"
<RecommendedFile
:id="item.id"
:key="item.id"
:extension="item.extension"
:mime-type="item.mimeType"
Expand All @@ -46,7 +47,7 @@
<script>
import { DashboardWidget } from '@nextcloud/vue-dashboard'
import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
import RecommendedFile from './RecommendedFile'
import RecommendedFile from './RecommendedFile.vue'

export default {
name: 'Dashboard',
Expand Down
9 changes: 5 additions & 4 deletions src/components/Recommendations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<template>
<div v-if="!hidden && !loading && enabled">
<div v-if="recommendedFiles.length > 0"
<div
v-if="recommendedFiles.length > 0"
id="recommendations"
class="group">
<RecommendedFile v-for="file in recommendedFiles"
<RecommendedFile
v-for="file in recommendedFiles"
:id="file.id"
:key="file.id"
:extension="file.extension"
Expand All @@ -38,7 +39,7 @@
</template>

<script>
import RecommendedFile from './RecommendedFile'
import RecommendedFile from './RecommendedFile.vue'

export default {
name: 'Recommendations',
Expand Down
9 changes: 6 additions & 3 deletions src/components/RecommendedFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
-->

<template>
<a v-tooltip="tooltip"
<a
v-tooltip="tooltip"
class="recommendation"
tabindex="0"
@click.prevent="navigate"
@keyup.enter.prevent="navigate">
<div class="thumbnail"
<div
class="thumbnail"
:style="{ 'background-image': 'url(' + previewUrl + ')' }" />
<div class="details">
<div class="file-name">
<template v-if="extension">
<span class="name">{{ nameWithoutExtension }}</span><!--
--><span v-if="extension"
--><span
v-if="extension"
class="extension">.{{ extension }}</span>
</template>
<template v-else>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div id="recommendations-setting-enabled">
<input id="recommendationsEnabledToggle"
<input
id="recommendationsEnabledToggle"
v-model="enabled"
class="checkbox"
checked="checked"
Expand Down
6 changes: 4 additions & 2 deletions src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export default new Vuex.Store({
actions: {
/**
* Toggle the recommendations and fetch recommended files if required
*
* @async
* @param {Object} context the store context
* @param {object} context the store context
* @param {boolean} enabled recommendations status
*/
async enabled(context, enabled) {
Expand All @@ -66,8 +67,9 @@ export default new Vuex.Store({
},
/**
* Fetch recommendations and current enabled setting
*
* @async
* @param {Object} context the store context
* @param {object} context the store context
* @param {boolean} [always] set to true to always get recommendations regardless of enabled setting
*/
async fetchRecommendations(context, always) {
Expand Down