Skip to content

Commit

Permalink
NC 28 compat
Browse files Browse the repository at this point in the history
* Introduce Nextcloud 28 compatibility
* Update dependencies for NC28
* Add XMP Metadata in regular file view to avoid Ajax requests
* Prep-work for switching Photosphere images
* Adding new E2E tests

Signed-off-by: Robin Windey <[email protected]>
  • Loading branch information
R0Wi committed Dec 31, 2023
1 parent 23df2c6 commit 0ba0fc8
Show file tree
Hide file tree
Showing 54 changed files with 35,879 additions and 3,347 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,25 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v2
id: versions
continue-on-error: false
with:
path: ${{ env.APP_NAME }}

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Run Makefile
run: make appstore

- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,25 @@ jobs:
uses: actions/checkout@v4
with:
path: ${{ env.APP_NAME }}

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v2
id: versions
continue-on-error: false
with:
path: ${{ env.APP_NAME }}

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Run build
run: cd ${{ env.APP_NAME }} && make appstore

- name: Upload app tarball to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
Expand All @@ -26,6 +43,7 @@ jobs:
asset_name: ${{ env.APP_NAME }}.tar.gz
tag: ${{ github.ref }}
overwrite: true

- name: Upload app to Nextcloud appstore
uses: R0Wi/nextcloud-appstore-push-action@v1
with:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['8.0']
php-versions: ['8.1']
databases: ['sqlite']
server-versions: ['stable27']
server-versions: ['stable28']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-COVERAGE

Expand Down Expand Up @@ -68,8 +68,10 @@ jobs:
run: make coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
working-directory: ./apps/${{ env.APP_NAME }}
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }} -f coverage.xml -Z
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
verbose: true
6 changes: 3 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
php-versions: ['8.0', '8.1','8.2']
databases: ['sqlite']
server-versions: ['stable27']
server-versions: ['stable28']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}

Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
matrix:
php-versions: ['8.0', '8.1','8.2']
databases: ['mysql']
server-versions: ['stable27']
server-versions: ['stable28']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}

Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
matrix:
php-versions: ['8.0', '8.1','8.2']
databases: ['pgsql']
server-versions: ['stable27']
server-versions: ['stable28']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}

Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
APP_NAME: files_photospheres
NC_REF: stable27
NC_REF: stable28
NC_BIND: 'localhost:8080'
NODE_VER: 16
DB_USER: root
Expand Down Expand Up @@ -49,6 +49,26 @@ jobs:
uses: actions/checkout@v3
with:
path: apps/${{ env.APP_NAME }}

- name: Checkout viewer app
uses: actions/checkout@v3
with:
repository: nextcloud/viewer
ref: ${{ env.NC_REF }}
path: apps/viewer

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}

- name: Build app
run: npm ci && npm run build
working-directory: apps/${{ env.APP_NAME }}

- name: Build viewer app
run: npm ci && npm run build
working-directory: apps/viewer

- name: Set up and run Nextcloud server
run: |
Expand All @@ -64,19 +84,15 @@ jobs:
--admin-user ${{ env.E2E_USER }} \
--admin-pass ${{ env.E2E_PASSWORD }}
./occ app:enable ${{ env.APP_NAME }}
./occ app:enable viewer
php -S ${{ env.NC_BIND }} &
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}

- name: Install dependencies
- name: Install test dependencies
run: npm ci
working-directory: apps/${{ env.APP_NAME }}/tests/E2E

- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
run: npx playwright install chrome --with-deps
working-directory: apps/${{ env.APP_NAME }}/tests/E2E

- name: Test setup
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverage*.xml
*.cov
*.result.cache
coverage_html
node_modules
28 changes: 7 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,19 @@ ifneq (,$(wildcard $(CURDIR)/js/package.json))
make npm
endif

# Installs and updates the composer dependencies. If composer is not installed
# a copy is fetched from the web
.PHONY: composer
composer:
ifeq (, $(composer))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sS https://getcomposer.org/installer | php
mv composer.phar $(build_tools_directory)
php $(build_tools_directory)/composer.phar install --prefer-dist
php $(build_tools_directory)/composer.phar update --prefer-dist
else
composer install --prefer-dist
composer update --prefer-dist
endif

# Installs composer dependencies for building the app and
# wipes out unused composer files.
.PHONY: composer-build
composer-build:
.PHONY: composer
composer:
composer install --no-dev --prefer-dist

# Installs npm dependencies
.PHONY: npm
npm:
ifeq (,$(wildcard $(CURDIR)/package.json))
cd js && $(npm) run build
cd js && $(npm) ci && $(npm) run build
else
npm run build
npm ci && npm run build
endif

# Removes the appstore build
Expand Down Expand Up @@ -133,7 +117,7 @@ source:
.PHONY: appstore
appstore:
make distclean
make composer-build
make build
rm -rf $(appstore_build_directory)
mkdir -p $(appstore_build_directory)
tar cvzf $(appstore_package_name).tar.gz \
Expand All @@ -158,6 +142,8 @@ appstore:
--exclude="../$(app_name)/protractor\.*" \
--exclude="../$(app_name)/.*" \
--exclude="../$(app_name)/js/.*" \
--exclude="../$(app_name)/src" \
--exclude="../$(app_name)/node_modules" \
../$(app_name) \

.PHONY: test
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
[![codecov](https://codecov.io/gh/nextcloud/files_photospheres/branch/master/graph/badge.svg)](https://codecov.io/gh/nextcloud/files_photospheres)
![Lint](https://github.com/nextcloud/files_photospheres/workflows/Lint/badge.svg)
[![Generic badge](https://img.shields.io/github/v/release/nextcloud/files_photospheres)](https://github.com/nextcloud/files_photospheres/releases)
[![Generic badge](https://img.shields.io/badge/Nextcloud-27-orange)](https://github.com/nextcloud/server)
[![Generic badge](https://img.shields.io/badge/Nextcloud-28-orange)](https://github.com/nextcloud/server)


Nextcloud app for viewing Google PhotoSphere 360° images (panorama-images). This app is based on
the [photo-sphere-viewer.js](https://photo-sphere-viewer.js.org/) library. For
360° videos the library [marzipano](https://www.marzipano.net/) is used.

**This version is tested for Nextcloud 27.**
**This version is tested for Nextcloud 28.**

## Table of contents

Expand All @@ -22,6 +22,7 @@ the [photo-sphere-viewer.js](https://photo-sphere-viewer.js.org/) library. For
- [Install through the app store](#install-through-the-app-store)
- [Install manually](#install-manually)
- [Usage](#usage)
- [Caching](#caching)
- [Caveats](#caveats)
- [Report an issue](#report-an-issue)

Expand All @@ -48,6 +49,9 @@ You can manually install this app, by cloning the repository into your nextcloud
### Usage
After installing the app you can view your PhotoSphere 360° images by clicking on the file in the Nextcloud file browser. Note that opening PhotoSpheres from the gallery is currently not supported.

### Caching
This app uses the caching mechanism of Nextcloud to cache the XMP Metadata of the images. The cache is filled on demand when opening a directory for the first time and it will be valid for 24 hours. To get the full performance it's highly recommended to install a local caching backend like **APCu** or **Redis** like described [here](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html).

## Caveats
* It is not possible to open the photosphere viewer from the Gallery. You must use the file browser.
* `WebGL`-support must be activated in your browser.
Expand Down
12 changes: 10 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
integrating the photo-sphere-viewer.js component
into your nextcloud instance.
]]></description>
<version>1.27.0</version>
<version>1.28.0</version>
<licence>agpl</licence>
<author mail="[email protected]" >Robin Windey</author>
<namespace>Files_PhotoSpheres</namespace>
Expand All @@ -18,7 +18,15 @@
<repository>https://github.com/nextcloud/files_photospheres.git</repository>
<screenshot>https://user-images.githubusercontent.com/19730957/53694835-62a68a80-3db4-11e9-8c60-4ebdc02566d6.jpg</screenshot>
<dependencies>
<nextcloud min-version="27" max-version="27"/>
<nextcloud min-version="28" max-version="28"/>
<php min-version="8.0" max-version="8.2"/>
</dependencies>
<types>
<dav/>
</types>
<sabre>
<plugins>
<plugin>OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin</plugin>
</plugins>
</sabre>
</info>
Loading

0 comments on commit 0ba0fc8

Please sign in to comment.