Merge pull request #817 from jonnybarnes/develop

MTM Remove Mapbox links
This commit is contained in:
Jonny Barnes 2023-05-04 18:49:21 +01:00 committed by GitHub
commit 9383ed8d0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1125 additions and 1355 deletions

View file

@ -18,9 +18,9 @@ class ArticlesController extends Controller
public function index(int $year = null, int $month = null): View public function index(int $year = null, int $month = null): View
{ {
$articles = Article::where('published', '1') $articles = Article::where('published', '1')
->date($year, $month) ->date($year, $month)
->orderBy('updated_at', 'desc') ->orderBy('updated_at', 'desc')
->simplePaginate(5); ->simplePaginate(5);
return view('articles.index', compact('articles')); return view('articles.index', compact('articles'));
} }

View file

@ -20,8 +20,8 @@ class FeedsController extends Controller
$buildDate = $articles->first()->updated_at->toRssString(); $buildDate = $articles->first()->updated_at->toRssString();
return response() return response()
->view('articles.rss', compact('articles', 'buildDate')) ->view('articles.rss', compact('articles', 'buildDate'))
->header('Content-Type', 'application/rss+xml; charset=utf-8'); ->header('Content-Type', 'application/rss+xml; charset=utf-8');
} }
/** /**
@ -32,8 +32,8 @@ class FeedsController extends Controller
$articles = Article::where('published', '1')->latest('updated_at')->take(20)->get(); $articles = Article::where('published', '1')->latest('updated_at')->take(20)->get();
return response() return response()
->view('articles.atom', compact('articles')) ->view('articles.atom', compact('articles'))
->header('Content-Type', 'application/atom+xml; charset=utf-8'); ->header('Content-Type', 'application/atom+xml; charset=utf-8');
} }
/** /**
@ -45,8 +45,8 @@ class FeedsController extends Controller
$buildDate = $notes->first()->updated_at->toRssString(); $buildDate = $notes->first()->updated_at->toRssString();
return response() return response()
->view('notes.rss', compact('notes', 'buildDate')) ->view('notes.rss', compact('notes', 'buildDate'))
->header('Content-Type', 'application/rss+xml; charset=utf-8'); ->header('Content-Type', 'application/rss+xml; charset=utf-8');
} }
/** /**
@ -57,8 +57,8 @@ class FeedsController extends Controller
$notes = Note::latest()->take(20)->get(); $notes = Note::latest()->take(20)->get();
return response() return response()
->view('notes.atom', compact('notes')) ->view('notes.atom', compact('notes'))
->header('Content-Type', 'application/atom+xml; charset=utf-8'); ->header('Content-Type', 'application/atom+xml; charset=utf-8');
} }
/** @todo sort out return type for json responses */ /** @todo sort out return type for json responses */

View file

@ -63,7 +63,7 @@ class NoteService extends Service
{ {
if (Arr::get($request, 'properties.published.0')) { if (Arr::get($request, 'properties.published.0')) {
return carbon(Arr::get($request, 'properties.published.0')) return carbon(Arr::get($request, 'properties.published.0'))
->toDateTimeString(); ->toDateTimeString();
} }
if (Arr::get($request, 'published')) { if (Arr::get($request, 'published')) {
return carbon(Arr::get($request, 'published'))->toDateTimeString(); return carbon(Arr::get($request, 'published'))->toDateTimeString();

601
composer.lock generated

File diff suppressed because it is too large Load diff

1682
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,29 +5,29 @@
"repository": "https://github.com/jonnybarnes/jonnybarnes.uk", "repository": "https://github.com/jonnybarnes/jonnybarnes.uk",
"license": "CC0-1.0", "license": "CC0-1.0",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.4", "@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.4", "@babel/preset-env": "^7.21.5",
"@csstools/postcss-oklab-function": "^2.2.1", "@csstools/postcss-oklab-function": "^2.2.1",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2", "babel-loader": "^9.1.2",
"browserlist": "^1.0.1", "browserlist": "^1.0.1",
"compression-webpack-plugin": "^10.0.0", "compression-webpack-plugin": "^10.0.0",
"css-loader": "^6.7.3", "css-loader": "^6.7.3",
"cssnano": "^6.0.0", "cssnano": "^6.0.1",
"eslint": "^8.38.0", "eslint": "^8.39.0",
"eslint-webpack-plugin": "^4.0.1", "eslint-webpack-plugin": "^4.0.1",
"mini-css-extract-plugin": "^2.7.5", "mini-css-extract-plugin": "^2.7.5",
"postcss": "^8.4.21", "postcss": "^8.4.23",
"postcss-combine-duplicated-selectors": "^10.0.2", "postcss-combine-duplicated-selectors": "^10.0.2",
"postcss-combine-media-query": "^1.0.1", "postcss-combine-media-query": "^1.0.1",
"postcss-import": "^15.1.0", "postcss-import": "^15.1.0",
"postcss-loader": "^7.2.4", "postcss-loader": "^7.3.0",
"postcss-nesting": "^11.2.2", "postcss-nesting": "^11.2.2",
"stylelint": "^15.4.0", "stylelint": "^15.6.1",
"stylelint-config-standard": "^32.0.0", "stylelint-config-standard": "^33.0.0",
"stylelint-webpack-plugin": "^4.1.1", "stylelint-webpack-plugin": "^4.1.1",
"webpack": "^5.78.0", "webpack": "^5.82.0",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.0.2"
}, },
"scripts": { "scripts": {
"dev": "webpack", "dev": "webpack",

View file

@ -31,8 +31,3 @@
</div> </div>
</form> </form>
@stop @stop
@section('scripts')
@include('templates.mapbox-links')
<script src="/assets/js/newplace.js"></script>
@stop

View file

@ -141,8 +141,3 @@
<a href="/admin/places/{{ $place->id }}/merge">Merge with another place?</a> <a href="/admin/places/{{ $place->id }}/merge">Merge with another place?</a>
</p> </p>
@stop @stop
@section('scripts')
<script src="/assets/js/places.js"></script>
<link rel="stylesheet" href="/assets/frontend/mapbox-gl.css">
@stop

View file

@ -13,7 +13,3 @@
</div> </div>
{!! $notes->render() !!} {!! $notes->render() !!}
@stop @stop
@section('scripts')
@include('templates.mapbox-links')
@stop

View file

@ -50,5 +50,4 @@
@section('scripts') @section('scripts')
<link rel="stylesheet" href="/assets/highlight/zenburn.css"> <link rel="stylesheet" href="/assets/highlight/zenburn.css">
@include('templates.mapbox-links')
@stop @stop

View file

@ -10,7 +10,3 @@
<p class="latlnginfo">Latitude: <span class="p-latitude">{{ $place->latitude }}</span>, longitude: <span class="p-longitude">{{ $place->longitude }}</span></p> <p class="latlnginfo">Latitude: <span class="p-latitude">{{ $place->latitude }}</span>, longitude: <span class="p-longitude">{{ $place->longitude }}</span></p>
</div> </div>
@stop @stop
@section('scripts')
@include('templates.mapbox-links')
@stop

View file

@ -1,12 +0,0 @@
<link
rel="stylesheet"
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css"
integrity="sha384-PYw71wfjazx+zrtu+VUANG9IUt/6zSXgC5ZXC+u0BIIND+7Whnehc/w3uYV+HxDY"
crossorigin="anonymous"
>
<script
src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js"
integrity="sha384-1Iccp/Bs+CQID7AAwqG8UY72KSTYd2t9KFa5gY/4QPW1W6EfLHisdFg4Xvc8HwMa"
crossorigin="anonymous"
defer
></script>

View file

@ -16,7 +16,7 @@ class ExampleTest extends DuskTestCase
{ {
$this->browse(function (Browser $browser) { $this->browse(function (Browser $browser) {
$browser->visit('/') $browser->visit('/')
->assertSee('Laravel'); ->assertSee('Laravel');
}); });
} }
} }

View file

@ -15,7 +15,7 @@ class NotesTest extends DuskTestCase
{ {
$this->browse(function ($browser) { $this->browse(function ($browser) {
$browser->visit('/notes/D') $browser->visit('/notes/D')
->assertSee('JBL5'); ->assertSee('JBL5');
}); });
} }
@ -28,7 +28,7 @@ class NotesTest extends DuskTestCase
{ {
$this->browse(function ($browser) { $this->browse(function ($browser) {
$browser->visit('/notes/E') $browser->visit('/notes/E')
->assertSee('quill.p3k.io'); ->assertSee('quill.p3k.io');
}); });
} }
} }

View file

@ -18,7 +18,7 @@ class AdminHomeControllerTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin'); ->get('/admin');
$response->assertViewIs('admin.welcome'); $response->assertViewIs('admin.welcome');
} }

View file

@ -21,7 +21,7 @@ class ArticlesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/blog'); ->get('/admin/blog');
$response->assertSeeText('Select article to edit:'); $response->assertSeeText('Select article to edit:');
} }
@ -31,7 +31,7 @@ class ArticlesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/blog/create'); ->get('/admin/blog/create');
$response->assertSeeText('Title (URL)'); $response->assertSeeText('Title (URL)');
} }
@ -41,10 +41,10 @@ class ArticlesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/blog', [ ->post('/admin/blog', [
'title' => 'Test Title', 'title' => 'Test Title',
'main' => 'Article content', 'main' => 'Article content',
]); ]);
$this->assertDatabaseHas('articles', ['title' => 'Test Title']); $this->assertDatabaseHas('articles', ['title' => 'Test Title']);
} }
@ -62,10 +62,10 @@ class ArticlesTest extends TestCase
$file = new UploadedFile($path, 'article.md', 'text/plain', null, true); $file = new UploadedFile($path, 'article.md', 'text/plain', null, true);
$this->actingAs($user) $this->actingAs($user)
->post('/admin/blog', [ ->post('/admin/blog', [
'title' => 'Uploaded Article', 'title' => 'Uploaded Article',
'article' => $file, 'article' => $file,
]); ]);
$this->assertDatabaseHas('articles', [ $this->assertDatabaseHas('articles', [
'title' => 'Uploaded Article', 'title' => 'Uploaded Article',
@ -82,7 +82,7 @@ class ArticlesTest extends TestCase
]); ]);
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/blog/' . $article->id . '/edit'); ->get('/admin/blog/' . $article->id . '/edit');
$response->assertSeeText('This is *my* new blog. It uses `Markdown`.'); $response->assertSeeText('This is *my* new blog. It uses `Markdown`.');
} }
@ -93,11 +93,11 @@ class ArticlesTest extends TestCase
$article = Article::factory()->create(); $article = Article::factory()->create();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/blog/' . $article->id, [ ->post('/admin/blog/' . $article->id, [
'_method' => 'PUT', '_method' => 'PUT',
'title' => 'My New Blog', 'title' => 'My New Blog',
'main' => 'This article has been edited', 'main' => 'This article has been edited',
]); ]);
$this->assertDatabaseHas('articles', [ $this->assertDatabaseHas('articles', [
'title' => 'My New Blog', 'title' => 'My New Blog',
'main' => 'This article has been edited', 'main' => 'This article has been edited',
@ -111,9 +111,9 @@ class ArticlesTest extends TestCase
$article = Article::factory()->create(); $article = Article::factory()->create();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/blog/' . $article->id, [ ->post('/admin/blog/' . $article->id, [
'_method' => 'DELETE', '_method' => 'DELETE',
]); ]);
$this->assertSoftDeleted('articles', [ $this->assertSoftDeleted('articles', [
'title' => $article->title, 'title' => $article->title,
]); ]);

View file

@ -19,7 +19,7 @@ class ClientsTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/clients'); ->get('/admin/clients');
$response->assertSeeText('Clients'); $response->assertSeeText('Clients');
} }
@ -29,7 +29,7 @@ class ClientsTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/clients/create'); ->get('/admin/clients/create');
$response->assertSeeText('New Client'); $response->assertSeeText('New Client');
} }
@ -39,10 +39,10 @@ class ClientsTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/clients', [ ->post('/admin/clients', [
'client_name' => 'Micropublish', 'client_name' => 'Micropublish',
'client_url' => 'https://micropublish.net', 'client_url' => 'https://micropublish.net',
]); ]);
$this->assertDatabaseHas('clients', [ $this->assertDatabaseHas('clients', [
'client_name' => 'Micropublish', 'client_name' => 'Micropublish',
'client_url' => 'https://micropublish.net', 'client_url' => 'https://micropublish.net',
@ -58,7 +58,7 @@ class ClientsTest extends TestCase
]); ]);
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/clients/' . $client->id . '/edit'); ->get('/admin/clients/' . $client->id . '/edit');
$response->assertSee('https://jbl5.dev/notes/new'); $response->assertSee('https://jbl5.dev/notes/new');
} }
@ -69,11 +69,11 @@ class ClientsTest extends TestCase
$client = MicropubClient::factory()->create(); $client = MicropubClient::factory()->create();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/clients/' . $client->id, [ ->post('/admin/clients/' . $client->id, [
'_method' => 'PUT', '_method' => 'PUT',
'client_url' => 'https://jbl5.dev/notes/new', 'client_url' => 'https://jbl5.dev/notes/new',
'client_name' => 'JBL5dev', 'client_name' => 'JBL5dev',
]); ]);
$this->assertDatabaseHas('clients', [ $this->assertDatabaseHas('clients', [
'client_url' => 'https://jbl5.dev/notes/new', 'client_url' => 'https://jbl5.dev/notes/new',
'client_name' => 'JBL5dev', 'client_name' => 'JBL5dev',
@ -89,9 +89,9 @@ class ClientsTest extends TestCase
]); ]);
$this->actingAs($user) $this->actingAs($user)
->post('/admin/clients/' . $client->id, [ ->post('/admin/clients/' . $client->id, [
'_method' => 'DELETE', '_method' => 'DELETE',
]); ]);
$this->assertDatabaseMissing('clients', [ $this->assertDatabaseMissing('clients', [
'client_url' => 'https://jbl5.dev/notes/new', 'client_url' => 'https://jbl5.dev/notes/new',
]); ]);

View file

@ -21,7 +21,7 @@ class LikesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/likes'); ->get('/admin/likes');
$response->assertSeeText('Likes'); $response->assertSeeText('Likes');
} }
@ -31,7 +31,7 @@ class LikesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/likes/create'); ->get('/admin/likes/create');
$response->assertSeeText('New Like'); $response->assertSeeText('New Like');
} }
@ -42,9 +42,9 @@ class LikesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/likes', [ ->post('/admin/likes', [
'like_url' => 'https://example.com', 'like_url' => 'https://example.com',
]); ]);
$this->assertDatabaseHas('likes', [ $this->assertDatabaseHas('likes', [
'url' => 'https://example.com', 'url' => 'https://example.com',
]); ]);
@ -58,7 +58,7 @@ class LikesTest extends TestCase
$like = Like::factory()->create(); $like = Like::factory()->create();
$response = $this->actingAs($user) $response = $this->actingAs($user)
->get('/admin/likes/' . $like->id . '/edit'); ->get('/admin/likes/' . $like->id . '/edit');
$response->assertSee('Edit Like'); $response->assertSee('Edit Like');
} }
@ -70,10 +70,10 @@ class LikesTest extends TestCase
$like = Like::factory()->create(); $like = Like::factory()->create();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/likes/' . $like->id, [ ->post('/admin/likes/' . $like->id, [
'_method' => 'PUT', '_method' => 'PUT',
'like_url' => 'https://example.com', 'like_url' => 'https://example.com',
]); ]);
$this->assertDatabaseHas('likes', [ $this->assertDatabaseHas('likes', [
'url' => 'https://example.com', 'url' => 'https://example.com',
]); ]);
@ -88,9 +88,9 @@ class LikesTest extends TestCase
$user = User::factory()->make(); $user = User::factory()->make();
$this->actingAs($user) $this->actingAs($user)
->post('/admin/likes/' . $like->id, [ ->post('/admin/likes/' . $like->id, [
'_method' => 'DELETE', '_method' => 'DELETE',
]); ]);
$this->assertDatabaseMissing('likes', [ $this->assertDatabaseMissing('likes', [
'url' => $url, 'url' => $url,
]); ]);

View file

@ -25,7 +25,7 @@ class ProcessBookmarkJobTest extends TestCase
$bookmark = Bookmark::factory()->create(); $bookmark = Bookmark::factory()->create();
$service = $this->createMock(BookmarkService::class); $service = $this->createMock(BookmarkService::class);
$service->method('getArchiveLink') $service->method('getArchiveLink')
->willReturn('https://web.archive.org/web/1234'); ->willReturn('https://web.archive.org/web/1234');
$this->app->instance(BookmarkService::class, $service); $this->app->instance(BookmarkService::class, $service);
$job = new ProcessBookmark($bookmark); $job = new ProcessBookmark($bookmark);
@ -46,7 +46,7 @@ class ProcessBookmarkJobTest extends TestCase
$bookmark = Bookmark::factory()->create(); $bookmark = Bookmark::factory()->create();
$service = $this->createMock(BookmarkService::class); $service = $this->createMock(BookmarkService::class);
$service->method('getArchiveLink') $service->method('getArchiveLink')
->will($this->throwException(new InternetArchiveException())); ->will($this->throwException(new InternetArchiveException()));
$this->app->instance(BookmarkService::class, $service); $this->app->instance(BookmarkService::class, $service);
$job = new ProcessBookmark($bookmark); $job = new ProcessBookmark($bookmark);

View file

@ -30,7 +30,7 @@ class SaveProfileImageJobTest extends TestCase
$mf = ['items' => []]; $mf = ['items' => []];
$authorship = $this->createMock(Authorship::class); $authorship = $this->createMock(Authorship::class);
$authorship->method('findAuthor') $authorship->method('findAuthor')
->will($this->throwException(new AuthorshipParserException())); ->will($this->throwException(new AuthorshipParserException()));
$job = new SaveProfileImage($mf); $job = new SaveProfileImage($mf);
$this->assertNull($job->handle($authorship)); $this->assertNull($job->handle($authorship));
@ -48,7 +48,7 @@ class SaveProfileImageJobTest extends TestCase
]; ];
$authorship = $this->createMock(Authorship::class); $authorship = $this->createMock(Authorship::class);
$authorship->method('findAuthor') $authorship->method('findAuthor')
->willReturn($author); ->willReturn($author);
$job = new SaveProfileImage($mf); $job = new SaveProfileImage($mf);
$this->assertNull($job->handle($authorship)); $this->assertNull($job->handle($authorship));
@ -72,7 +72,7 @@ class SaveProfileImageJobTest extends TestCase
]; ];
$authorship = $this->createMock(Authorship::class); $authorship = $this->createMock(Authorship::class);
$authorship->method('findAuthor') $authorship->method('findAuthor')
->willReturn($author); ->willReturn($author);
$job = new SaveProfileImage($mf); $job = new SaveProfileImage($mf);
$job->handle($authorship); $job->handle($authorship);
@ -97,7 +97,7 @@ class SaveProfileImageJobTest extends TestCase
]; ];
$authorship = $this->createMock(Authorship::class); $authorship = $this->createMock(Authorship::class);
$authorship->method('findAuthor') $authorship->method('findAuthor')
->willReturn($author); ->willReturn($author);
$job = new SaveProfileImage($mf); $job = new SaveProfileImage($mf);
$job->handle($authorship); $job->handle($authorship);

View file

@ -105,11 +105,11 @@ class WebMentionTest extends TestCase
$this->app->instance(Codebird::class, $codebirdMock); $this->app->instance(Codebird::class, $codebirdMock);
Cache::shouldReceive('has') Cache::shouldReceive('has')
->once() ->once()
->andReturn(false); ->andReturn(false);
Cache::shouldReceive('put') Cache::shouldReceive('put')
->once() ->once()
->andReturn(true); ->andReturn(true);
$webmention = new WebMention(); $webmention = new WebMention();
$twitterURL = 'https://twitter.com/example'; $twitterURL = 'https://twitter.com/example';