Skip to content

Commit

Permalink
Merge branch 'release/4.1.24'
Browse files Browse the repository at this point in the history
* release/4.1.24:
  updated the readme
  updated the changelog
  work
  updated the config storage_path to be more ambiguous
  added blank tags to unsplash links
  added versions and contract support
  work
  work
  require support packege instead of framework
  refactored the topic assignment to be easier to read
  • Loading branch information
austintoddj committed Apr 8, 2019
2 parents 411cd5f + 3081865 commit 196dbd6
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 67 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/node_modules
/vendor
/.idea
/.vscode
composer.lock
npm-debug.log
yarn-error.log
.DS_Store
Thumbs.dbg
.phpunit.result.cache
.phpunit.result.cache
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Notes

## [v4.1.24](https://github.com/cnvs/canvas/compare/v4.1.23...v4.1.24)

### Changed

- Changed the `laravel/framework` requirement to `illuminate/support` ([#453](https://github.com/cnvs/canvas/pull/453), [a1306c5](https://github.com/cnvs/canvas/commit/a1306c5c925f6357f6c150c4249e44505ce15c57), [b056182](https://github.com/cnvs/canvas/commit/b056182da87cc92403672cbf81f062a5ea72c171))
- Updated Unsplash links to open in new tabs ([2fe5658](https://github.com/cnvs/canvas/commit/2fe5658c363afea9b03ad270353f9659bab19494))
- Refactored the `storage_path` configuration to less explicit with images ([b0ab792](https://github.com/cnvs/canvas/commit/b0ab7926446d018461ca9a644a2ac571ad6eb046))

## [v4.1.23](https://github.com/cnvs/canvas/compare/v4.1.22...v4.1.23)

### Fixed
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"require": {
"php": "^7.1.3",
"ext-json": "*",
"laravel/framework": "~5.8.0|~5.9.0"
"illuminate/support": "~5.8.0|~5.9.0",
"illuminate/contracts": "~5.8.0|~5.9.0"
},
"require-dev": {
"mockery/mockery": "^1.1",
Expand All @@ -37,14 +38,16 @@
"scripts": {
"test": "vendor/bin/phpunit"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Canvas\\CanvasServiceProvider"
]
}
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
6 changes: 3 additions & 3 deletions config/canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
| Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be attached to each route in Canvas, giving you
| These middleware will be attached to every route in Canvas, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with this list.
| the existing middleware. Or, you can simply stick with the list.
|
*/

Expand All @@ -31,7 +31,7 @@

'storage_disk' => env('CANVAS_STORAGE_DISK', 'local'),

'storage_path' => env('CANVAS_STORAGE_PATH', 'public/canvas/images'),
'storage_path' => env('CANVAS_STORAGE_PATH', 'public/canvas'),

/*
|--------------------------------------------------------------------------
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=863f00cb958b96b4441a",
"/js/app.js": "/js/app.js?id=16097a544d27945b54aa",
"/css/app.css": "/css/app.css?id=30702a620a23ba741c32",
"/css/app-dark.css": "/css/app-dark.css?id=ceb9852370c32c15e835",
"/js/app.js.map": "/js/app.js.map?id=d6ba47ca936cd965aed9",
"/js/app.js.map": "/js/app.js.map?id=f205df6a4a43140516b1",
"/favicon.ico": "/favicon.ico?id=dbb0c05daa3432643753"
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://packagist.org/packages/cnvs/canvas"><img src="https://poser.pugx.org/cnvs/canvas/downloads"></a>
<a href="https://packagist.org/packages/cnvs/canvas"><img src="https://poser.pugx.org/cnvs/canvas/v/stable"></a>
<a href="https://packagist.org/packages/cnvs/canvas"><img src="https://poser.pugx.org/cnvs/canvas/license"></a>
<br>
<br><br>
</p>

## Introduction
Expand Down Expand Up @@ -87,4 +87,4 @@ composer test

## License

Canvas is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
Canvas is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
4 changes: 2 additions & 2 deletions resources/js/components/ImagePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
this.$emit('changed', {
url: this.selectedUnsplashImage.urls.regular,
caption: 'Photo by <a href="' + this.selectedUnsplashImage.user.links.html + '">' + this.selectedUnsplashImage.user.name + '</a> on <a href="https://unsplash.com">Unsplash</a>',
caption: 'Photo by <a href="' + this.selectedUnsplashImage.user.links.html + '" target="_blank">' + this.selectedUnsplashImage.user.name + '</a> on <a href="https://unsplash.com" target="_blank">Unsplash</a>',
});
this.closeUnsplashModal();
Expand Down Expand Up @@ -175,4 +175,4 @@
</div>
</div>
</div>
</template>
</template>
2 changes: 1 addition & 1 deletion src/Http/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MediaController extends Controller
*/
public function store(): string
{
$path = request()->image->store(config('canvas.storage_path'), [
$path = request()->image->store(sprintf('%s/%s', config('canvas.storage_path'), 'images'), [
'disk' => config('canvas.storage_disk'),
'visibility' => 'public',
]);
Expand Down
26 changes: 12 additions & 14 deletions src/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function store()
);

$post->topic()->sync(
$this->assignTopics(request('topic') ? [request('topic')] : [])
$this->assignTopic(request('topic') ?? [])
);

return redirect(route('canvas.post.edit', $post->id))->with('notify', 'Saved!');
Expand Down Expand Up @@ -156,7 +156,7 @@ public function update(string $id)
);

$post->topic()->sync(
$this->assignTopics(request('topic') ? [request('topic')] : [])
$this->assignTopic(request('topic') ?? [])
);

return redirect(route('canvas.post.edit', $post->id))->with('notify', 'Saved!');
Expand Down Expand Up @@ -204,19 +204,15 @@ private function collectTags(array $incomingTags): array
}

/**
* Collect or create given topics.
* Assign a given topic.
*
* @param array $incomingTopics
* @return array
*
* @author Mohamed Said <[email protected]>
* @param $incomingTopic
* @return mixed
*/
private function assignTopics(array $incomingTopics): array
private function assignTopic(array $incomingTopic)
{
$topics = Topic::all();

return collect($incomingTopics)->map(function ($incomingTopic) use ($topics) {
$topic = $topics->where('slug', $incomingTopic['slug'])->first();
if ($incomingTopic) {
$topic = Topic::where('slug', $incomingTopic['slug'])->first();

if (! $topic) {
$topic = Topic::create([
Expand All @@ -226,7 +222,9 @@ private function assignTopics(array $incomingTopics): array
]);
}

return (string) $topic->id;
})->toArray();
return collect((string) $topic->id)->toArray();
} else {
return [];
}
}
}
5 changes: 4 additions & 1 deletion src/Http/Controllers/StatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class StatsController extends Controller
public function index()
{
// Get all of the posts
$posts = Post::select('id', 'title', 'body', 'published_at', 'created_at')->withCount('views')->get();
$posts = Post::orderByDesc('created_at')
->select('id', 'title', 'body', 'published_at', 'created_at')
->withCount('views')
->get();

// Filter out posts that are not published
$postList = $posts->filter(function ($value, $key) {
Expand Down
73 changes: 39 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1046,12 +1046,12 @@ atob@^2.1.1:
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

autoprefixer@^9.4.2:
version "9.5.0"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.5.0.tgz#7e51d0355c11596e6cf9a0afc9a44e86d1596c70"
integrity sha512-hMKcyHsZn5+qL6AUeP3c8OyuteZ4VaUlg+fWbyl8z7PqsKHF/Bf8/px3K6AT8aMzDkBo8Bc11245MM+itDBOxQ==
version "9.5.1"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.5.1.tgz#243b1267b67e7e947f28919d786b50d3bb0fb357"
integrity sha512-KJSzkStUl3wP0D5sdMlP82Q52JLy5+atf2MHAre48+ckWkXgixmfHyWmA77wFDy6jTHU6mIgXv6hAQ2mf1PjJQ==
dependencies:
browserslist "^4.4.2"
caniuse-lite "^1.0.30000947"
browserslist "^4.5.4"
caniuse-lite "^1.0.30000957"
normalize-range "^0.1.2"
num2fraction "^1.2.2"
postcss "^7.0.14"
Expand Down Expand Up @@ -1272,7 +1272,7 @@ browserify-zlib@^0.2.0:
dependencies:
pako "~1.0.5"

browserslist@^4.0.0, browserslist@^4.4.2, browserslist@^4.5.1, browserslist@^4.5.2:
browserslist@^4.0.0, browserslist@^4.5.2, browserslist@^4.5.4:
version "4.5.4"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.4.tgz#166c4ecef3b51737a42436ea8002aeea466ea2c7"
integrity sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag==
Expand Down Expand Up @@ -1407,7 +1407,7 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000947, caniuse-lite@^1.0.30000955:
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000957:
version "1.0.30000957"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000957.tgz#fb1026bf184d7d62c685205358c3b24b9e29f7b3"
integrity sha512-8wxNrjAzyiHcLXN/iunskqQnJquQQ6VX8JHfW5kLgAPRSiSuKZiNfmIkP5j7jgyXqAQBSoXyJxfnbCFS0ThSiQ==
Expand Down Expand Up @@ -1718,24 +1718,24 @@ copy-descriptor@^0.1.0:
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=

core-js-compat@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.0.tgz#cd9810b8000742535a4a43773866185e310bd4f7"
integrity sha512-W/Ppz34uUme3LmXWjMgFlYyGnbo1hd9JvA0LNQ4EmieqVjg2GPYbj3H6tcdP2QGPGWdRKUqZVbVKLNIFVs/HiA==
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.1.tgz#bff73ba31ca8687431b9c88f78d3362646fb76f0"
integrity sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==
dependencies:
browserslist "^4.5.1"
core-js "3.0.0"
core-js-pure "3.0.0"
semver "^5.6.0"
browserslist "^4.5.4"
core-js "3.0.1"
core-js-pure "3.0.1"
semver "^6.0.0"

[email protected].0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.0.0.tgz#a5679adb4875427c8c0488afc93e6f5b7125859b"
integrity sha512-yPiS3fQd842RZDgo/TAKGgS0f3p2nxssF1H65DIZvZv0Od5CygP8puHXn3IQiM/39VAvgCbdaMQpresrbGgt9g==
[email protected].1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.0.1.tgz#37358fb0d024e6b86d443d794f4e37e949098cbe"
integrity sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==

[email protected].0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957"
integrity sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ==
[email protected].1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738"
integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==

core-util-is@~1.0.0:
version "1.0.2"
Expand Down Expand Up @@ -3562,9 +3562,9 @@ js-tokens@^3.0.2:
integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=

js-yaml@^3.13.0, js-yaml@^3.9.0:
version "3.13.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.0.tgz#38ee7178ac0eea2c97ff6d96fff4b18c7d8cf98e"
integrity sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
Expand Down Expand Up @@ -4019,9 +4019,9 @@ [email protected]:
integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==

mime@^2.3.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.1.tgz#19eb7357bebbda37df585b14038347721558c715"
integrity sha512-VRUfmQO0rCd3hKwBymAn3kxYzBHr3I/wdVMywgG3HhXOwrCQgN84ZagpdTm2tZ4TNtwsSmyJWYO88mb5XvzGqQ==
version "2.4.2"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78"
integrity sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==

mimic-fn@^2.0.0:
version "2.1.0"
Expand Down Expand Up @@ -4362,9 +4362,9 @@ object-copy@^0.1.0:
kind-of "^3.0.3"

object-keys@^1.0.12:
version "1.1.0"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.0.tgz#11bd22348dd2e096a045ab06f6c85bcc340fa032"
integrity sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==

object-path@^0.9.2:
version "0.9.2"
Expand Down Expand Up @@ -4499,9 +4499,9 @@ p-finally@^1.0.0:
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=

p-is-promise@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.0.0.tgz#7554e3d572109a87e1f3f53f6a7d85d1b194f4c5"
integrity sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==
version "2.1.0"
resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==

p-limit@^2.0.0:
version "2.2.0"
Expand Down Expand Up @@ -5568,6 +5568,11 @@ semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==

semver@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65"
integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==

[email protected]:
version "0.16.2"
resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
Expand Down

0 comments on commit 196dbd6

Please sign in to comment.