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

Preliminary frontend work #13

Merged
merged 2 commits into from
Mar 9, 2017
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
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "js/vendor"
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ nbproject
# test files
clover.xml

node_modules
lib/composer
js/vendor
tools/*
js/templates/*.handlebars.js
tests/unit/results
34 changes: 34 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"camelcase": true,
"eqeqeq": true,
"immed": true,
"latedef": false,
"noarg": true,
"nonbsp": true,
"undef": true,
"unused": true,
"trailing": true,
"maxparams": 5,
"curly": true,
"jquery": true,
"maxlen": 120,
"indent": 4,
"browser": true,
"laxbreak": true,
"globals": {
"console": true,
"it": true,
"xit": true,
"expect": true,
"describe": true,
"beforeEach": true,
"afterEach": true,
"sinon": true,
"fakeServer": true,
"_": true,
"OC": true,
"OCA": true,
"t": true,
"n": true
}
}
46 changes: 22 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ php:
- 7.0
- 7.1

cache:
directories:
- $HOME/.cache/bower
- $HOME/.composer/cache
- $HOME/.npm
- /tmp/phantomjs
- tools

env:
global:
- CORE_BRANCH=master
Expand All @@ -27,38 +35,28 @@ before_install:

script:
- cd apps/$APP_NAME/

# Run integration tests
- sh -c "if [ '$INTEGRATION' = '1' ]; then cd tests/integration; ./run.sh; fi"

# Test the app
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '1' -a '$INTEGRATION' != '1' ]; then make test-codecheck; fi"
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '1' -a '$INTEGRATION' != '1' ]; then make test-codecheck; fi"
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' -a '$INTEGRATION' != '1' ]; then make test-codecheck-deprecations; fi"

# Run phpunit tests
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' -a '$INTEGRATION' != '1' ]; then make test-php; fi"

# Create and upload coverage report
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' -a '$INTEGRATION' != '1' ]; then make test-upload-coverage; fi"

# Run Javascript unit tests
- make test-js
- make $TEST

matrix:
include:
# PHP unit tests + code coverage
- php: 5.6
env: DB=mysql
env: DB=mysql;TEST=test-upload-coverage
# PHP unit tests
- php: 5.6
env: DB=pgsql
env: DB=pgsql;TEST=test-php
# Code checker / syntax
- php: 5.6
env: DB=mysql;CODECHECK=1
env: DB=mysql;TEST=test-codecheck
# Code checker (deprecations only, allowed to fail)
- php: 5.6
env: DB=mysql;CODECHECK=2
env: DB=mysql;TEST=test-codecheck-deprecations
# Javascript tests
- php: 5.6
env: DB=mysql;JSTESTS=1
env: DB=mysql;TEST=test-js
# Integration tests
- php: 7.0
env: DB=mysql;INTEGRATION=1
env: DB=mysql;TEST=test-integration
allow_failures:
- env: DB=mysql;CODECHECK=2
- env: DB=mysql;TEST=test-codecheck-deprecations
fast_finish: true
87 changes: 34 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,54 @@

OWNCLOUD_PATH=$(CURDIR)/../..
OCC=$(OWNCLOUD_PATH)/occ
PHPUNIT=$(OWNCLOUD_PATH)/lib/composer/phpunit/phpunit/phpunit

app_name=customgroups
project_dir=$(CURDIR)/../$(app_name)
app_namespace=CustomGroups

build_dir=$(CURDIR)/build

# these can be extended by included files
# to add for example generated files
doc_files=README.md
src_files=
src_dirs=appinfo lib
src_dirs=appinfo lib l10n js css templates
all_src=$(src_files) $(src_dirs) $(doc_files)
market_dir=$(build_dir)/market

.PHONY: all
all: market

.PHONE: market
market: dist
cd $(build_dir); tar cvzf $(app_name).tar.gz $(app_name)
rm -Rf $(market_dir); mkdir -p $(market_dir)
mv $(build_dir)/$(app_name).tar.gz $(market_dir)

$(build_dir)/$(app_name):
rm -Rf $@; mkdir -p $@
cp -R $(all_src) $@

.PHONY: dist
dist: $(build_dir)/$(app_name)
# rules to be extended by included files
test_rules=
clean_rules=
js_rules=
help_rules=help-base

.PHONY: distclean
distclean: clean
tools_path=$(shell pwd)/tools

.PHONY: clean
clean: clean-test
rm -rf $(build_dir)

.PHONY: clean-test
clean-test:
rm tests/unit/clover.xml
rm tests/unit/*.phar

.PHONY: test-syntax
test-syntax:
for F in $(shell find . -name \*.php); do \
php -l "$$F" || exit $?; \
done
.PHONY: all
# build tarball
all: help-hint $(build_dir)/$(app_name).tar.gz

.PHONY: test-codecheck
test-codecheck: test-syntax
$(OCC) app:check-code $(app_name) -c private -c strong-comparison
include rules/deps.mk
include rules/dist.mk
include rules/tests.mk
include rules/frontend.mk

.PHONY: test-codecheck-deprecations
test-codecheck-deprecations:
$(OCC) app:check-code $(app_name) -c deprecation
.PHONY: help-base
help-base:
@echo "Please use 'make <target>' where <target> is one of"
@echo

.PHONY: test-php
test-php: test-syntax
$(OCC) app:enable $(app_name)
cd tests/unit && $(PHPUNIT) --configuration phpunit.xml
.PHONY: help-hint
help-hint:
@echo "Building $(app_name) app"
@echo
@echo "Note: You can type 'make help' for more targets"
@echo

.PHONY: test-upload-coverage
test-upload-coverage:
cd tests/unit && wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover clover.xml
.PHONY: help
help: $(help_rules)

.PHONY: test-js
test-js:
@echo No JS unit tests currently
#cd tests/js && npm install --deps; node_modules/karma/bin/karma start karma.config.js --single-run;
.PHONY: clean
clean: $(clean_rules)

.PHONY: test
test: test-codecheck test-codecheck-deprecations test-php test-js
test: $(test_rules)

17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ It is then possible to share files or folders with these groups.
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/owncloud/customgroups/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/owncloud/customgroups/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/owncloud/customgroups/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/owncloud/customgroups/?branch=master)

## QA metrics on stable8 branch:
## Requirements

[![Build Status](https://travis-ci.org/owncloud/customgroups.svg?branch=stable8)](https://travis-ci.org/owncloud/customgroups/branches)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/owncloud/customgroups/badges/quality-score.png?b=stable8)](https://scrutinizer-ci.com/g/owncloud/customgroups/?branch=stable8)
[![Code Coverage](https://scrutinizer-ci.com/g/owncloud/customgroups/badges/coverage.png?b=stable8)](https://scrutinizer-ci.com/g/owncloud/customgroups/?branch=stable8)
* ownCloud 10.0

## Requirements
## Building the app

* ownCloud 10
* Make sure you have [Node JS](https://nodejs.org/) installed
* Run `make` and find the tarball in the "build" directory

## Install

* Install and enable the App
* Extract the resulting tarball in the "apps" folder in ownCloud

## Usage

Expand All @@ -30,6 +29,10 @@ It is then possible to share files or folders with these groups.
* Create custom group and add other users as members
* Share file/folder with said groups

## Developing

* Run `make help` to get information about the different targets.

## Authors:

[Vincent Petry](https://github.com/PVince81/) :: PVince81 at owncloud dot com
Expand Down
5 changes: 4 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<info>
<id>customgroups</id>
<name>User-defined custom groups</name>
<name>Custom groups</name>
<namespace>CustomGroups</namespace>
<description>Let users create and manage custom groups for sharing.</description>
<website>https://github.com/owncloud/customgroups/</website>
Expand All @@ -26,4 +26,7 @@
<collection>OCA\CustomGroups\Dav\RootCollection</collection>
</collections>
</sabre>
<settings>
<personal>OCA\CustomGroups\SettingsPanel</personal>
</settings>
</info>
27 changes: 27 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* @author Vincent Petry <[email protected]>
*
* @copyright Copyright (c) 2016, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
],
'resources' => []
];
11 changes: 11 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "owncloud-customgroups",
"version": "0.1",
"homepage": "https://github.com/owncloud/customgroups/",
"license": "AGPL",
"private": true,
"ignore": [],
"dependencies": {
"handlebars": "4.0.5"
}
}
14 changes: 14 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"config" : {
"vendor-dir": "lib/composer",
"optimize-autoloader": true,
"classmap-authoritative": false
},
"require-dev": {
"phpunit/phpunit": "^5.5",
"scrutinizer/ocular": "^1.3.1"
},
"require": {
"php": ">=5.6"
}
}
Loading