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

Use npm 7 #593

Merged
merged 1 commit into from
Jun 16, 2021
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
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
module.exports = {
extends: [
'@nextcloud',
]
],
rules: {
// Allow shallow import of @vue/test-utils in order to be able to use it in
// the src folder
artonge marked this conversation as resolved.
Show resolved Hide resolved
'node/no-unpublished-import': ['error', {
allowModules: ['@vue/test-utils', '@testing-library/vue'],
}],
},
}
7 changes: 3 additions & 4 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ env:

jobs:
cypress:
name: cypress ${{ matrix.node-version }}
name: cypress
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [12.x]
# containers: [1, 2, 3]

steps:
- name: Checkout server
Expand All @@ -38,6 +35,8 @@ jobs:
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu
coverage: none
ini-values:
apc.enable_cli=on

- name: Set up Nextcloud
env:
Expand Down
86 changes: 42 additions & 44 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
php-versions: ['7.3', '7.4']
php-versions: ['7.2', '7.3', '7.4']

name: php${{ matrix.php-versions }}
steps:
Expand Down Expand Up @@ -52,46 +52,44 @@ jobs:
- name: Run coding standards check
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

# node:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# node-version: [12.x]
#
# name: eslint node${{ matrix.node-version }}
# steps:
# - uses: actions/checkout@v2
#
# - name: Set up node ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
#
# - name: Install dependencies
# run: npm ci
#
# - name: Lint
# run: npm run lint
#
# stylelint:
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# node-version: [12.x]
#
# name: stylelint node${{ matrix.node-version }}
# steps:
# - uses: actions/checkout@v2
#
# - name: Set up node ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
#
# - name: Install dependencies
# run: npm ci
#
# - name: Lint
# run: npm run stylelint
node:
runs-on: ubuntu-latest

name: eslint node
steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14

- name: Set up npm7
run: npm i -g npm@7

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

stylelint:
runs-on: ubuntu-latest

name: stylelint node
steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14

- name: Set up npm7
run: npm i -g npm@7

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run stylelint
15 changes: 7 additions & 8 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12]

name: node${{ matrix.node-version }}
name: node
steps:
- uses: actions/checkout@v2

- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: 14

- name: Set up npm7
run: npm i -g npm@7

- name: Install dependencies & build
run: |
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ jobs:
jest:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12]

name: node${{ matrix.node-version }}
name: node
steps:
- uses: actions/checkout@v2

- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: 14

- name: Set up npm7
run: npm i -g npm@7

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/@nextcloud/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const axios = jest.createMockFromModule('@nextcloud/axios')

const wsData = require('./activity_ws.json')

axios.get = async function(url) {
axios.get = function(url) {
return new Promise((resolve, reject) => {
if (url === 'http://localhostundefined/ocs/v2.php/apps/activity/api/v2/activity/filter') {
resolve({ data: wsData })
Expand Down
4 changes: 4 additions & 0 deletions css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
margin-left: 5px;
text-overflow: ellipsis;
}

.activitymessage {
margin-left: 25px;
color: var(--color-text-maxcontrast);
text-overflow: ellipsis;
}

.activity-previews {
margin-left: 24px;
}
Expand Down Expand Up @@ -120,6 +122,7 @@
margin-right: 6px;
width: 16px;
}

#app-navigation li span.no-icon {
padding-left: 25px;
}
Expand Down Expand Up @@ -173,6 +176,7 @@
background-size: contain;
opacity: .5;
}

.activity-icon img {
max-width: 16px;
max-height: 16px;
Expand Down
3 changes: 0 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@
*
*/

import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'
import axios from '@nextcloud/axios'

addMatchImageSnapshotCommand()

const url = Cypress.config('baseUrl').replace(/\/index.php\/?$/g, '')
Cypress.env('baseUrl', url)

Expand Down
4 changes: 2 additions & 2 deletions js/activity-sidebar.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/activity-sidebar.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ object-assign
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*!
* Vue.js v2.6.12
* (c) 2014-2020 Evan You
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/

Expand Down
2 changes: 1 addition & 1 deletion js/activity-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/CurrentUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function getCloudId() {
protected function getCloudIDFromToken() {
if (!empty($this->request->server['PHP_AUTH_USER'])) {
$token = $this->request->server['PHP_AUTH_USER'];
/**
* Until https://github.com/nextcloud/server/pull/26681 is merged
* @psalm-suppress InvalidCatch
*/
try {
$share = $this->shareManager->getShareByToken($token);
if ($share->getShareType() === IShare::TYPE_REMOTE) {
Expand Down
Loading