-
Notifications
You must be signed in to change notification settings - Fork 4
Updates for checklists items and Comments #8
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
Open
MusahMusah
wants to merge
13
commits into
laravel-enso:master
Choose a base branch
from
MusahMusah:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
16d954b
feat: add changes made to files, routes and migrations
MusahMusah 589925b
whip: add .gitignore
MusahMusah 28de41f
feat: add table columns for tasks Statuses.php upgrade
MusahMusah a09f02b
feat: add Upgrades for (From, Muted and To) columns
MusahMusah b4ed32c
feat: add completed column for existing db
MusahMusah 0c45173
chore: removed unwanted fields from Statuses.php
MusahMusah 3d6bb12
chore: updated observer in AppServiceProvider.php
MusahMusah 00a4fb5
chore: refactor and updated files
MusahMusah 260ae1b
chore: refactor and updated files
MusahMusah fcbdef0
fix: fix issues flagged by ci/cd pipeline
MusahMusah 831b7b3
fix: fix issues flagged by ci/cd pipeline
MusahMusah f338a38
remove idea files
MusahMusah 13417f9
fix: added fix for code align
MusahMusah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
database/migrations/2022_07_01_103245_create_task_checklist_items.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
public function up() | ||
{ | ||
Schema::create('task_checklist_items', function (Blueprint $table) { | ||
$table->id(); | ||
$table->foreignId('task_id')->constrained('tasks'); | ||
|
||
$table->string('name'); | ||
$table->unsignedInteger('order_index')->nullable(); | ||
$table->boolean('is_completed'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::dropIfExists('task_checklist_items'); | ||
} | ||
}; |
14 changes: 14 additions & 0 deletions
14
database/migrations/2022_07_01_103248_create_structure_for_task_checklist_items.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
use LaravelEnso\Migrator\Database\Migration; | ||
|
||
return new class extends Migration { | ||
protected array $permissions = [ | ||
['name' => 'tasks.checklistItems.store', 'description' => 'Store a new check list', 'is_default' => false], | ||
['name' => 'tasks.checklistItems.update', 'description' => 'Update check list', 'is_default' => false], | ||
['name' => 'tasks.checklistItems.destroy', 'description' => 'Delete check list', 'is_default' => false], | ||
]; | ||
|
||
protected ?string $parentMenu = ''; | ||
}; | ||
|
29 changes: 29 additions & 0 deletions
29
database/migrations/2022_07_20_104852_create_task_comments_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
public function up() | ||
{ | ||
Schema::create('task_comments', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->foreignId('task_id')->constrained(); | ||
$table->text('body'); | ||
|
||
$table->integer('created_by')->unsigned()->nullable()->index(); | ||
$table->foreign('created_by')->references('id')->on('users'); | ||
|
||
$table->integer('updated_by')->unsigned()->nullable(); | ||
$table->foreign('updated_by')->references('id')->on('users'); | ||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::dropIfExists('task_comments'); | ||
} | ||
}; |
12 changes: 12 additions & 0 deletions
12
database/migrations/2022_07_20_160001_create_structure_for_task_comments.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
use LaravelEnso\Migrator\Database\Migration; | ||
|
||
return new class extends Migration { | ||
protected array $permissions = [ | ||
['name' => 'tasks.comments.index', 'description' => 'Show index for comments', 'is_default' => false], | ||
['name' => 'tasks.comments.store', 'description' => 'Store a new comment', 'is_default' => false], | ||
['name' => 'tasks.comments.update', 'description' => 'Update comment', 'is_default' => false], | ||
['name' => 'tasks.comments.destroy', 'description' => 'Delete comment', 'is_default' => false], | ||
]; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use LaravelEnso\Tasks\Http\Controllers\Tasks\ChecklistItems\Destroy; | ||
use LaravelEnso\Tasks\Http\Controllers\Tasks\ChecklistItems\Store; | ||
use LaravelEnso\Tasks\Http\Controllers\Tasks\ChecklistItems\Update; | ||
|
||
Route::prefix('checklistItems') | ||
->as('checklistItems.') | ||
->group(function () { | ||
Route::post('', Store::class)->name('store'); | ||
Route::patch('{checklistItem}', Update::class)->name('update'); | ||
Route::delete('{checklistItem}', Destroy::class)->name('destroy'); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use App\Http\Controllers\Tasks\Comments\Destroy; | ||
use App\Http\Controllers\Tasks\Comments\Index; | ||
use App\Http\Controllers\Tasks\Comments\Store; | ||
use App\Http\Controllers\Tasks\Comments\Update; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::prefix('comments') | ||
->as('comments.') | ||
->group(function () { | ||
Route::get('', Index::class)->name('index'); | ||
Route::post('', Store::class)->name('store'); | ||
Route::patch('{comment}', Update::class)->name('update'); | ||
Route::delete('{comment}', Destroy::class)->name('destroy'); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace LaravelEnso\Tasks\Enums; | ||
|
||
use LaravelEnso\Enums\Services\Enum; | ||
|
||
class Statuses extends Enum | ||
{ | ||
public const New = 1; | ||
public const InProgress = 2; | ||
public const Finished = 3; | ||
|
||
protected static array $data = [ | ||
self::New => 'New', | ||
self::InProgress => 'In Progress', | ||
self::Finished => 'Finished', | ||
]; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace LaravelEnso\Tasks\Http\Controllers\Tasks\ChecklistItems; | ||
|
||
use Illuminate\Routing\Controller; | ||
use LaravelEnso\Tasks\Models\ChecklistItem; | ||
|
||
class Destroy extends Controller | ||
{ | ||
public function __invoke(ChecklistItem $checklistItem) | ||
{ | ||
$checklistItem->delete(); | ||
|
||
return [ | ||
'message' => __('The item was successfully deleted'), | ||
]; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace LaravelEnso\Tasks\Http\Controllers\Tasks\ChecklistItems; | ||
|
||
use Illuminate\Routing\Controller; | ||
use LaravelEnso\Tasks\Http\Requests\ValidateChecklistItem; | ||
use LaravelEnso\Tasks\Models\ChecklistItem; | ||
|
||
class Store extends Controller | ||
{ | ||
public function __invoke(ValidateChecklistItem $request, ChecklistItem $checklistItem) | ||
{ | ||
$checklistItem->fill($request->validated() + ['is_completed' => false])->save(); | ||
|
||
return [ | ||
'message' => __('The item was successfully created'), | ||
'param' => ['checklist' => $checklistItem->id], | ||
'data' => $checklistItem, | ||
]; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace LaravelEnso\Tasks\Http\Controllers\Tasks\ChecklistItems; | ||
|
||
use Illuminate\Routing\Controller; | ||
use LaravelEnso\Tasks\Http\Requests\ValidateChecklistItem; | ||
use LaravelEnso\Tasks\Models\ChecklistItem; | ||
|
||
class Update extends Controller | ||
{ | ||
public function __invoke(ValidateChecklistItem $request, ChecklistItem $checklistItem) | ||
{ | ||
$checklistItem->update($request->validated()); | ||
|
||
return ['message' => __('The item was successfully updated')]; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.