Skip to content

Commit

Permalink
Merge branch 'release/4.1.31'
Browse files Browse the repository at this point in the history
* release/4.1.31:
  updated the changelog
  compile assets
  refactored the MediaController to a single action
  refactored the i18n objects into single translation endpoints
  • Loading branch information
austintoddj committed Apr 28, 2019
2 parents eeb317c + 3f8cce2 commit 7ba7431
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 264 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## [v4.1.31](https://github.com/cnvs/canvas/compare/v4.1.30...v4.1.31)

### Changed
- Refactored the MediaController into a single action for simplicity ([2201769](https://github.com/cnvs/canvas/commit/22017691233fabfcea16cb473ca64e1573dd751c))
- Refactored the `i18n` objects into single translation endpoints throughout the components for better maintainability ([0af8873](https://github.com/cnvs/canvas/commit/0af8873a90e26cf97ca9aec11c67f8851a11b36e))

## [v4.1.30](https://github.com/cnvs/canvas/compare/v4.1.29...v4.1.30)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/js/app.js": "/js/app.js?id=e7d01bf545b09bb6ea7f",
"/js/app.js": "/js/app.js?id=150ccc8aae2774c4a8cd",
"/css/app.css": "/css/app.css?id=f67fa09e4165d6153c77",
"/css/app-dark.css": "/css/app-dark.css?id=96b402438f4da22bea87",
"/js/app.js.map": "/js/app.js.map?id=77dfa9301d3e746dc180",
"/js/app.js.map": "/js/app.js.map?id=1c48b64658f005873a46",
"/favicon.ico": "/favicon.ico?id=dbb0c05daa3432643753"
}
7 changes: 3 additions & 4 deletions resources/js/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
return {
editor: null,
editorBody: this.value,
placeholder: i18n.posts.forms.editor.body,
link: i18n.posts.forms.editor.link,
trans: i18n
}
},
Expand Down Expand Up @@ -66,7 +65,7 @@
},
theme: 'bubble',
scrollingContainer: 'html, body',
placeholder: this.placeholder
placeholder: this.trans.posts.forms.editor.body
});
/**
Expand All @@ -76,7 +75,7 @@
*/
let tooltip = quill.theme.tooltip;
let input = tooltip.root.querySelector("input[data-link]");
input.dataset.link = this.link;
input.dataset.link = this.trans.posts.forms.editor.link;
return quill;
},
Expand Down
33 changes: 11 additions & 22 deletions resources/js/components/ImagePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,7 @@
unsplashPage: 1,
searchingUnsplash: true,
unsplashImages: [],
greeting: i18n.posts.forms.editor.images.picker.greeting,
action: i18n.posts.forms.editor.images.picker.action,
item: i18n.posts.forms.editor.images.picker.item,
operator: i18n.posts.forms.editor.images.picker.operator,
source: i18n.posts.forms.editor.images.picker.unsplash,
key: i18n.posts.forms.editor.images.picker.key,
placeholder: i18n.posts.forms.editor.images.picker.placeholder,
empty: i18n.posts.forms.editor.images.picker.search.empty,
next: i18n.buttons.general.next,
cancel: i18n.buttons.general.cancel,
captionBy: i18n.posts.forms.editor.images.picker.caption.by,
captionOn: i18n.posts.forms.editor.images.picker.caption.on,
trans: i18n
}
},
Expand All @@ -43,7 +32,7 @@
// Get images from Unsplash
getImagesFromUnsplash(page = 1) {
if (!this.unsplash) {
return this.alertError(this.key);
return this.alertError(this.trans.posts.forms.editor.images.picker.key);
}
this.unsplashPage = page;
this.searchingUnsplash = true;
Expand Down Expand Up @@ -84,7 +73,7 @@
this.$emit('changed', {
url: this.selectedUnsplashImage.urls.regular,
caption: this.captionBy + ' <a href="' + this.selectedUnsplashImage.user.links.html + '" target="_blank">' + this.selectedUnsplashImage.user.name + '</a> ' + this.captionOn + ' <a href="https://unsplash.com" target="_blank">Unsplash</a>',
caption: this.trans.posts.forms.editor.images.picker.caption.by + ' <a href="' + this.selectedUnsplashImage.user.links.html + '" target="_blank">' + this.selectedUnsplashImage.user.name + '</a> ' + this.trans.posts.forms.editor.images.picker.caption.on + ' <a href="https://unsplash.com" target="_blank">Unsplash</a>',
});
this.closeUnsplashModal();
Expand Down Expand Up @@ -134,14 +123,14 @@
accept="image/*"
v-on:change="uploadSelectedImage">
<div class="mb-0">
{{ this.greeting }} <label :for="'imageUpload'+_uid" class="text-primary" style="cursor:pointer;">{{
this.action }}</label> {{ this.item }}
<span v-if="this.unsplash">{{ this.operator }}</span>
{{ this.trans.posts.forms.editor.images.picker.greeting }} <label :for="'imageUpload'+_uid" class="text-primary" style="cursor:pointer;">{{
this.trans.posts.forms.editor.images.picker.action }}</label> {{ this.trans.posts.forms.editor.images.picker.item }}
<span v-if="this.unsplash">{{ this.trans.posts.forms.editor.images.picker.operator }}</span>
<a v-if="this.unsplash"
href="#"
@click.prevent="openUnsplashModal"
class="text-primary">
{{ this.source }}
{{ this.trans.posts.forms.editor.images.picker.unsplash }}
</a>
</div>

Expand All @@ -152,7 +141,7 @@
v-if="this.unsplash"
v-model="unsplashSearchTerm"
ref="unsplashSearch"
:placeholder="this.placeholder">
:placeholder="this.trans.posts.forms.editor.images.picker.placeholder">

<div v-if="!searchingUnsplash && unsplashImages.length">
<div class="card-columns">
Expand All @@ -170,20 +159,20 @@
type="button"
@click="closeUnsplashModal"
v-on:submit.prevent="onSubmit">
{{ this.cancel }}
{{ this.trans.buttons.general.cancel }}
</button>
<button class="btn btn-sm btn-outline-primary"
type="button"
@click="getImagesFromUnsplash(unsplashPage + 1)"
v-if="unsplashImages.length == 12"
v-on:submit.prevent="onSubmit">
{{ this.next }}
{{ this.trans.buttons.general.next }}
</button>
</div>
</div>

<div v-if="!searchingUnsplash && !unsplashImages.length">
<h4 class="text-center py-4">{{ this.empty }}</h4>
<h4 class="text-center py-4">{{ this.trans.posts.forms.editor.images.picker.search.empty }}</h4>
</div>
</div>
</div>
Expand Down
9 changes: 4 additions & 5 deletions resources/js/components/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
points: [{
values: Object.values(this.views)
}],
title: i18n.stats.cards.views.title,
tooltip: i18n.stats.chart.view,
labels: Object.keys(this.views)
labels: Object.keys(this.views),
trans: i18n
}
},
Expand All @@ -37,7 +36,7 @@
<vue-frappe
id="stats"
:labels="this.labels"
:title="this.title"
:title="this.trans.stats.cards.views.title"
type="line"
:axisOptions="{
xIsSeries: true,
Expand All @@ -51,7 +50,7 @@
:dataSets="this.points"
:tooltipOptions="{
formatTooltipX: d => moment(d, 'YYYY-MM-DD').format('dddd, MMMM Do'),
formatTooltipY: d => d + pluralize(this.tooltip, d),
formatTooltipY: d => d + pluralize(this.trans.stats.chart.view, d),
}">
</vue-frappe>
</div>
Expand Down
7 changes: 3 additions & 4 deletions resources/js/components/TagSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
return {
value: this.tagged ? this.tagged : [],
options: allTags,
tag: i18n.tags.forms.tag,
select: i18n.tags.forms.select,
trans: i18n
}
},
Expand Down Expand Up @@ -56,8 +55,8 @@
<div>
<multiselect
v-model="value"
:placeholder="this.select"
:tag-placeholder="this.tag"
:placeholder="this.trans.tags.forms.select"
:tag-placeholder="this.trans.tags.forms.tag"
label="name"
track-by="slug"
:options="options"
Expand Down
7 changes: 3 additions & 4 deletions resources/js/components/TopicSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
return {
value: this.assigned ? this.assigned : [],
options: allTopics,
topic: i18n.topics.forms.tag,
select: i18n.topics.forms.select,
trans: i18n
}
},
Expand Down Expand Up @@ -66,8 +65,8 @@
<div>
<multiselect
v-model="value"
:placeholder="this.select"
:tag-placeholder="this.topic"
:placeholder="this.trans.topics.forms.select"
:tag-placeholder="this.trans.topics.forms.tag"
label="name"
track-by="slug"
:options="options"
Expand Down
13 changes: 7 additions & 6 deletions resources/js/components/editorComponents/HTMLEmbedder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
return {
content: '',
modalShown: false,
done: i18n.buttons.general.done,
label: i18n.posts.forms.editor.html.label,
placeholder: i18n.posts.forms.editor.html.placeholder,
trans: i18n
}
},
Expand Down Expand Up @@ -40,16 +38,19 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<p class="font-weight-bold lead">{{ this.label }}</p>
<p class="font-weight-bold lead">{{ this.trans.posts.forms.editor.html.label }}</p>
<div class="form-group row">
<div class="col-lg-12 mx-0 px-0">
<textarea ref="content" cols="30" rows="10" class="form-control border-0"
:placeholder="this.placeholder" style="resize: none" v-model="content"></textarea>
:placeholder="this.trans.posts.forms.editor.html.placeholder" style="resize: none"
v-model="content"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-link text-muted" data-dismiss="modal" @click="addHTML">{{ this.done }}</button>
<button class="btn btn-link text-muted" data-dismiss="modal" @click="addHTML">
{{ this.trans.buttons.general.done }}
</button>
</div>
</div>
</div>
Expand Down
16 changes: 6 additions & 10 deletions resources/js/components/editorComponents/ImageUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
imageUrl: null,
layout: 'default',
caption: '',
label: i18n.posts.forms.editor.images.picker.uploader.label,
placeholder: i18n.posts.forms.editor.images.picker.uploader.caption.placeholder,
default: i18n.posts.forms.editor.images.picker.uploader.layout.default,
wide: i18n.posts.forms.editor.images.picker.uploader.layout.wide,
done: i18n.buttons.general.done,
trans: i18n
}
},
Expand Down Expand Up @@ -78,21 +74,21 @@
<div class="modal-dialog" id="unsplash-modal" role="document">
<div class="modal-content">
<div class="modal-body">
<p class="font-weight-bold lead">{{ this.label }}</p>
<p class="font-weight-bold lead">{{ this.trans.posts.forms.editor.images.picker.uploader.label }}</p>
<div class="form-group row">
<div class="col-lg-12">
<div v-if="imageUrl" id="current-image">
<img :src="imageUrl" class="w-100">

<div class="input-group py-2">
<input type="text" class="form-control border-0 px-0" v-model="caption"
:placeholder="this.placeholder" ref="caption">
:placeholder="this.trans.posts.forms.editor.images.picker.uploader.caption.placeholder" ref="caption">
</div>

<div class="input-group py-2">
<select class="custom-select border-0 px-0" v-model="layout">
<option value="default">{{ this.default }}</option>
<option value="wide">{{ this.wide }}</option>
<option value="default">{{ this.trans.posts.forms.editor.images.picker.uploader.layout.default }}</option>
<option value="wide">{{ this.trans.posts.forms.editor.images.picker.uploader.layout.wide }}</option>
</select>
</div>
</div>
Expand All @@ -106,7 +102,7 @@
</div>
</div>
<div class="modal-footer">
<button class="btn btn-link text-muted" data-dismiss="modal" @click="applyImage">{{ this.done }}</button>
<button class="btn btn-link text-muted" data-dismiss="modal" @click="applyImage">{{ this.trans.buttons.general.done }}</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion routes/canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Route::delete('posts/{id}', 'PostController@destroy')->name('canvas.post.destroy');

// Media routes...
Route::post('media/uploads', 'MediaController@store')->name('canvas.media.store');
Route::post('media/uploads', 'MediaController')->name('canvas.media.store');

// Tag routes...
Route::get('tags', 'TagController@index')->name('canvas.tag.index');
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MediaController extends Controller
*
* @return string
*/
public function store(): string
public function __invoke(): string
{
$path = request()->image->store(sprintf('%s/%s', config('canvas.storage_path'), 'images'), [
'disk' => config('canvas.storage_disk'),
Expand Down
Loading

0 comments on commit 7ba7431

Please sign in to comment.