Skip to content

Commit

Permalink
Vue example app
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 26, 2018
0 parents commit e7db27f
Show file tree
Hide file tree
Showing 16 changed files with 14,693 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"extends": "standard"
};
64 changes: 64 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
sudo: false
dist: trusty
language: php
php:
- 5.6
- 7
- 7.1
env:
global:
- CORE_BRANCH=stable13
matrix:
- DB=pgsql

matrix:
allow_failures:
- env: DB=pgsql CORE_BRANCH=master
include:
- php: 5.6
env: DB=sqlite
- php: 5.6
env: DB=mysql
- php: 5.6
env: DB=pgsql CORE_BRANCH=master
fast_finish: true


before_install:
# enable a display for running JavaScript tests
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- nvm install 8
- npm install -g npm@latest
- make
- make appstore
# install core
- cd ../
- git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH nextcloud
- mv "$TRAVIS_BUILD_DIR" nextcloud/apps/vueexample

before_script:
- if [[ "$DB" == 'pgsql' ]]; then createuser -U travis -s oc_autotest; fi
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
- cd nextcloud
- mkdir data
- ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
- ./occ app:enable vueexample
- php -S localhost:8080 &
- cd apps/vueexample

script:
- make test

after_failure:
- cat ../../data/nextcloud.log

addons:
firefox: 'latest'
mariadb: '10.1'

services:
- postgresql
- mariadb
661 changes: 661 additions & 0 deletions COPYING

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
all: dev-setup lint build-js-production test

# Dev env management
dev-setup: clean clean-dev npm-init

npm-init:
npm install

npm-update:
npm update

# Building
build-js:
npm run dev

build-js-production:
npm run build

watch-js:
npm run watch

# Testing
test:
npm run test

test-watch:
npm run test:watch

test-coverage:
npm run test:coverage

# Linting
lint:
npm run lint

lint-fix:
npm run lint:fix

# Cleaning
clean:
rm -f js/vueexample.js
rm -f js/vueexample.js.map

clean-dev:
rm -rf node_modules

23 changes: 23 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>vueexample</id>
<name>Vue example</name>
<summary>test</summary>
<description><![CDATA[test]]></description>
<version>0.0.1</version>
<licence>agpl</licence>
<author mail="jus@bitgrid.net" >Julius Härtl</author>
<namespace>VueExample</namespace>
<category>tools</category>
<bugs>https://github.com</bugs>
<dependencies>
<nextcloud min-version="13" max-version="14"/>
</dependencies>
<navigations>
<navigation>
<name>VueExample</name>
<route>vueexample.page.index</route>
</navigation>
</navigations>
</info>
15 changes: 15 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Create your routes in here. The name is the lowercase name of the controller
* without the controller part, the stuff after the hash is the method.
* e.g. page#index -> OCA\MailTest\Controller\PageController->index()
*
* The controller class has to be registered in the application.php file since
* it's instantiated in there
*/
return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#mail', 'url' => '/mail', 'verb' => 'GET'],
]
];
56 changes: 56 additions & 0 deletions img/app.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
namespace OCA\VueExample\Controller;

use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\IL10N;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Controller;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;

class PageController extends Controller {
private $userId;

public function __construct($AppName, IRequest $request, $UserId, IL10N $l10n){
parent::__construct($AppName, $request);
$this->userId = $UserId;
$this->l10n = $l10n;
}

/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index() {
$response = new TemplateResponse('vueexample', 'main');
return $response;
}

}
Loading

0 comments on commit e7db27f

Please sign in to comment.