Skip to content

Commit

Permalink
Merge pull request #1174 from AgID/develop
Browse files Browse the repository at this point in the history
Consolidation in master
  • Loading branch information
pdavide authored Oct 30, 2021
2 parents a983e28 + ba0ecd3 commit 4714a02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 8 additions & 6 deletions app/Http/Controllers/WidgetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\PublicAdministration;
use App\Models\Website;
use App\Traits\HasRoleAwareUrls;
use Illuminate\Http\RedirectResponse;
use Illuminate\View\View;
use Symfony\Component\Yaml\Yaml;

Expand All @@ -28,22 +29,23 @@ public function __construct()
* @param Website $website The website
* @param PublicAdministration $publicAdministration The PublicAdministration
*
* @return View The view
* @return View|RedirectResponse The view or a redirect response
*/
public function index(Website $website, PublicAdministration $publicAdministration): View
public function index(Website $website, PublicAdministration $publicAdministration)
{
$publicAdministration = auth()->user()->can(UserPermission::ACCESS_ADMIN_AREA)
? $publicAdministration
: current_public_administration();

if ($website->status->is(WebsiteStatus::PENDING)) {
$redirectUrl = $this->getRoleAwareUrl('websites.show', ['website' => $website], $publicAdministration);
$name = $website->name;

return redirect()->to($redirectUrl)->withNotification([
'title' => __('Errore'),
'message' => __("Attiva il sito '$name' prima di accedere all'anteprima dei widget."),
'status' => 'error',
'title' => __('sito non attivo'),
'message' => __("Attiva il sito <b>:site</b> prima di accedere all'anteprima dei widget.", [
'site' => $website->name,
]),
'status' => 'warning',
'icon' => 'it-close-circle',
]);
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "italia/wai-portal",
"description": "Web Analytics Italia",
"version": "2.1.3-beta",
"version": "2.1.4-beta",
"keywords": ["analytics", "italia"],
"license": "AGPL-3.0-or-later",
"type": "project",
Expand Down
6 changes: 4 additions & 2 deletions resources/views/pages/widgets-preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
]) !!}
@endif
<br><br>
{!! __("È possibile modificare i parametri in URL secondo le proprie esigenze,
{{ __("I dati visualizzati si riferiscono al mese precedente.") }}
<br><br>
{{ __("È possibile modificare i parametri in URL secondo le proprie esigenze,
tuttavia si consiglia di mantentere l'impostazione predefinita per garantire
la disponibilità dei dati.") !!}
la disponibilità dei dati.") }}
</div>
</div>
</div>
Expand Down

0 comments on commit 4714a02

Please sign in to comment.