-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from itk-dev/feature/380-views
Feature: Add View entity and CRUD
- Loading branch information
Showing
69 changed files
with
1,421 additions
and
181 deletions.
There are no files selected for viewing
This file contains 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 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 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
export default class extends Controller { | ||
|
||
static targets = ['select']; | ||
connect() { | ||
this.defaultViewEndpoint = this.element.dataset.defaultViewUpdateEndpoint; | ||
} | ||
select(event) { | ||
const newDefaultView = event.target.options[event.target.selectedIndex].value; | ||
const pathArray = window.location.pathname.split('/'); | ||
const params = window.location.search; | ||
|
||
let i = 1; | ||
if ('admin' === pathArray[1]) { | ||
let newPath = ""; | ||
for (i = 1; i < pathArray.length; i++) { | ||
newPath += "/"; | ||
if (i === 2) { | ||
newPath += newDefaultView; | ||
} | ||
else { | ||
newPath += pathArray[i]; | ||
} | ||
} | ||
|
||
window.location.replace(newPath + params); | ||
} | ||
} | ||
} |
This file contains 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 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 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,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20240118074743 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
// this up() migration is auto-generated, please modify it to your needs | ||
$this->addSql('CREATE TABLE view (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('CREATE TABLE view_data_provider (view_id INT NOT NULL, data_provider_id INT NOT NULL, INDEX IDX_4AE832DD31518C7 (view_id), INDEX IDX_4AE832DDF593F7E0 (data_provider_id), PRIMARY KEY(view_id, data_provider_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('CREATE TABLE view_project (view_id INT NOT NULL, project_id INT NOT NULL, INDEX IDX_6EEC51431518C7 (view_id), INDEX IDX_6EEC514166D1F9C (project_id), PRIMARY KEY(view_id, project_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('ALTER TABLE view_data_provider ADD CONSTRAINT FK_4AE832DD31518C7 FOREIGN KEY (view_id) REFERENCES view (id) ON DELETE CASCADE'); | ||
$this->addSql('ALTER TABLE view_data_provider ADD CONSTRAINT FK_4AE832DDF593F7E0 FOREIGN KEY (data_provider_id) REFERENCES data_provider (id) ON DELETE CASCADE'); | ||
$this->addSql('ALTER TABLE view_project ADD CONSTRAINT FK_6EEC51431518C7 FOREIGN KEY (view_id) REFERENCES view (id) ON DELETE CASCADE'); | ||
$this->addSql('ALTER TABLE view_project ADD CONSTRAINT FK_6EEC514166D1F9C FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE view_data_provider DROP FOREIGN KEY FK_4AE832DD31518C7'); | ||
$this->addSql('ALTER TABLE view_data_provider DROP FOREIGN KEY FK_4AE832DDF593F7E0'); | ||
$this->addSql('ALTER TABLE view_project DROP FOREIGN KEY FK_6EEC51431518C7'); | ||
$this->addSql('ALTER TABLE view_project DROP FOREIGN KEY FK_6EEC514166D1F9C'); | ||
$this->addSql('DROP TABLE view'); | ||
$this->addSql('DROP TABLE view_data_provider'); | ||
$this->addSql('DROP TABLE view_project'); | ||
} | ||
} |
This file contains 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 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 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 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 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 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
Oops, something went wrong.