kopia lustrzana https://github.com/nextcloud/social
Merge pull request #272 from nextcloud/dependabot/npm_and_yarn/eslint-and-eslint-plugin-vue
Bump eslint and eslint-plugin-vuepull/321/head
commit
0be874c0e6
|
@ -50,8 +50,15 @@ module.exports = {
|
|||
// es6 import/export and require
|
||||
'node/no-unpublished-require': ['off'],
|
||||
'node/no-unsupported-features/es-syntax': ['off'],
|
||||
// kebab case components for vuejs
|
||||
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
|
||||
// space before self-closing elements
|
||||
'vue/html-closing-bracket-spacing': 'error',
|
||||
// newline before closing bracket
|
||||
'vue/html-closing-bracket-newline': ["error", {
|
||||
"singleline": "never",
|
||||
"multiline": "never"
|
||||
}],
|
||||
// code spacing with attributes
|
||||
'vue/max-attributes-per-line': [
|
||||
'error',
|
||||
|
|
Plik diff jest za duży
Load Diff
10
package.json
10
package.json
|
@ -21,8 +21,8 @@
|
|||
"dev": "webpack --config webpack.dev.js",
|
||||
"watch": "webpack --progress --watch --config webpack.dev.js",
|
||||
"build": "webpack --progress --hide-modules --config webpack.prod.js",
|
||||
"lint": "eslint --ext .js,.vue src tests",
|
||||
"lint:fix": "eslint --ext .js,.vue src tests --fix",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||
"test": "jest",
|
||||
"test:coverage": "jest --coverage"
|
||||
},
|
||||
|
@ -61,15 +61,15 @@
|
|||
"babel-jest": "^23.6.0",
|
||||
"babel-loader": "^8.0.5",
|
||||
"css-loader": "^2.1.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-standard": "^11.0.0",
|
||||
"eslint": "^5.11.0",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-friendly-formatter": "^4.0.1",
|
||||
"eslint-loader": "^2.1.1",
|
||||
"eslint-plugin-import": "^2.13.0",
|
||||
"eslint-plugin-node": "^8.0.1",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-standard": "^3.1.0",
|
||||
"eslint-plugin-vue": "^4.5.0",
|
||||
"eslint-plugin-vue": "^5.0.0",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^3.0.1",
|
||||
"jest": "^23.6.0",
|
||||
|
|
44
src/App.vue
44
src/App.vue
|
@ -5,11 +5,17 @@
|
|||
</div>
|
||||
<div id="app-content">
|
||||
<div v-if="serverData.isAdmin && !serverData.checks.success" class="setup social__wrapper">
|
||||
<h3 v-if="!serverData.checks.checks.wellknown">{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}</h3>
|
||||
<p v-if="!serverData.checks.checks.wellknown">{{ t('social', 'Social needs the .well-known automatic discovery to be properly set up. If Nextcloud is not installed in the root of the domain, it is often the case that Nextcloud can\'t configure this automatically. To use Social, the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank"
|
||||
rel="noreferrer noopener">{{ t('social', 'Open documentation') }} ↗</a></p>
|
||||
<h3 v-if="!serverData.checks.checks.wellknown">
|
||||
{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}
|
||||
</h3>
|
||||
<p v-if="!serverData.checks.checks.wellknown">
|
||||
{{ t('social', 'Social needs the .well-known automatic discovery to be properly set up. If Nextcloud is not installed in the root of the domain, it is often the case that Nextcloud can\'t configure this automatically. To use Social, the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
{{ t('social', 'Open documentation') }} ↗
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<Search v-if="searchTerm !== ''" :term="searchTerm" />
|
||||
<search v-if="searchTerm !== ''" :term="searchTerm" />
|
||||
<router-view v-if="searchTerm === ''" :key="$route.fullPath" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,15 +25,23 @@
|
|||
<p>{{ t('social', 'ActivityPub requires a fixed URL to make entries unique. Note that this can not be changed later without resetting the Social app.') }}</p>
|
||||
<form @submit.prevent="setCloudAddress">
|
||||
<p>
|
||||
<label class="hidden">{{ t('social', 'ActivityPub URL base') }}</label>
|
||||
<input :placeholder="serverData.cliUrl" v-model="cloudAddress" type="url"
|
||||
<label class="hidden">
|
||||
{{ t('social', 'ActivityPub URL base') }}
|
||||
</label>
|
||||
<input v-model="cloudAddress" :placeholder="serverData.cliUrl" type="url"
|
||||
required>
|
||||
<input :value="t('social', 'Finish setup')" type="submit" class="primary">
|
||||
</p>
|
||||
<template v-if="!serverData.checks.success">
|
||||
<h3 v-if="!serverData.checks.checks.wellknown">{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}</h3>
|
||||
<p v-if="!serverData.checks.checks.wellknown">{{ t('social', 'Social needs the .well-known automatic discovery to be properly set up. If Nextcloud is not installed in the root of the domain, it is often the case that Nextcloud can\'t configure this automatically. To use Social, the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank"
|
||||
rel="noreferrer noopener">{{ t('social', 'Open documentation') }} ↗</a></p>
|
||||
<h3 v-if="!serverData.checks.checks.wellknown">
|
||||
{{ t('social', '.well-known/webfinger isn\'t properly set up!') }}
|
||||
</h3>
|
||||
<p v-if="!serverData.checks.checks.wellknown">
|
||||
{{ t('social', 'Social needs the .well-known automatic discovery to be properly set up. If Nextcloud is not installed in the root of the domain, it is often the case that Nextcloud can\'t configure this automatically. To use Social, the admin of this Nextcloud instance needs to manually configure the .well-known redirects: ') }}<a class="external_link" href="https://docs.nextcloud.com/server/15/go.php?to=admin-setup-well-known-URL" target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
{{ t('social', 'Open documentation') }} ↗
|
||||
</a>
|
||||
</p>
|
||||
</template>
|
||||
</form>
|
||||
</template>
|
||||
|
@ -76,26 +90,16 @@
|
|||
|
||||
<script>
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect,
|
||||
Avatar
|
||||
AppNavigation
|
||||
} from 'nextcloud-vue'
|
||||
import axios from 'nextcloud-axios'
|
||||
import TimelineEntry from './components/TimelineEntry'
|
||||
import ProfileInfo from './components/ProfileInfo'
|
||||
import Search from './components/Search'
|
||||
import currentuserMixin from './mixins/currentUserMixin'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
TimelineEntry,
|
||||
Multiselect,
|
||||
Avatar,
|
||||
ProfileInfo,
|
||||
Search
|
||||
},
|
||||
mixins: [currentuserMixin],
|
||||
|
|
|
@ -26,31 +26,37 @@
|
|||
<avatar :user="currentUser.uid" :display-name="currentUser.displayName" :disable-tooltip="true"
|
||||
:size="32" />
|
||||
<div class="post-author">
|
||||
<span class="post-author-name">{{ currentUser.displayName }}</span>
|
||||
<span class="post-author-id">{{ socialId }}</span>
|
||||
<span class="post-author-name">
|
||||
{{ currentUser.displayName }}
|
||||
</span>
|
||||
<span class="post-author-id">
|
||||
{{ socialId }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<form class="new-post-form" @submit.prevent="createPost">
|
||||
<vue-tribute :options="tributeOptions">
|
||||
<!-- eslint-disable-next-line vue/valid-v-model -->
|
||||
<div v-contenteditable:post.dangerousHTML="canType" ref="composerInput" class="message"
|
||||
<div ref="composerInput" v-contenteditable:post.dangerousHTML="canType" class="message"
|
||||
placeholder="What would you like to share?" @keyup.enter="keyup" />
|
||||
</vue-tribute>
|
||||
<emoji-picker ref="emojiPicker" :search="search" class="emoji-picker-wrapper"
|
||||
@emoji="insert">
|
||||
<a v-tooltip="'Insert emoji'" slot="emoji-invoker" slot-scope="{ events }"
|
||||
<a slot="emoji-invoker" v-tooltip="'Insert emoji'" slot-scope="{ events }"
|
||||
class="emoji-invoker" tabindex="0" v-on="events"
|
||||
@keyup.enter="events.click" @keyup.space="events.click" />
|
||||
<div slot="emoji-picker" slot-scope="{ emojis, insert, display }" class="emoji-picker popovermenu">
|
||||
<!-- eslint-disable-next-line vue/no-template-shadow -->
|
||||
<div slot="emoji-picker" slot-scope="{ emojis, insert }" class="emoji-picker popovermenu">
|
||||
<div>
|
||||
<div>
|
||||
<input v-focus-on-create v-model="search" type="text"
|
||||
<input v-model="search" v-focus-on-create type="text"
|
||||
@keyup.enter="insert(emojis)">
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="(emojiGroup, category) in emojis" :key="category">
|
||||
<h5>{{ category }}</h5>
|
||||
<div>
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<span v-for="(emoji, emojiName) in emojiGroup" :key="emojiName" :title="emojiName"
|
||||
tabindex="0"
|
||||
class="emoji" @click="insert(emoji)" @keyup.enter="insert(emoji)"
|
||||
|
@ -68,7 +74,7 @@
|
|||
<div v-click-outside="hidePopoverMenu">
|
||||
<button :class="currentVisibilityIconClass" @click.prevent="togglePopoverMenu" />
|
||||
<div :class="{open: menuOpened}" class="popovermenu menu-center">
|
||||
<PopoverMenu :menu="visibilityPopover" />
|
||||
<popover-menu :menu="visibilityPopover" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,9 +25,12 @@
|
|||
<button v-if="isCurrentUserFollowing" :class="{'icon-loading-small': followLoading}"
|
||||
@click="unfollow()"
|
||||
@mouseover="followingText=t('social', 'Unfollow')" @mouseleave="followingText=t('social', 'Following')">
|
||||
<span><span class="icon-checkmark" />{{ followingText }}</span></button>
|
||||
<span><span class="icon-checkmark" />{{ followingText }}</span>
|
||||
</button>
|
||||
<button v-else :class="{'icon-loading-small': followLoading}" class="primary"
|
||||
@click="follow"><span>{{ t('social', 'Follow') }}</span></button>
|
||||
@click="follow">
|
||||
<span>{{ t('social', 'Follow') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -29,19 +29,29 @@
|
|||
:size="128" />
|
||||
<h2>{{ displayName }}</h2>
|
||||
<p>{{ accountInfo.account }}</p>
|
||||
<p v-if="accountInfo.website">Website: <a :href="accountInfo.website.value">{{ accountInfo.website.value }}</a></p>
|
||||
<p v-if="accountInfo.website">
|
||||
Website: <a :href="accountInfo.website.value">
|
||||
{{ accountInfo.website.value }}
|
||||
</a>
|
||||
</p>
|
||||
<follow-button :account="accountInfo.account" />
|
||||
</div>
|
||||
<!-- TODO: we have no details, timeline and follower list for non-local accounts for now -->
|
||||
<ul v-if="accountInfo.details && accountInfo.local" class="user-profile--sections">
|
||||
<li>
|
||||
<router-link :to="{ name: 'profile', params: { account: uid } }" class="icon-category-monitoring">{{ getCount('post') }} {{ t('social', 'posts') }}</router-link>
|
||||
<router-link :to="{ name: 'profile', params: { account: uid } }" class="icon-category-monitoring">
|
||||
{{ getCount('post') }} {{ t('social', 'posts') }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link :to="{ name: 'profile.following', params: { account: uid } }" class="icon-category-social">{{ getCount('following') }} {{ t('social', 'following') }}</router-link>
|
||||
<router-link :to="{ name: 'profile.following', params: { account: uid } }" class="icon-category-social">
|
||||
{{ getCount('following') }} {{ t('social', 'following') }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link :to="{ name: 'profile.followers', params: { account: uid } }" class="icon-category-social">{{ getCount('followers') }} {{ t('social', 'followers') }}</router-link>
|
||||
<router-link :to="{ name: 'profile.followers', params: { account: uid } }" class="icon-category-social">
|
||||
{{ getCount('followers') }} {{ t('social', 'followers') }}
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -24,12 +24,16 @@
|
|||
<div class="social__wrapper">
|
||||
<div v-if="allResults.length < 1" id="emptycontent" :class="{'icon-loading': loading || remoteLoading}">
|
||||
<div v-if="!loading" class="icon-search" />
|
||||
<h2 v-if="!loading">{{ t('social', 'No accounts found') }}</h2>
|
||||
<p v-if="!loading">No accounts found for {{ term }}</p>
|
||||
<h2 v-if="!loading">
|
||||
{{ t('social', 'No accounts found') }}
|
||||
</h2>
|
||||
<p v-if="!loading">
|
||||
No accounts found for {{ term }}
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="allResults.length > 0">
|
||||
<h3>{{ t('social', 'Searching for') }} {{ term }}</h3>
|
||||
<UserEntry v-for="result in allResults" :key="result.id" :item="result" />
|
||||
<user-entry v-for="result in allResults" :key="result.id" :item="result" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -3,24 +3,32 @@
|
|||
<div class="entry-content">
|
||||
<div v-if="item.actor_info" class="post-avatar">
|
||||
<avatar v-if="item.local" :size="32" :user="item.actor_info.preferredUsername"
|
||||
:display-name="item.actor_info.account" :disable-tooltip="true"
|
||||
/>
|
||||
:display-name="item.actor_info.account" :disable-tooltip="true" />
|
||||
<avatar v-else :size="32" :url="avatarUrl"
|
||||
:disable-tooltip="true" />
|
||||
</div>
|
||||
<div class="post-content">
|
||||
<div class="post-author-wrapper">
|
||||
<router-link v-if="item.actor_info" :to="{ name: 'profile', params: { account: item.local ? item.actor_info.preferredUsername : item.actor_info.account }}">
|
||||
<span class="post-author">{{ userDisplayName(item.actor_info) }}</span>
|
||||
<span class="post-author-id">{{ item.actor_info.account }}</span>
|
||||
<span class="post-author">
|
||||
{{ userDisplayName(item.actor_info) }}
|
||||
</span>
|
||||
<span class="post-author-id">
|
||||
{{ item.actor_info.account }}
|
||||
</span>
|
||||
</router-link>
|
||||
<a v-else :href="item.attributedTo">
|
||||
<span class="post-author-id">{{ item.attributedTo }}</span>
|
||||
<span class="post-author-id">
|
||||
{{ item.attributedTo }}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div class="post-message" v-html="formatedMessage" />
|
||||
</div>
|
||||
<div :data-timestamp="timestamp" class="post-timestamp live-relative-timestamp">{{ relativeTimestamp }}</div>
|
||||
<div :data-timestamp="timestamp" class="post-timestamp live-relative-timestamp">
|
||||
{{ relativeTimestamp }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -22,10 +22,14 @@
|
|||
|
||||
<template>
|
||||
<div class="social__timeline">
|
||||
<timeline-entry v-for="entry in timeline" :item="entry" :key="entry.id" />
|
||||
<timeline-entry v-for="entry in timeline" :key="entry.id" :item="entry" />
|
||||
<infinite-loading ref="infiniteLoading" @infinite="infiniteHandler">
|
||||
<div slot="spinner"><div class="icon-loading" /></div>
|
||||
<div slot="no-more"><div class="list-end" /></div>
|
||||
<div slot="spinner">
|
||||
<div class="icon-loading" />
|
||||
</div>
|
||||
<div slot="no-more">
|
||||
<div class="list-end" />
|
||||
</div>
|
||||
<div slot="no-results">
|
||||
<empty-content :item="emptyContentData" />
|
||||
</div>
|
||||
|
@ -34,25 +38,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect
|
||||
} from 'nextcloud-vue'
|
||||
import InfiniteLoading from 'vue-infinite-loading'
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
import Composer from './../components/Composer'
|
||||
import CurrentUserMixin from './../mixins/currentUserMixin'
|
||||
import EmptyContent from './../components/EmptyContent'
|
||||
|
||||
export default {
|
||||
name: 'Timeline',
|
||||
components: {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
TimelineEntry,
|
||||
Multiselect,
|
||||
Composer,
|
||||
InfiniteLoading,
|
||||
EmptyContent
|
||||
},
|
||||
|
|
|
@ -30,15 +30,23 @@
|
|||
</div>
|
||||
<div class="user-details">
|
||||
<router-link v-if="!serverData.public" :to="{ name: 'profile', params: { account: item.local ? item.preferredUsername : item.account }}">
|
||||
<span class="post-author">{{ item.name }}</span>
|
||||
<span class="user-description">{{ item.account }}</span>
|
||||
<span class="post-author">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
<span class="user-description">
|
||||
{{ item.account }}
|
||||
</span>
|
||||
</router-link>
|
||||
<a v-else :href="item.id" target="_blank"
|
||||
rel="noreferrer">
|
||||
<span class="post-author">{{ item.name }}</span>
|
||||
<span class="user-description">{{ item.account }}</span>
|
||||
<span class="post-author">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
<span class="user-description">
|
||||
{{ item.account }}
|
||||
</span>
|
||||
</a>
|
||||
<!-- TODO check where the html is coming from to avoid security issues -->
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<p v-html="item.summary" />
|
||||
</div>
|
||||
<follow-button :account="item.account" />
|
||||
|
|
|
@ -38,13 +38,6 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect,
|
||||
Avatar
|
||||
} from 'nextcloud-vue'
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
import ProfileInfo from './../components/ProfileInfo'
|
||||
import EmptyContent from '../components/EmptyContent'
|
||||
import serverData from '../mixins/serverData'
|
||||
|
@ -53,11 +46,6 @@ export default {
|
|||
name: 'Profile',
|
||||
components: {
|
||||
EmptyContent,
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
TimelineEntry,
|
||||
Multiselect,
|
||||
Avatar,
|
||||
ProfileInfo
|
||||
},
|
||||
mixins: [
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<template>
|
||||
<div class="social__followers">
|
||||
<user-entry v-for="user in users" :item="user" :key="user.id" />
|
||||
<user-entry v-for="user in users" :key="user.id" :item="user" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -2,11 +2,17 @@
|
|||
<div class="social__wrapper">
|
||||
<transition name="slide-fade">
|
||||
<div v-if="showInfo" class="social__welcome">
|
||||
<a class="close icon-close" href="#" @click="hideInfo()"><span class="hidden-visually">Close</span></a>
|
||||
<a class="close icon-close" href="#" @click="hideInfo()">
|
||||
<span class="hidden-visually">
|
||||
Close
|
||||
</span>
|
||||
</a>
|
||||
<h2>🎉 {{ t('social', 'Nextcloud becomes part of the federated social networks!') }}</h2>
|
||||
<p>
|
||||
{{ t('social', 'We automatically created a Social account for you. Your Social ID is the same as your federated cloud ID:') }}
|
||||
<span class="social-id">{{ socialId }}</span>
|
||||
<span class="social-id">
|
||||
{{ socialId }}
|
||||
</span>
|
||||
</p>
|
||||
<div v-show="!isFollowingNextcloudAccount" class="follow-nextcloud">
|
||||
<p>{{ t('social', 'Since you are new to Social, start by following the official Nextcloud account so you don\'t miss any news') }}</p>
|
||||
|
@ -83,29 +89,15 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect
|
||||
} from 'nextcloud-vue'
|
||||
import InfiniteLoading from 'vue-infinite-loading'
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
import Composer from './../components/Composer'
|
||||
import CurrentUserMixin from './../mixins/currentUserMixin'
|
||||
import follow from './../mixins/follow'
|
||||
import EmptyContent from './../components/EmptyContent'
|
||||
import TimelineList from './../components/TimelineList'
|
||||
|
||||
export default {
|
||||
name: 'Timeline',
|
||||
components: {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
TimelineEntry,
|
||||
Multiselect,
|
||||
Composer,
|
||||
InfiniteLoading,
|
||||
EmptyContent,
|
||||
TimelineList
|
||||
},
|
||||
mixins: [
|
||||
|
|
Ładowanie…
Reference in New Issue