-
Notifications
You must be signed in to change notification settings - Fork 0
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
318 - Read-only feed data #25
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
31cb3c5
EV-318: Fixed ADR 006 filename and missing extension
cableman 79c5153
EV-318: Added new ADR about editing data
cableman a47fd64
EV-318: Fixed ADR 006 format
cableman 39e1d6a
EV-318: Added editable to entities
cableman 07a1c76
EV-318: Disabled edit on read-only entities
cableman 5081578
EV-318: Updated fixtures with images
cableman fc7bebb
EV-318: Updated baseline with new fixture "errors"
cableman 8ea56f9
EV-318: Moved editable code into shared classes
cableman 6cc27e1
EV-318: Changed configureActions to use instanceof
cableman 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 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 was deleted.
Oops, something went wrong.
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,27 @@ | ||
# User handling and login | ||
|
||
Date: 28-09-2023 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
The idea is that each organization/institution has an appointed admin that is allowed to send users invitation out for | ||
his/her organization. Each user can be part of more than one organization, it just requires that they get an invitation | ||
and thereby link their account to a given organization. | ||
|
||
## Decision | ||
|
||
For this first phase of the project, users login by using username and password. If there needs to be a higher level of | ||
security surrounding user login in the future, an identity Provider such as MitId can be connected to the project, but | ||
for now the customer has specifically requested (due to experiences with login in the existing solution) that we | ||
continue using username and password. | ||
|
||
Using Single Sign On (SSO) would be a more professional login method for the future, but for now it's not a part of the | ||
project. | ||
|
||
## Consequences | ||
|
||
Login using username and password is not as secure as using SSO. |
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,24 @@ | ||
# Editability of content | ||
|
||
Date: 27-11-2023 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
The forms UI (administrative user interface) allows users to add new content and change existing data. | ||
|
||
## Decision | ||
|
||
All data imported through feeds are marked as read-only as changes made in the administrative UI are overwritten by | ||
changes in the feed. | ||
|
||
All other data is editable and will trigger a reindex of the data changes and all related data. | ||
|
||
## Consequences | ||
|
||
Imported data from feeds are not editable, and some changes to data not from feeds will trigger a reindex of data, | ||
which may trigger a lager job to be processed based on which data is changed. E.g. if an address is changed, that will | ||
trigger an update of all content in indexes that contains that address. Which may be a large number of events. |
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,41 @@ | ||
<?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 Version20231127121531 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('ALTER TABLE address ADD editable TINYINT(1) NOT NULL'); | ||
$this->addSql('ALTER TABLE event ADD editable TINYINT(1) NOT NULL'); | ||
$this->addSql('ALTER TABLE image ADD editable TINYINT(1) NOT NULL'); | ||
$this->addSql('ALTER TABLE location ADD editable TINYINT(1) NOT NULL'); | ||
$this->addSql('ALTER TABLE occurrence ADD editable TINYINT(1) NOT NULL'); | ||
$this->addSql('ALTER TABLE tag ADD editable TINYINT(1) NOT NULL'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE occurrence DROP editable'); | ||
$this->addSql('ALTER TABLE location DROP editable'); | ||
$this->addSql('ALTER TABLE event DROP editable'); | ||
$this->addSql('ALTER TABLE tag DROP editable'); | ||
$this->addSql('ALTER TABLE address DROP editable'); | ||
$this->addSql('ALTER TABLE image DROP editable'); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
namespace App\Controller\Admin; | ||
|
||
use App\Entity\EditableEntityInterface; | ||
use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | ||
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | ||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | ||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; | ||
|
||
abstract class AbstractBaseCrudController extends AbstractCrudController | ||
{ | ||
public static function getEntityFqcn(): string | ||
{ | ||
return self::class; | ||
} | ||
|
||
public function configureActions(Actions $actions): Actions | ||
{ | ||
return parent::configureActions($actions) | ||
->update(Crud::PAGE_INDEX, Action::EDIT, static function (Action $action) { | ||
return $action->displayIf(static function (object $entity) { | ||
$interfaces = class_implements($entity); | ||
|
||
return !isset($interfaces[EditableEntityInterface::class]) || $entity->isEditable(); | ||
}); | ||
}) | ||
->add(Crud::PAGE_INDEX, Action::DETAIL); | ||
} | ||
} |
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I like to take the long road ... and the PHP docs says:
Not implements interface... but I see if you scroll down and down and down in the documentation... they use it on an interface as example... way down