Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6cbe3ff
Ignore .idea/ folder
Oct 10, 2019
b95ca12
Implement favorite sharing prototype
Oct 10, 2019
f99805a
Display correct sharing url
paulschwoerer Nov 21, 2019
efd7e1c
Add custom frontend Vue prop types
paulschwoerer Nov 21, 2019
8c8f064
Configure linting
paulschwoerer Nov 21, 2019
e5569e3
Add restriction to only allow read only shares
paulschwoerer Nov 21, 2019
ad27b7e
Fix issue with share url not being displayed depending on 'this' context
paulschwoerer Nov 25, 2019
f327f37
Change favorite popup look when editing is not allowed
paulschwoerer Nov 25, 2019
b804c11
Adapt existing tests to work with new FavoriteService constructor
paulschwoerer Nov 29, 2019
effd86b
Use database mappers and add tests
paulschwoerer Dec 1, 2019
e05e971
Make sure category share is renamed correctly
paulschwoerer Dec 1, 2019
0b047c4
Light refactoring
paulschwoerer Dec 2, 2019
f3a7e49
Add message for empty category share
paulschwoerer Dec 2, 2019
5a156db
Prepare map container for map layer selection
paulschwoerer Dec 4, 2019
be74a74
Make sure empty favorite name is displayed in sidebar
paulschwoerer Dec 4, 2019
7bca800
Fix copy paste error in routes.php
paulschwoerer Dec 4, 2019
110e7ef
Add favorite share mapper tests
paulschwoerer Dec 4, 2019
76e5224
Configure ESLint & Prettier to be more forgiving
paulschwoerer Dec 6, 2019
d011ffd
Improve usability & adjust styling of share dialogue
paulschwoerer Dec 10, 2019
1811954
Fixes and improvements in public part
paulschwoerer Dec 10, 2019
a77dc77
Change link sharing text
paulschwoerer Dec 11, 2019
51b0dbc
Adjust header subtitle color
paulschwoerer Dec 11, 2019
99f7417
Add star icons to public share favorite list
paulschwoerer Dec 11, 2019
626d8ff
Move zoom buttons to bottom right on public share page
paulschwoerer Dec 11, 2019
4445800
Make sure public share page properly responds to smaller screens
paulschwoerer Dec 11, 2019
7599a70
Hide public share footer
paulschwoerer Dec 11, 2019
9f12e92
Add leaflet cluster css
paulschwoerer Dec 13, 2019
b1f5e98
Remove unnecessary Leaflet imports
paulschwoerer Dec 13, 2019
6603e71
Add scale control to public share map
paulschwoerer Dec 13, 2019
eabc560
Add copyright notices and licenses
paulschwoerer Dec 13, 2019
b7cb991
Move sharing dialogue to favorite action menu
paulschwoerer Dec 15, 2019
3f3982e
Remove unnecessary debug method
paulschwoerer Dec 15, 2019
d6b5545
Add @nextcloud/browserlist-config
paulschwoerer Dec 15, 2019
bb4bc38
Fix typo
paulschwoerer Dec 19, 2019
7887f0a
Remove public share utils
paulschwoerer Dec 19, 2019
0a02734
Move DB mapper tests from unit to integration testing
paulschwoerer Dec 20, 2019
cc98241
Add favorite share entity php doc to enable autocomplete of magic met…
paulschwoerer Dec 20, 2019
deaf925
Rework style compilation flow to enable usage of built in icons
paulschwoerer Dec 29, 2019
844f02d
Bump node-sass
paulschwoerer Jan 17, 2020
213f97b
Reformat php code part of favorite sharing
paulschwoerer Jan 19, 2020
0119057
Reformat js code part of favorite sharing
paulschwoerer Jan 19, 2020
175df5b
Add and configure stylelint
paulschwoerer Jan 28, 2020
d4c3d43
Formatting and whitespace changes
paulschwoerer Jan 28, 2020
75540fc
Fix formatting in webpack.prod.js
paulschwoerer Feb 5, 2020
a6375b3
Create separate entry-point for public favorite share
paulschwoerer Feb 5, 2020
a6086fc
Use a line-based approach for displaying an OSM address to not use v-…
paulschwoerer Feb 5, 2020
6049f15
Configure webpack to place built images in /img/ folder
paulschwoerer Feb 5, 2020
d131845
Improve usability of favorite icons
paulschwoerer Feb 5, 2020
4700a15
Merge branch 'master' into issue-70-share-favorite-locations
paulschwoerer Mar 1, 2020
4d7b16a
Fixes and refactoring
paulschwoerer Mar 1, 2020
8e44a25
address code style changes
paulschwoerer Apr 3, 2020
b30814a
horten changelist by resetting some autoformatter changes
paulschwoerer Apr 3, 2020
2d9e992
Merge branch 'master' into issue-70-share-favorite-locations
paulschwoerer Apr 3, 2020
6212a98
refs #217 fix sql query to get fav share, it was breaking share removal
Apr 13, 2020
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
11 changes: 11 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-object-rest-spread'
],
presets: [
[
'@babel/preset-env'
]
]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
js/
l10n/
src/adminSettings.js
src/contactsController.js
src/devicesController.js
src/favoritesController.js
src/filetypes.js
src/nonLocalizedPhotosController.js
src/photosController.js
src/script.js
src/tracksController.js
src/utils.js
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
"nextcloud"
],
rules: {
"vue/component-name-in-template-casing": ["error", "PascalCase"],
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
},
globals: {
OC: false,
OCA: false,
t: false,
n: false,
$: false // TODO: remove once jQuery has been removed
},
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
parser: "babel-eslint"
}
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ yarn-debug.log*
yarn-error.log*
package-json.log*

# Ide
.idea/

# Runtime data
pids
*.pid
Expand Down
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
css/
18 changes: 18 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["stylelint-config-recommended-scss"],
"rules": {
"media-feature-name-no-unknown": true,
"property-no-unknown": true,
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": [true, {
"ignorePseudoElements": ["v-deep"]
}],
"selector-type-no-unknown": true,
"string-no-newline": true,
"unit-case": "lower",
"unit-no-unknown": true,
"indentation": [4, {
"severity": "error"
}]
}
}
53 changes: 47 additions & 6 deletions appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
namespace OCA\Maps\AppInfo;


use OC\AppFramework\Utility\SimpleContainer;
use OCA\Maps\Service\AddressService;
use OCA\Maps\DB\FavoriteShareMapper;
use OCA\Maps\Controller\PublicFavoritesApiController;
use \OCP\AppFramework\App;
use OCA\Maps\Controller\PageController;
use OCA\Maps\Controller\UtilsController;
use OCA\Maps\Controller\FavoritesController;
use OCA\Maps\Controller\FavoritesApiController;
use OCA\Maps\Controller\DevicesController;
use OCA\Maps\Controller\PublicPageController;
use OCA\Maps\Controller\DevicesApiController;
use OCA\Maps\Controller\RoutingController;
use OCA\Maps\Controller\TracksController;
Expand Down Expand Up @@ -66,9 +66,14 @@ public function __construct (array $urlParams=array()) {
$c->query('ServerContainer')->getLogger(),
new FavoritesService(
$c->query('ServerContainer')->getLogger(),
$c->query('ServerContainer')->getL10N($c->query('AppName'))
$c->query('ServerContainer')->getL10N($c->query('AppName')),
$c->query('ServerContainer')->getSecureRandom()
),
$c->query('ServerContainer')->getDateTimeZone()
$c->query('ServerContainer')->getDateTimeZone(),
new FavoriteShareMapper(
$c->query('DatabaseConnection'),
$c->query('ServerContainer')->getSecureRandom()
)
);
}
);
Expand All @@ -89,7 +94,43 @@ public function __construct (array $urlParams=array()) {
$c->query('ServerContainer')->getLogger(),
new FavoritesService(
$c->query('ServerContainer')->getLogger(),
$c->query('ServerContainer')->getL10N($c->query('AppName'))
$c->query('ServerContainer')->getL10N($c->query('AppName')),
$c->query('ServerContainer')->getSecureRandom()
)
);
}
);

$container->registerService(
'PublicFavoritesAPIController', function ($c) {
return new PublicFavoritesApiController(
$c->query('AppName'),
$c->query('Request'),
$c->query('Session'),
new FavoritesService(
$c->query('ServerContainer')->getLogger(),
$c->query('ServerContainer')->getL10N($c->query('AppName')),
$c->query('ServerContainer')->getSecureRandom()
),
new FavoriteShareMapper(
$c->query('DatabaseConnection'),
$c->query('ServerContainer')->getSecureRandom()
)
);
}
);

$container->registerService(
'PublicPageController', function ($c) {
return new PublicPageController(
$c->query('AppName'),
$c->query('Request'),
$c->query('Session'),
$c->query('ServerContainer')->getConfig(),
$c->query('Logger'),
new FavoriteShareMapper(
$c->query('DatabaseConnection'),
$c->query('ServerContainer')->getSecureRandom()
)
);
}
Expand Down
18 changes: 18 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#do_echo', 'url' => '/echo', 'verb' => 'POST'],
['name' => 'page#openGeoLink', 'url' => '/openGeoLink/{url}', 'verb' => 'GET'],
['name' => 'public_page#sharedFavoritesCategory', 'url' => '/s/favorites/{token}', 'verb' => 'GET'],


// utils
Expand Down Expand Up @@ -47,13 +48,30 @@
['name' => 'favorites_api#editFavorite', 'url' => '/api/{apiversion}/favorites/{id}', 'verb' => 'PUT'],
['name' => 'favorites_api#deleteFavorite', 'url' => '/api/{apiversion}/favorites/{id}', 'verb' => 'DELETE'],

// public favorites API
[
'name' => 'favorites_api#preflighted_cors',
'url' => '/api/1.0/public/favorites{path}',
'verb' => 'OPTIONS',
'requirements' => ['path' => '.+']
],
['name' => 'public_favorites_api#getFavorites', 'url' => '/api/1.0/public/{token}/favorites', 'verb' => 'GET'],
// ['name' => 'public_favorites_api#addFavorite', 'url' => '/api/1.0/public/{token}/favorites', 'verb' => 'POST'],
// ['name' => 'public_favorites_api#editFavorite', 'url' => '/api/1.0/public/{token}/favorites/{id}', 'verb' => 'PUT'],
// ['name' => 'public_favorites_api#deleteFavorite', 'url' => '/api/1.0/public/{token}/favorites/{id}', 'verb' => 'DELETE'],

// favorites
['name' => 'favorites#getFavorites', 'url' => '/favorites', 'verb' => 'GET'],
['name' => 'favorites#addFavorite', 'url' => '/favorites', 'verb' => 'POST'],
['name' => 'favorites#editFavorite', 'url' => '/favorites/{id}', 'verb' => 'PUT'],
['name' => 'favorites#deleteFavorite', 'url' => '/favorites/{id}', 'verb' => 'DELETE'],
['name' => 'favorites#deleteFavorites', 'url' => '/favorites', 'verb' => 'DELETE'],

// favorite categories
['name' => 'favorites#renameCategories', 'url' => '/favorites-category', 'verb' => 'PUT'],
['name' => 'favorites#getSharedCategories', 'url' => '/favorites-category/shared', 'verb' => 'GET'],
['name' => 'favorites#shareCategory', 'url' => '/favorites-category/{category}/share', 'verb' => 'POST'],
['name' => 'favorites#unShareCategory', 'url' => '/favorites-category/{category}/un-share', 'verb' => 'POST'],

['name' => 'favorites#exportFavorites', 'url' => '/export/favorites', 'verb' => 'POST'],
['name' => 'favorites#importFavorites', 'url' => '/import/favorites', 'verb' => 'POST'],
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"require": {
"lsolesen/pel": "^0.9.6"
},
"require-dev": {
"christophwurst/nextcloud_testing": "^0.9.1"
}
}
39 changes: 39 additions & 0 deletions css/icons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* @copyright Copyright (c) 2019, Paul Schwörer <hello@paulschwoerer.de>
*
* @author Paul Schwörer <hello@paulschwoerer.de>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

@mixin create-icon($varName, $icon, $dir, $color, $version: 1, $core: false) {
//noinspection CssInvalidFunction
#{$varName}: url(icon-color-path($icon, $dir, $color, $version, $core));
}

:root {
@include create-icon(
"--maps-icon-favorite-star",
"star-dark",
"actions",
#fff,
2,
true
);

// Feel free to add more icons here ...
}
23 changes: 23 additions & 0 deletions css/merged-public-favorite-share.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @copyright Copyright (c) 2019, Paul Schwörer <hello@paulschwoerer.de>
*
* @author Paul Schwörer <hello@paulschwoerer.de>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

@import "icons";
30 changes: 30 additions & 0 deletions css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -816,3 +816,33 @@ tr.selected td {
.ui-autocomplete {
z-index: 9999;
}

.favorite-share-link-clipboard-button {
display: none;
position: absolute;
right: 0;

&.visible {
display: block;
}

&.tooltip-visible .copied-tooltip {
opacity: .9;
transform: translate(-50%, 0);
}

.copied-tooltip {
position: absolute;
bottom: calc(100% - 10px);
line-height: normal;
left: 50%;
transition: transform .2s, opacity .2s;
transform: translate(-50%, 5px);
opacity: 0;
margin: auto;
background: #222;
color: #fff;
padding: 4px;
border-radius: 2px;
}
}
Loading