Rename notestutorial to upschooling

This commit is contained in:
Ben 2021-08-21 16:25:23 +02:00
parent f4bf5cb042
commit 3e17e44ab7
Signed by: ben
GPG Key ID: 0F54A7ED232D3319
27 changed files with 49494 additions and 371 deletions

View File

@ -8,7 +8,7 @@ on:
- stable*
env:
APP_NAME: notestutorial
APP_NAME: upschooling
jobs:
php:

View File

@ -2,7 +2,7 @@
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>upschooling</id>
<name>U Pschooling</name>
<name>UPschooling</name>
<summary>UPschooling Support Platform</summary>
<description><![CDATA[Ticketsystem für UPschooling]]></description>
<version>0.0.1</version>
@ -16,7 +16,7 @@
</dependencies>
<navigations>
<navigation>
<name>U Pschooling</name>
<name>Support</name>
<route>upschooling.page.index</route>
</navigation>
</navigations>

500
composer.lock generated

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,175 +0,0 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
/*!
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@pm.me>
*
* @author Marco Ambrosini <marcoambrosini@pm.me>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

File diff suppressed because one or more lines are too long

49051
js/upschooling-main.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
<?php
namespace OCA\NotesTutorial\AppInfo;
namespace OCA\UPschooling\AppInfo;
use OCP\AppFramework\App;
class Application extends App {
public const APP_ID = 'notestutorial';
public const APP_ID = 'upschooling';
public function __construct() {
parent::__construct(self::APP_ID);

View File

@ -1,13 +1,13 @@
<?php
namespace OCA\NotesTutorial\Controller;
namespace OCA\UPschooling\Controller;
use Closure;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCA\NotesTutorial\Service\NoteNotFound;
use OCA\UPschooling\Service\NoteNotFound;
trait Errors {
protected function handleNotFound(Closure $callback): DataResponse {

View File

@ -1,9 +1,9 @@
<?php
namespace OCA\NotesTutorial\Controller;
namespace OCA\UPschooling\Controller;
use OCA\NotesTutorial\AppInfo\Application;
use OCA\NotesTutorial\Service\NoteService;
use OCA\UPschooling\AppInfo\Application;
use OCA\UPschooling\Service\NoteService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;

View File

@ -1,9 +1,9 @@
<?php
namespace OCA\NotesTutorial\Controller;
namespace OCA\UPschooling\Controller;
use OCA\NotesTutorial\AppInfo\Application;
use OCA\NotesTutorial\Service\NoteService;
use OCA\UPschooling\AppInfo\Application;
use OCA\UPschooling\Service\NoteService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;

View File

@ -1,8 +1,8 @@
<?php
namespace OCA\NotesTutorial\Controller;
namespace OCA\UPschooling\Controller;
use OCA\NotesTutorial\AppInfo\Application;
use OCA\UPschooling\AppInfo\Application;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
@ -20,7 +20,7 @@ class PageController extends Controller {
* Render default template
*/
public function index() {
Util::addScript(Application::APP_ID, 'notestutorial-main');
Util::addScript(Application::APP_ID, 'upschooling-main');
return new TemplateResponse(Application::APP_ID, 'main');
}

View File

@ -1,6 +1,6 @@
<?php
namespace OCA\NotesTutorial\Db;
namespace OCA\UPschooling\Db;
use JsonSerializable;

View File

@ -1,6 +1,6 @@
<?php
namespace OCA\NotesTutorial\Db;
namespace OCA\UPschooling\Db;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\Entity;
@ -10,7 +10,7 @@ use OCP\IDBConnection;
class NoteMapper extends QBMapper {
public function __construct(IDBConnection $db) {
parent::__construct($db, 'notestutorial', Note::class);
parent::__construct($db, 'upschooling', Note::class);
}
/**
@ -24,7 +24,7 @@ class NoteMapper extends QBMapper {
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$qb->select('*')
->from('notestutorial')
->from('upschooling')
->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)))
->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
return $this->findEntity($qb);
@ -38,7 +38,7 @@ class NoteMapper extends QBMapper {
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$qb->select('*')
->from('notestutorial')
->from('upschooling')
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
return $this->findEntities($qb);
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace OCA\NotesTutorial\Migration;
namespace OCA\UPschooling\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
@ -21,8 +21,8 @@ class Version000000Date20181013124731 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('notestutorial')) {
$table = $schema->createTable('notestutorial');
if (!$schema->hasTable('upschooling')) {
$table = $schema->createTable('upschooling');
$table->addColumn('id', 'integer', [
'autoincrement' => true,
'notnull' => true,
@ -41,7 +41,7 @@ class Version000000Date20181013124731 extends SimpleMigrationStep {
]);
$table->setPrimaryKey(['id']);
$table->addIndex(['user_id'], 'notestutorial_user_id_index');
$table->addIndex(['user_id'], 'upschooling_user_id_index');
}
return $schema;
}

View File

@ -1,6 +1,6 @@
<?php
namespace OCA\NotesTutorial\Service;
namespace OCA\UPschooling\Service;
class NoteNotFound extends \Exception {
}

View File

@ -1,14 +1,14 @@
<?php
namespace OCA\NotesTutorial\Service;
namespace OCA\UPschooling\Service;
use Exception;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCA\NotesTutorial\Db\Note;
use OCA\NotesTutorial\Db\NoteMapper;
use OCA\UPschooling\Db\Note;
use OCA\UPschooling\Db\NoteMapper;
class NoteService {

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "notestutorial",
"name": "upschooling",
"version": "19.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "notestutorial",
"name": "upschooling",
"version": "19.0.0",
"license": "agpl",
"dependencies": {

View File

@ -1,5 +1,5 @@
{
"name": "notestutorial",
"name": "upschooling",
"description": "A simple Nextcloud app tutorial for building a notes app",
"version": "19.0.0",
"author": "Julius Härtl <jus@bitgrid.net",

View File

@ -8,7 +8,7 @@ DIR="${0%/*}"
podman run -d --name=nextcloud --replace=true -p 8080:80 -v "$DIR:/var/www/html/custom_apps/upschooling" docker.io/nextcloud
podman exec nextcloud chown -R 33 /var/www/html/custom_apps
"$DIR/podman-reown.sh"
podman exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make'
podman exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make composer'
podman exec --user 33 nextcloud php occ maintenance:install --database sqlite --admin-user admin --admin-pass admin
podman exec --user 33 nextcloud php occ config:system:set --value=true --type=boolean debug
podman exec --user 33 nextcloud php occ app:enable --force upschooling

View File

@ -1,28 +1,28 @@
<template>
<div id="content" class="app-notestutorial">
<div id="content" class="app-upschooling">
<AppNavigation>
<AppNavigationNew v-if="!loading"
:text="t('notestutorial', 'New note')"
:text="t('upschooling', 'New note')"
:disabled="false"
button-id="new-notestutorial-button"
button-id="new-upschooling-button"
button-class="icon-add"
@click="newNote" />
<ul>
<AppNavigationItem v-for="note in notes"
:key="note.id"
:title="note.title ? note.title : t('notestutorial', 'New note')"
:title="note.title ? note.title : t('upschooling', 'New note')"
:class="{active: currentNoteId === note.id}"
@click="openNote(note)">
<template slot="actions">
<ActionButton v-if="note.id === -1"
icon="icon-close"
@click="cancelNewNote(note)">
{{ t('notestutorial', 'Cancel note creation') }}
{{ t('upschooling', 'Cancel note creation') }}
</ActionButton>
<ActionButton v-else
icon="icon-delete"
@click="deleteNote(note)">
{{ t('notestutorial', 'Delete note') }}
{{ t('upschooling', 'Delete note') }}
</ActionButton>
</template>
</AppNavigationItem>
@ -37,13 +37,13 @@
<textarea ref="content" v-model="currentNote.content" :disabled="updating" />
<input type="button"
class="primary"
:value="t('notestutorial', 'Save')"
:value="t('upschooling', 'Save')"
:disabled="updating || !savePossible"
@click="saveNote">
</div>
<div v-else id="emptycontent">
<div class="icon-file" />
<h2>{{ t('notestutorial', 'Create a note to get started') }}</h2>
<h2>{{ t('upschooling', 'Create a note to get started') }}</h2>
</div>
</AppContent>
</div>
@ -103,11 +103,11 @@ export default {
*/
async mounted() {
try {
const response = await axios.get(generateUrl('/apps/notestutorial/notes'))
const response = await axios.get(generateUrl('/apps/upschooling/notes'))
this.notes = response.data
} catch (e) {
console.error(e)
showError(t('notestutorial', 'Could not fetch notes'))
showError(t('upschooling', 'Could not fetch notes'))
}
this.loading = false
},
@ -169,13 +169,13 @@ export default {
async createNote(note) {
this.updating = true
try {
const response = await axios.post(generateUrl('/apps/notestutorial/notes'), note)
const response = await axios.post(generateUrl('/apps/upschooling/notes'), note)
const index = this.notes.findIndex((match) => match.id === this.currentNoteId)
this.$set(this.notes, index, response.data)
this.currentNoteId = response.data.id
} catch (e) {
console.error(e)
showError(t('notestutorial', 'Could not create the note'))
showError(t('upschooling', 'Could not create the note'))
}
this.updating = false
},
@ -186,10 +186,10 @@ export default {
async updateNote(note) {
this.updating = true
try {
await axios.put(generateUrl(`/apps/notestutorial/notes/${note.id}`), note)
await axios.put(generateUrl(`/apps/upschooling/notes/${note.id}`), note)
} catch (e) {
console.error(e)
showError(t('notestutorial', 'Could not update the note'))
showError(t('upschooling', 'Could not update the note'))
}
this.updating = false
},
@ -199,15 +199,15 @@ export default {
*/
async deleteNote(note) {
try {
await axios.delete(generateUrl(`/apps/notestutorial/notes/${note.id}`))
await axios.delete(generateUrl(`/apps/upschooling/notes/${note.id}`))
this.notes.splice(this.notes.indexOf(note), 1)
if (this.currentNoteId === note.id) {
this.currentNoteId = null
}
showSuccess(t('notestutorial', 'Note deleted'))
showSuccess(t('upschooling', 'Note deleted'))
} catch (e) {
console.error(e)
showError(t('notestutorial', 'Could not delete the note'))
showError(t('upschooling', 'Could not delete the note'))
}
},
},

View File

@ -1,15 +1,15 @@
<?php
namespace OCA\NotesTutorial\Tests\Integration\Controller;
namespace OCA\UPschooling\Tests\Integration\Controller;
use OCP\AppFramework\App;
use OCP\IRequest;
use PHPUnit\Framework\TestCase;
use OCA\NotesTutorial\Db\Note;
use OCA\NotesTutorial\Db\NoteMapper;
use OCA\NotesTutorial\Controller\NoteController;
use OCA\UPschooling\Db\Note;
use OCA\UPschooling\Db\NoteMapper;
use OCA\UPschooling\Controller\NoteController;
class NoteIntegrationTest extends TestCase {
private $controller;
@ -17,7 +17,7 @@ class NoteIntegrationTest extends TestCase {
private $userId = 'john';
public function setUp(): void {
$app = new App('notestutorial');
$app = new App('upschooling');
$container = $app->getContainer();
// only replace the user id

View File

@ -1,8 +1,8 @@
<?php
namespace OCA\NotesTutorial\Tests\Unit\Controller;
namespace OCA\UPschooling\Tests\Unit\Controller;
use OCA\NotesTutorial\Controller\NoteApiController;
use OCA\UPschooling\Controller\NoteApiController;
class NoteApiControllerTest extends NoteControllerTest {
public function setUp(): void {

View File

@ -1,15 +1,15 @@
<?php
namespace OCA\NotesTutorial\Tests\Unit\Controller;
namespace OCA\UPschooling\Tests\Unit\Controller;
use PHPUnit\Framework\TestCase;
use OCP\AppFramework\Http;
use OCP\IRequest;
use OCA\NotesTutorial\Service\NoteNotFound;
use OCA\NotesTutorial\Service\NoteService;
use OCA\NotesTutorial\Controller\NoteController;
use OCA\UPschooling\Service\NoteNotFound;
use OCA\UPschooling\Service\NoteService;
use OCA\UPschooling\Controller\NoteController;
class NoteControllerTest extends TestCase {
protected $controller;

View File

@ -1,6 +1,6 @@
<?php
namespace OCA\NotesTutorial\Controller;
namespace OCA\UPschooling\Controller;
use PHPUnit\Framework\TestCase;

View File

@ -1,15 +1,15 @@
<?php
namespace OCA\NotesTutorial\Tests\Unit\Service;
namespace OCA\UPschooling\Tests\Unit\Service;
use OCA\NotesTutorial\Service\NoteNotFound;
use OCA\UPschooling\Service\NoteNotFound;
use PHPUnit\Framework\TestCase;
use OCP\AppFramework\Db\DoesNotExistException;
use OCA\NotesTutorial\Db\Note;
use OCA\NotesTutorial\Service\NoteService;
use OCA\NotesTutorial\Db\NoteMapper;
use OCA\UPschooling\Db\Note;
use OCA\UPschooling\Service\NoteService;
use OCA\UPschooling\Db\NoteMapper;
class NoteServiceTest extends TestCase {
private $service;