Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/Classes/RcnApi/Entities/InstructionTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class InstructionTranslation implements \JsonSerializable, Arrayable
'warning',
'anticipated',
'assess_and_plan',
'mitigate_risks',
'mitigate_risk',
'prepare_to_respond',
'recover'
];
Expand Down Expand Up @@ -47,11 +47,11 @@ class InstructionTranslation implements \JsonSerializable, Arrayable
public static function createFromRequest(array $array)
{
$translation = new self();
$translation->lang = $array['lang'];
$translation->webUrl = $array['webUrl'];
$translation->title = $array['title'];
$translation->description = $array['description'];
$translation->stages = new Collection($array['stages']);
$translation->lang = $array['lang'];
$translation->webUrl = $array['webUrl'];
$translation->title = $array['title'];
$translation->description = $array['description'];
$translation->stages = new Collection($array['stages']);
return $translation;
}

Expand All @@ -60,12 +60,12 @@ public static function createFromResponse(array $array)
{
$translation = new self();

$translation->id = $array['id'];
$translation->lang = $array['lang'];
$translation->webUrl = $array['webUrl'];
$translation->title = $array['title'];
$translation->description = $array['description'];
$translation->stages = new Collection($array['stages']);
$translation->id = $array['id'];
$translation->lang = $array['lang'];
$translation->webUrl = $array['webUrl'];
$translation->title = $array['title'];
$translation->description = $array['description'];
$translation->stages = new Collection($array['stages']);
$translation->createdAt = new \DateTimeImmutable($array['createdAt']);
$translation->published = $array['published'];
return $translation;
Expand Down
20 changes: 13 additions & 7 deletions app/Classes/RcnApi/Importer/BulkUploadTemplateExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,31 @@ class BulkUploadTemplateExport implements FromArray, ShouldAutoSize, WithEvents
private $nationalSociety;
private $region;
private $headings = [
'Title', 'Description', 'URL', 'Hazard', 'Urgency Level', 'Safety Message'
'Title',
'Description',
'URL',
'Hazard',
'Urgency Level',
'Safety Message'
];
private $urgencyLevels = '"Immediate,Warning,Anticipated,Assess and Plan,Mitigate Risks,Prepare to Respond,Recover"';
private $urgencyLevels = '"Immediate,Warning,Anticipated,Assess and Plan,Mitigate Risk,Prepare to Respond,Recover"';

private $eventTypesDropdown = [];

private $data;

public function __construct(string $nationalSociety, string $region,array $data, int $maxSupportingMessages)
public function __construct(string $nationalSociety, string $region, array $data, int $maxSupportingMessages)
{
$eventTypes = EventType::whereNotIn('code', ['other'])->get()->toArray();
$this->nationalSociety = $nationalSociety;
$this->eventTypesDropdown = '"' . implode(',', array_map(function ($event) {
return "{$event['name']}";
}, $eventTypes)) . '"';
return "{$event['name']}";
}, $eventTypes)) . '"';
$this->subnational = $region;
$this->data = $data;
if($maxSupportingMessages <= 0) $maxSupportingMessages = 3;
for($i = 0; $i< $maxSupportingMessages; $i++){
if ($maxSupportingMessages <= 0)
$maxSupportingMessages = 3;
for ($i = 0; $i < $maxSupportingMessages; $i++) {
$this->headings[] = 'Supporting Message ' . ($i + 1);
}

Expand Down
7 changes: 5 additions & 2 deletions resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ Vue.use(VueMoment)

Vue.use(TscGTAG)

Vue.use(GoogleAuth, { client_id: window.config.google.client_id, scopes: 'profile email openid' })
Vue.googleAuth().load()
const googleClientId = window.config?.google?.client_id
if (googleClientId) {
Vue.use(GoogleAuth, { client_id: googleClientId, scopes: 'profile email openid' })
Vue.googleAuth().load()
}

Vue.config.productionTip = false

Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/pages/content/editWhatnow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export default {
'warning',
'anticipated',
'assess_and_plan',
'mitigate_risks',
'mitigate_risk',
'prepare_to_respond',
'recover'
],
Expand All @@ -358,7 +358,7 @@ export default {
{
value: 'disaster_risk_reduction',
text: this.$t('content.edit_whatnow.disaster_risk_reduction'),
stages: ['assess_and_plan', 'mitigate_risks', 'prepare_to_respond'],
stages: ['assess_and_plan', 'mitigate_risk', 'prepare_to_respond'],
description: this.$t('content.edit_whatnow.disaster_risk_reduction_description')
},
{
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/pages/content/whatnowContentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default {
{
value: 'disaster_risk_reduction',
text: this.$t('content.edit_whatnow.disaster_risk_reduction'),
stages: ['assess_and_plan', 'mitigate_risks', 'prepare_to_respond'],
stages: ['assess_and_plan', 'mitigate_risk', 'prepare_to_respond'],
description: this.$t('content.edit_whatnow.disaster_risk_reduction_description')
},
{
Expand Down Expand Up @@ -271,7 +271,7 @@ export default {
.btn {
font-size: 14px;
}
}
}
}

.hazard-cards-container {
Expand Down
6 changes: 3 additions & 3 deletions resources/assets/js/pages/content/whatnowSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
'warning',
'anticipated',
'assess_and_plan',
'mitigate_risks',
'mitigate_risk',
'prepare_to_respond',
'recover'
],
Expand All @@ -50,7 +50,7 @@ export default {
{
value: 'disaster_risk_reduction',
text: this.$t('content.edit_whatnow.disaster_risk_reduction'),
stages: ['assess_and_plan', 'mitigate_risks', 'prepare_to_respond'],
stages: ['assess_and_plan', 'mitigate_risk', 'prepare_to_respond'],
description: this.$t('content.edit_whatnow.disaster_risk_reduction_description')
},
{
Expand Down Expand Up @@ -123,4 +123,4 @@ export default {
color: $grey;
}
}
</style>
</style>
Loading