Skip to content

Commit

Permalink
FIX Export registered methods in enabled members report
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 15, 2022
1 parent 450d7d0 commit d72adf3
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/Exception/AuthenticationFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class AuthenticationFailedException extends Exception
{

}
1 change: 0 additions & 1 deletion src/Exception/EncryptionAdapterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
*/
class EncryptionAdapterException extends Exception
{

}
1 change: 0 additions & 1 deletion src/Exception/InvalidMethodException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class InvalidMethodException extends LogicException
{

}
1 change: 0 additions & 1 deletion src/Exception/MemberNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
*/
class MemberNotFoundException extends Exception
{

}
1 change: 0 additions & 1 deletion src/Exception/RegistrationFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class RegistrationFailedException extends LogicException
{

}
20 changes: 20 additions & 0 deletions src/Extension/MemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,26 @@ public function setDefaultRegisteredMethod(RegisteredMethod $registeredMethod):
return $this->owner;
}

/**
* @return string
*/
public function getDefaultRegisteredMethodName(): string
{
$method = $this->getDefaultRegisteredMethod();
return $method ? $method->getMethod()->getName() : '';
}

/**
* @return string
*/
public function getRegisteredMethodNames(): string
{
$arr = array_map(function ($method) {
return $method->getMethod()->getName();
}, $this->owner->RegisteredMFAMethods()->toArray());
return implode(', ', $arr);
}

public function updateCMSFields(FieldList $fields): FieldList
{
$fields->removeByName(['DefaultRegisteredMethodID', 'HasSkippedMFARegistration', 'RegisteredMFAMethods']);
Expand Down
10 changes: 4 additions & 6 deletions src/Report/EnabledMembers.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ public function sourceRecords($params): DataList
public function columns(): array
{
$columns = singleton(Member::class)->summaryFields() + [
'registeredMethods' => [
'title' => _t(__CLASS__ . '.COLUMN_METHODS_REGISTERED', 'Registered methods'),
'formatting' => [$this, 'formatMethodsColumn']
'RegisteredMethodNames' => [
'title' => _t(__CLASS__ . '.COLUMN_METHODS_REGISTERED', 'Registered methods')
],
'defaultMethodName' => [
'title' => _t(__CLASS__ . '.COLUMN_METHOD_DEFAULT', 'Default method'),
'formatting' => [$this, 'formatDefaultMethodColumn']
'DefaultRegisteredMethodName' => [
'title' => _t(__CLASS__ . '.COLUMN_METHOD_DEFAULT', 'Default method')
],
'HasSkippedMFARegistration' => [
'title' => _t(__CLASS__ . '.COLUMN_SKIPPED_REGISTRATION', 'Skipped registration'),
Expand Down
1 change: 0 additions & 1 deletion src/State/AvailableMethodDetailsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
*/
interface AvailableMethodDetailsInterface extends JsonSerializable
{

}
1 change: 0 additions & 1 deletion src/State/RegisteredMethodDetailsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
*/
interface RegisteredMethodDetailsInterface extends JsonSerializable
{

}
1 change: 0 additions & 1 deletion tests/php/Stub/DuplicatedBasicMath/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
*/
class Method extends BasicMathMethod
{

}
1 change: 0 additions & 1 deletion tests/php/Stub/Null/RegisterHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class RegisterHandler implements RegisterHandlerInterface, TestOnly
{

/**
* Stores any data required to handle a registration process with a method, and returns relevant state to be applied
* to the front-end application managing the process.
Expand Down

0 comments on commit d72adf3

Please sign in to comment.