Skip to content
Merged

Dev #43

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
230e4c3
Refatorando JQuery em EditorFunctions, OntologyManager, Compiler
larissafazza Sep 9, 2021
fd4e354
corrige atualização do namespace
larissafazza Sep 13, 2021
5994af8
corrigir EditorFunctions.js
larissafazza Sep 13, 2021
ec92470
conserta ontologymanager.js
larissafazza Sep 13, 2021
4e3d154
Implementado teste unitario do Auth e iniciado das ontologias
ViniciusCorbelli Sep 15, 2021
9dd38cd
conserta erro de inglês na página de configurações
larissafazza Sep 15, 2021
14bd7b9
Correções das views do thesaurus
ViniciusCorbelli Sep 16, 2021
fe235fb
Remove botão de inserir link
Piazzi Sep 20, 2021
33dd89a
Merge branch 'larissa' into lucas
Piazzi Sep 20, 2021
e189fd2
Remove erro de auto relação (domain e range iguais de uma relação)
Piazzi Sep 20, 2021
c2e0f87
Corrige tamanho da sidebar de propriedades
Piazzi Sep 20, 2021
eb5e651
Remove arquivos de JS não utilizados
Piazzi Sep 20, 2021
a426251
Corrige download do report da ontologia
Piazzi Sep 20, 2021
bb447e9
Remove funções de JS não utilizadas
Piazzi Sep 20, 2021
93b1f48
Versão 7 do laravel
ViniciusCorbelli Sep 20, 2021
00af291
Atualizando o laravel para versão 8
ViniciusCorbelli Sep 21, 2021
af15b7e
Atualização finalizada
ViniciusCorbelli Sep 21, 2021
4741c70
Remove warningId da função sendWarningMessage
Piazzi Sep 21, 2021
551c2c3
Atualizando o adminlte
ViniciusCorbelli Sep 22, 2021
f89c9a2
Atualização dos arquivos
ViniciusCorbelli Sep 22, 2021
4844b9d
Atualização das main_views do adminlte
ViniciusCorbelli Sep 22, 2021
bf700aa
Finalizado o update do adminlte
ViniciusCorbelli Sep 22, 2021
3f296f2
Correções nos testes unitarios
ViniciusCorbelli Sep 23, 2021
68b0af0
Merge branch 'vinicius' of https://github.com/Piazzi/OntoForALL into …
larissafazza Sep 27, 2021
76db373
Altera as cores do editor
larissafazza Sep 29, 2021
bc88f6b
conserta background-color do botão de salvar ontologia no editor
larissafazza Sep 29, 2021
ab11e87
Refazer a página de visualização de ontologia e Adicionar o atributo …
ViniciusCorbelli Sep 29, 2021
a0ef21e
Adiciona coloração em elementos com erro
Piazzi Sep 30, 2021
9e23180
Merge branch 'larissa' into lucas
Piazzi Sep 30, 2021
875ad3e
Atualiza laravel para v.8.6.3
Piazzi Sep 30, 2021
3eed1f3
Atualiza Imagens da tutorial blade
larissafazza Sep 30, 2021
9836742
Merge branch 'dev' into larissa
larissafazza Sep 30, 2021
e2252f1
Mostrando informações da ontologia na tela
ViniciusCorbelli Oct 2, 2021
5e9099e
Conserta erro no log out
larissafazza Oct 3, 2021
c453555
Merge pull request #39 from Piazzi/vinicius
Piazzi Oct 4, 2021
77a7270
Merge branch 'dev' into lucas
Piazzi Oct 4, 2021
17b4731
Merge pull request #40 from Piazzi/lucas
Piazzi Oct 4, 2021
7ca8d15
corrige uso da navbar
larissafazza Oct 5, 2021
5131b22
Apaga input name do modal de editar ontologia
larissafazza Oct 5, 2021
438d8e1
Merge pull request #42 from Piazzi/larissa
Piazzi Oct 5, 2021
c189001
Adiciona IRI nos elementos
Piazzi Oct 5, 2021
abcddb0
Remove opção de esconder menus da sidebar esquerda
Piazzi Oct 5, 2021
353c1a6
Conserta input ontology-name na navbar
larissafazza Oct 6, 2021
80ad4e9
começa a desenvolver o backend da funcionalidade de favoritar a ontol…
larissafazza Oct 6, 2021
ca23a85
Merge branch 'larissa' into lucas
Piazzi Oct 6, 2021
9a1fcdf
Adiciona input e botão de favoritos na navbar
Piazzi Oct 6, 2021
591db51
Atualiza texto last update após salvamento
Piazzi Oct 7, 2021
9563f08
Move botão de salvar para navbar
Piazzi Oct 7, 2021
66b5095
Remoev EditorFunctions.js
Piazzi Oct 7, 2021
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
10 changes: 5 additions & 5 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Exceptions;

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

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)
{
// Redirect to '/' if the session expired
if ($exception instanceof AuthenticationException) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\User;
use App\Models\User;
use Illuminate\Http\Request;

class AdminController extends Controller
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Laravel\Socialite\Facades\Socialite;
use App\User;
use App\Models\User;

class LoginController extends Controller
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers\Auth;

use App\User;
use App\Models\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
Expand Down Expand Up @@ -59,7 +59,7 @@ protected function validator(array $data)
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
* @return \App\Models\User
*/
protected function create(array $data)
{
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace App\Http\Controllers;

use App\Mail\ContactMail;
use App\Ontology;
use App\User;
use App\Models\Ontology;
use App\Models\User;
use DOMDocument;
use function foo\func;
use Illuminate\Http\Request;
use App\OntologyRelation;
use App\OntologyClass;
use App\Models\OntologyRelation;
use App\Models\OntologyClass;
use Illuminate\Http\Response;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Auth;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/OntologyClassController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\OntologyClass;
use App\Models\OntologyClass;
use App\Http\Requests\OntologyClassStoreRequest;

class OntologyClassController extends Controller
Expand Down
52 changes: 37 additions & 15 deletions app/Http/Controllers/OntologyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Controllers;

use App\User;
use App\Models\User;
use Illuminate\Http\Request;
use App\Ontology;
use App\Models\Ontology;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests\OntologyStoreRequest;
Expand Down Expand Up @@ -121,11 +121,11 @@ public function update(OntologyStoreRequest $request, $locale, $id)
$ontology = Ontology::where('id', $id)->first();
if ($ontology->userCanEdit()) {
$ontology->update($request->all());
foreach($request->collaborators as $user){
if($user != $ontology->user_id){
if($this->verifyUser($user, $ontology) == false){
foreach ($request->collaborators as $user) {
if ($user != $ontology->user_id) {
if ($this->verifyUser($user, $ontology) == false) {
$user = User::find($user);
$notification = ['title'=> __('New Ontology shared with you'), 'message'=> __('The user ') . $ontology->user->name . __(' shared with you the ontology ') . $ontology->name, 'from'=>$ontology->user->name, 'type'=> 'New Ontology Shared'];
$notification = ['title' => __('New Ontology shared with you'), 'message' => __('The user ') . $ontology->user->name . __(' shared with you the ontology ') . $ontology->name, 'from' => $ontology->user->name, 'type' => 'New Ontology Shared'];
Mail::send(new \App\Mail\SharedOntologyMail($user, $ontology));
$user->notify(new UserNotification($notification));
}
Expand Down Expand Up @@ -193,6 +193,23 @@ public function saveAsFavourite(Request $request)
return redirect()->route('ontologies.index', app()->getLocale())->with('Sucess', 'Your ontology has been added to favorites');
}

/**
* @param Request $request
* @return \Illuminate\Http\JsonResponse
*/
public function favouriteOntologyIndex(Request $request)
{
$ontology = Ontology::find($request->id);
if($ontology->favourite)
$ontology->favourite = 0;
else
$ontology->favourite = 1;
$ontology->save();
return response()->json([
"favourite" => $ontology->favourite
]);
}

/**
* Unmark the favourite column from a ontology
* @param Request $request
Expand Down Expand Up @@ -246,7 +263,7 @@ public function downloadOWL(Request $request)
public function updateOrCreate(Request $request)
{
$ontology = Ontology::where('id', $request->id)->exists();
if ($ontology) {
if ($ontology) {
$ontology = Ontology::find($request->id);
if ($ontology->userCanEdit()) {
$ontology->update([
Expand Down Expand Up @@ -311,11 +328,11 @@ public function updateOrCreate(Request $request)
]
);*/

foreach($request->collaborators as $user){
if($user != $ontology->user_id){
if($this->verifyUser($user, $ontology) == false){
foreach ($request->collaborators as $user) {
if ($user != $ontology->user_id) {
if ($this->verifyUser($user, $ontology) == false) {
$user = User::find($user);
$notification = ['title'=> __('New Ontology shared with you'), 'message'=> __('The user ') . $ontology->user->name . __(' shared with you the ontology ') . $ontology->name, 'from'=>$ontology->user->name, 'type'=> 'New Ontology Shared'];
$notification = ['title' => __('New Ontology shared with you'), 'message' => __('The user ') . $ontology->user->name . __(' shared with you the ontology ') . $ontology->name, 'from' => $ontology->user->name, 'type' => 'New Ontology Shared'];
Mail::send(new \App\Mail\SharedOntologyMail($user, $ontology));
$user->notify(new UserNotification($notification));
}
Expand All @@ -329,14 +346,16 @@ public function updateOrCreate(Request $request)
"message-pt" => 'Todas as alterações foram salvas',
"message-en" => 'All changes saved',
"id" => $ontology->id,
'updated_at' => date("d-m-Y | H:i", strtotime($ontology['updated_at']))
]);
}

//helper function to verify if the collaborator is already a user on the ontology
//returns if the collaborator already is a user of the ontology
public function verifyUser($collaborator, $ontology){
foreach($ontology->users as $user){
if($collaborator == $user->id){
public function verifyUser($collaborator, $ontology)
{
foreach ($ontology->users as $user) {
if ($collaborator == $user->id) {
return true;
}
}
Expand Down Expand Up @@ -365,6 +384,7 @@ public function openOntologyInTheEditor(Request $request)
{
$ontology = Ontology::where('id', $request->id)->first();
$ownerName = $ontology->user->name;
$lastUpdate = date("d-m-Y | H:i", strtotime($ontology->updated_at));
if (Auth::user()->id == $ontology['user_id'] || $ontology->users->contains($request->user()->id)) {
$response = array(
'status' => 'success',
Expand All @@ -385,8 +405,10 @@ public function openOntologyInTheEditor(Request $request)
'degree_of_formality' => $ontology['degree_of_formality'],
'scope' => $ontology['scope'],
'competence_questions' => $ontology['competence_questions'],
'namespace' => $ontology['namespace'],
'collaborators' => $ontology->users->modelKeys(),
'owner_name' => $ownerName
'owner_name' => $ownerName,
'last_update' => $lastUpdate,
);
return response()->json($response);
//return $ontology;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/OntologyRelationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\OntologyRelation;
use App\Models\OntologyRelation;
use App\Http\Requests\OntologyRelationStoreRequest;


Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ThesauruController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Thesauru;
use App\Models\Thesauru;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Response;
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace App\Http\Controllers;

use App\Http\Requests\UserUpdateRequest;
use App\Ontology;
use App\Models\Ontology;
use Illuminate\Http\Request;
use App\User;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/UserNotificationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;
use App\Models\User;
use App\Notifications\UserNotification;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
Expand Down
4 changes: 2 additions & 2 deletions app/Mail/SharedOntologyMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Mail;

use App\User;
use App\Ontology;
use App\Models\User;
use App\Models\Ontology;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
Expand Down
7 changes: 5 additions & 2 deletions app/Ontology.php → app/Models/Ontology.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?php

namespace App;
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;


class Ontology extends Model
{

use HasFactory;
/**
* @var array
*/
Expand Down Expand Up @@ -127,6 +130,6 @@ public function user()
*/
public function users()
{
return $this->belongsToMany('App\User');
return $this->belongsToMany(User::class);
}
}
5 changes: 4 additions & 1 deletion app/OntologyClass.php → app/Models/OntologyClass.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php

namespace App;
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class OntologyClass extends Model
{
use HasFactory;

protected $fillable = [
'name',
'subclass',
Expand Down
5 changes: 4 additions & 1 deletion app/OntologyRelation.php → app/Models/OntologyRelation.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php

namespace App;
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class OntologyRelation extends Model
{
use HasFactory;

protected $fillable = [
'name',
'domain',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php

namespace App;
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SocialFacebookAccount extends Model
{
use HasFactory;

protected $fillable = ['user_id', 'provider_user_id', 'provider'];

/**
Expand Down
6 changes: 5 additions & 1 deletion app/Thesauru.php → app/Models/Thesauru.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?php

namespace App;
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Thesauru extends Model
{

use HasFactory;

/**
* @var array
*/
Expand Down
6 changes: 4 additions & 2 deletions app/User.php → app/Models/User.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<?php

namespace App;
namespace App\Models;

use App\Notifications\ResetPassword;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Auth\Reminders\RemindableInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Contracts\Auth\CanResetPassword;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class User extends Authenticatable
{
use Notifiable;
use HasFactory;

public function sendPasswordResetNotification($token)
{
Expand Down Expand Up @@ -67,7 +69,7 @@ public function ontologies()
*/
public function ontologies()
{
return $this->belongsToMany('App\Ontology');
return $this->belongsToMany(Ontology::class);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Notifications/UserNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Notifications;

use App\User;
use App\Ontology;
use App\Models\User;
use App\Models\Ontology;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
Expand Down
Loading