Include warning for #722

This commit is contained in:
James Cole
2017-07-29 08:27:39 +02:00
parent f4994ef151
commit db3b822aef
8 changed files with 78 additions and 1 deletions

View File

@@ -43,4 +43,11 @@ interface ConfigurationInterface
*/
public function storeConfiguration(array $data): bool;
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string;
}

View File

@@ -135,4 +135,14 @@ class Initial implements ConfigurationInterface
return $config;
}
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string
{
return '';
}
}

View File

@@ -268,4 +268,14 @@ class Map implements ConfigurationInterface
return $column;
}
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string
{
return '';
}
}

View File

@@ -29,6 +29,9 @@ class Roles implements ConfigurationInterface
/** @var ImportJob */
private $job;
/** @var string */
private $warning = '';
/**
* Get the data necessary to show the configuration screen.
*
@@ -68,6 +71,16 @@ class Roles implements ConfigurationInterface
return $this->data;
}
/**
* Return possible warning to user.
*
* @return string
*/
public function getWarningMessage(): string
{
return $this->warning;
}
/**
* @param ImportJob $job
*
@@ -246,6 +259,10 @@ class Roles implements ConfigurationInterface
$config['column-roles-complete'] = true;
$this->job->configuration = $config;
$this->job->save();
$this->warning = '';
}
if ($assigned === 0 || !$hasAmount) {
$this->warning = trans('csv.roles_warning');
}
return true;