Skip to content

Commit

Permalink
Vue 3 (#166)
Browse files Browse the repository at this point in the history
* working on vue3 release

* eScienceCenter => DH-Center

* add tlc toggle; rework delete logic

* update dependencies

Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
  • Loading branch information
v1r0x authored Sep 26, 2022
1 parent 2269146 commit e08a78a
Show file tree
Hide file tree
Showing 134 changed files with 48,128 additions and 13,695 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you have questions about how to install or use ThesauRex, please send us an [

Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.

[template]: https://raw.githubusercontent.com/eScienceCenter/ThesauRex/master/issue_template.md
[template]: https://raw.githubusercontent.com/DH-Center-Tuebingen/ThesauRex/master/issue_template.md

Use your real name (sorry, no pseudonyms or anonymous contributions).
If you set your `user.name` and `user.email` git configs, you can sign your
Expand Down
14 changes: 7 additions & 7 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You should also check for changes in [Proxy Setup](INSTALL.md#proxy-setup) and [
2. Clone This Repository

```bash
git clone https://github.com/eScienceCenter/ThesauRex
git clone https://github.com/DH-Center-Tuebingen/ThesauRex
```

3. Download Dependencies
Expand Down Expand Up @@ -166,7 +166,7 @@ If you have just migrated into an empty database, you need to run the following
php artisan db:seed
```

When you want to run ThesauRex as standalone software without [Spacialist](https://github.com/eScienceCenter/Spacialist) you have to run the `StandaloneSeeder`.
When you want to run ThesauRex as standalone software without [Spacialist](https://github.com/DH-Center-Tuebingen/Spacialist) you have to run the `StandaloneSeeder`.
```bash
php artisan db:seed --class=StandaloneSeeder
```
Expand All @@ -177,14 +177,14 @@ Example:
Laravel (5.5.33)
```

## Installing ThesauRex as part of [Spacialist](https://github.com/eScienceCenter/Spacialist)
## Installing ThesauRex as part of [Spacialist](https://github.com/DH-Center-Tuebingen/Spacialist)

As ThesauRex is a crutial part of the [Spacialist](https://github.com/eScienceCenter/Spacialist) platform, it can be installed directly within the Spacialist environment as well. This part only contains changes that must be made when installing ThesauRex as part of Spacialist against a standalone installation.
As ThesauRex is a crutial part of the [Spacialist](https://github.com/DH-Center-Tuebingen/Spacialist) platform, it can be installed directly within the Spacialist environment as well. This part only contains changes that must be made when installing ThesauRex as part of Spacialist against a standalone installation.

2. `cd` into your Spacialist Repository and clone the ThesauRex Repository into it

```bash
git clone https://github.com/eScienceCenter/ThesauRex thesaurex
git clone https://github.com/DH-Center-Tuebingen/ThesauRex thesaurex
```

### Proxy Setup
Expand All @@ -198,7 +198,7 @@ As ThesauRex is a crutial part of the [Spacialist](https://github.com/eScienceCe
127.0.0.1 project.thesaurex # or anything you want
```

3. Append an additional configuration to the `spacialist-laravel.conf` file of your apache that you created while installing Spacialist (see [Spacialist/INSTALL.md](https://github.com/eScienceCenter/Spacialist/blob/master/INSTALL.md)). The `DocumentRoot` and `<Directory ... >` must point to the location of your `public` folder and might be adjusted if needed.
3. Append an additional configuration to the `spacialist-laravel.conf` file of your apache that you created while installing Spacialist (see [Spacialist/INSTALL.md](https://github.com/DH-Center-Tuebingen/Spacialist/blob/master/INSTALL.md)). The `DocumentRoot` and `<Directory ... >` must point to the location of your `public` folder and might be adjusted if needed.

```bash
sudo nano /etc/apache2/sites-available/spacialist-laravel.conf
Expand Down Expand Up @@ -243,7 +243,7 @@ As ThesauRex is a crutial part of the [Spacialist](https://github.com/eScienceCe

### Configure Laravel

As you have configured your `.env` file with your DB connection during the installation of Spacialist (see [Spacialist/INSTALL.md](https://github.com/eScienceCenter/Spacialist/blob/master/INSTALL.md)) its sufficient to just set a soft link to the `.env` file of Spacialist
As you have configured your `.env` file with your DB connection during the installation of Spacialist (see [Spacialist/INSTALL.md](https://github.com/DH-Center-Tuebingen/Spacialist/blob/master/INSTALL.md)) its sufficient to just set a soft link to the `.env` file of Spacialist

```bash
ln -s /var/www/html/spacialist/.env /var/www/html/spacialist/thesaurex/.env
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 eScience-Center
Copyright (c) 2016 DH-Center-Tuebingen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>
<a href='https://david-dm.org/eScienceCenter/ThesauRex'>
<img src='https://david-dm.org/eScienceCenter/ThesauRex.svg' alt='Dependency Status' />
<a href='https://david-dm.org/DH-Center-Tuebingen/ThesauRex'>
<img src='https://david-dm.org/DH-Center-Tuebingen/ThesauRex.svg' alt='Dependency Status' />
</a>
<a href='https://opensource.org/licenses/MIT'>
<img src='https://img.shields.io/badge/License-MIT-yellow.svg' alt='License: MIT' />
Expand Down
10 changes: 5 additions & 5 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Exceptions;

use Exception;
use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
Expand All @@ -29,10 +29,10 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
Expand All @@ -41,10 +41,10 @@ public function report(Exception $exception)
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
Expand Down
11 changes: 5 additions & 6 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Illuminate\Http\Request;
use App\Preference;
use App\ThConcept;
use App\User;
use Illuminate\Support\Facades\App;

class HomeController extends Controller
{
Expand All @@ -27,18 +29,15 @@ public function getGlobalData() {
$preferenceValues[$k] = $p->value;
}
} else {
$preferences = Preference::all();
$preferenceValues = [];
foreach($preferences as $p) {
$preferenceValues[$p->label] = Preference::decodePreference($p->label, json_decode($p->default_value));
}
}

$concepts = ThConcept::getMap();
$sysPrefs = Preference::getPreferences();

return response()->json([
'standalone' => !th_is_part_of_spacialist(),
'system_preferences' => $sysPrefs,
'preferences' => $preferenceValues,
'concepts' => $concepts
]);
}

Expand Down
42 changes: 3 additions & 39 deletions app/Http/Controllers/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct() {
// GET
public function getLanguages() {
$user = \Auth::user();
if(!$user->can('view_concepts_th')) {
if(!$user->can('thesaurus_read')) {
return response([
'error' => 'You do not have the permission to call this method'
], 403);
Expand All @@ -29,7 +29,7 @@ public function getLanguages() {
// POST
public function addLanguage(Request $request) {
$user = \Auth::user();
if(!$user->can('edit_concepts_th')) {
if(!$user->can('thesaurus_create')) {
return response([
'error' => 'You do not have the permission to call this method'
], 403);
Expand All @@ -50,50 +50,14 @@ public function addLanguage(Request $request) {
}

// PATCH
public function patchLanguage(Request $request, $id) {
$user = \Auth::user();
if(!$user->can('edit_concepts_th')) {
return response([
'error' => 'You do not have the permission to call this method'
], 403);
}

$this->validate($request, [
'display_name' => 'string',
'short_name' => 'string|size:2'
]);

if(!$this->hasInput($request)) {
return response()->json(null, 204);
}

try {
$language = ThLanguage::findOrFail($id);
} catch(ModelNotFoundException $e) {
return response()->json([
'error' => 'This language does not exist'
], 400);
}

if($request->has('display_name')) {
$language->display_name = $request->get('display_name');
}
if($request->has('short_name')) {
$language->short_name = $request->get('short_name');
}
$language->user_id = $user->id;
$language->save();

return response()->json($language);
}

// PUT

// DELETE
public function deleteLanguage(Request $request, $id) {
$user = \Auth::user();

if(!$user->can('edit_concepts_th')) {
if(!$user->can('thesaurus_delete')) {
return response([
'error' => 'You do not have the permission to call this method'
], 403);
Expand Down
Loading

0 comments on commit e08a78a

Please sign in to comment.