Merge pull request #4058 from wallabag/feature/copy-client-info

Copy client info to clipboard
This commit is contained in:
Jérémy Benoist 2019-07-17 17:04:14 +02:00 committed by GitHub
commit 3a08e81969
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 92 additions and 13 deletions

View file

@ -4,6 +4,8 @@ import $ from 'jquery';
/* Annotations */
import annotator from 'annotator';
import ClipboardJS from 'clipboard';
/* Fonts */
import 'material-design-icons-iconfont/dist/material-design-icons.css';
import 'lato-font/css/lato-font.css';
@ -107,4 +109,10 @@ $(document).ready(() => {
$('#user_emailTwoFactor').on('change', () => {
$('#user_googleTwoFactor').prop('checked', false);
});
// handle copy to clipboard for developer stuff
const clipboard = new ClipboardJS('.btn');
clipboard.on('success', (e) => {
e.clearSelection();
});
});

View file

@ -64,6 +64,7 @@
},
"dependencies": {
"annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85",
"clipboard": "^2.0.4",
"hammerjs": "^2.0.8",
"highlight.js": "^9.12.0",
"icomoon-free-npm": "^0.0.0",

View file

@ -518,6 +518,7 @@ developer:
# redirect_uris_label: 'Redirect URIs'
# save_label: 'Create a new client'
# action_back: 'Back'
# copy_to_clipboard: Copy
# client_parameter:
# page_title: 'API clients management > Client parameters'
# page_description: 'Here are your client parameters.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'Weiterleitungs-URIs'
save_label: 'Neuen Client erstellen'
action_back: 'Zurück'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'API-Client-Verwaltung > Client-Parameter'
page_description: 'Dies sind deine Client-Parameter.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'Redirect URIs (optional)'
save_label: 'Create a new client'
action_back: 'Back'
copy_to_clipboard: Copy
client_parameter:
page_title: 'API clients management > Client parameters'
page_description: 'Here are your client parameters.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'URIs de redirección'
save_label: 'Crear un nuevo cliente'
action_back: 'Volver'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'Gestión de clientes API > Parámetros del cliente'
page_description: 'Aquí están los parámetros del cliente.'

View file

@ -518,6 +518,7 @@ developer:
# redirect_uris_label: 'Redirect URIs'
# save_label: 'Create a new client'
# action_back: 'بازگشت'
# copy_to_clipboard: Copy
# client_parameter:
# page_title: 'API clients management > Client parameters'
# page_description: 'Here are your client parameters.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: "Adresses de redirection (optionnel)"
save_label: "Créer un nouveau client"
action_back: "Retour"
copy_to_clipboard: Copier
client_parameter:
page_title: "Gestion des clients API > Les paramètres de votre client"
page_description: "Voilà les paramètres de votre client"

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'Redirect URI'
save_label: 'Crea un nuovo client'
action_back: 'Indietro'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'Gestione client API > Parametri Client'
page_description: 'Questi sono i tuoi parametri del client.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'URLs de redireccion'
save_label: 'Crear un novèl client'
action_back: 'Retorn'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'Gestion dels clients API > Los paramètres de vòstre client'
page_description: 'Vaquí los paramètres de vòstre client.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'Przekieruj adresy URI'
save_label: 'Stwórz nowego klienta'
action_back: 'Cofnij'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'Zarządzanie klientami API > Parametry klienta'
page_description: 'Tutaj znajdują się parametry klienta.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'URIs de redirecionamento'
save_label: 'Criar um novo cliente'
action_back: 'Voltar'
# copy_to_clipboard: Copy
client_parameter:
# page_title: 'API clients management > Parâmetros de clientes'
page_description: 'Aqui estão os parâmetros de seus clientes.'

View file

@ -518,6 +518,7 @@ developer:
# redirect_uris_label: 'Redirect URIs'
# save_label: 'Create a new client'
# action_back: 'Back'
# copy_to_clipboard: Copy
# client_parameter:
# page_title: 'API clients management > Client parameters'
# page_description: 'Here are your client parameters.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'Ссылка перенаправления (опционально)'
save_label: 'Создать нового клиента'
action_back: 'Назад'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'Управление клиентским API > Параметры клиента'
page_description: 'Здесь ваши параметры клиента.'

View file

@ -518,6 +518,7 @@ developer:
redirect_uris_label: 'เส้นทางใหม่ของ URIs (ให้เลือกได้)'
save_label: 'สร่้างลูกข่ายใหม'
action_back: 'กลับ'
# copy_to_clipboard: Copy
client_parameter:
page_title: 'การจัดการลูกข่ายของ API > พารามิเตอร์ของลูกข่าย'
page_description: 'ที่นี้เป็นพารามิเตอร์ของลูกข่ายของคุณ'

View file

@ -518,6 +518,7 @@ developer:
# redirect_uris_label: 'Redirect URIs'
# save_label: 'Create a new client'
# action_back: 'Back'
# copy_to_clipboard: Copy
# client_parameter:
# page_title: 'API clients management > Client parameters'
# page_description: 'Here are your client parameters.'

View file

@ -8,11 +8,29 @@
<div class="card-panel settings">
<div class="row">
<p>{{ 'developer.client_parameter.page_description'|trans }}</p>
<ul>
<li>{{ 'developer.client_parameter.field_name'|trans }}: <strong><pre>{{ client_name }}</pre></strong></li>
<li>{{ 'developer.client_parameter.field_id'|trans }}: <strong><pre>{{ client_id }}</pre></strong></li>
<li>{{ 'developer.client_parameter.field_secret'|trans }}: <strong><pre>{{ client_secret }}</pre></strong></li>
</ul>
<table class="striped">
<tr>
<td>{{ 'developer.client_parameter.field_name'|trans }}</td>
<td><strong><code>{{ client_name }}</code></strong></td>
</tr>
<tr>
<td>{{ 'developer.client_parameter.field_id'|trans }}</td>
<td>
<strong><code>{{ client_id }}</code></strong>
<button class="btn" data-clipboard-text="{{ client_id }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
</td>
</tr>
<tr>
<td>{{ 'developer.client_parameter.field_secret'|trans }}</td>
<td>
<strong><code>{{ client_secret }}</code></strong>
<button class="btn" data-clipboard-text="{{ client_secret }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
</td>
</tr>
</table>
<br/>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client_parameter.back'|trans }}</a>
<a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{{ 'developer.client_parameter.read_howto'|trans }}</a>

View file

@ -33,11 +33,17 @@
<table class="striped">
<tr>
<td>{{ 'developer.existing_clients.field_id'|trans }}</td>
<td><strong><code>{{ client.clientId }}</code></strong></td>
<td>
<strong><code>{{ client.clientId }}</code></strong>
<button class="btn" data-clipboard-text="{{ client.clientId }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
</td>
</tr>
<tr>
<td>{{ 'developer.existing_clients.field_secret'|trans }}</td>
<td><strong><code>{{ client.secret }}</code></strong></td>
<td>
<strong><code>{{ client.secret }}</code></strong>
<button class="btn" data-clipboard-text="{{ client.secret }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
</td>
</tr>
<tr>
<td>{{ 'developer.existing_clients.field_uris'|trans }}</td>
@ -48,9 +54,10 @@
<td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td>
</tr>
</table>
<p>{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}</p>
<p>{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}</p>
<p>
{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}<br/>
{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans({'%name%': client.name }) }}</a>
</p>
</div>

View file

@ -30,7 +30,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
$this->assertGreaterThan(\count($nbClients), \count($newNbClients));
$this->assertGreaterThan(1, $alert = $crawler->filter('.settings ul li strong')->extract(['_text']));
$this->assertGreaterThan(1, $alert = $crawler->filter('.settings table strong')->extract(['_text']));
$this->assertContains('My app', $alert[0]);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
!function(o){function __webpack_require__(e){if(n[e])return n[e].exports;var p=n[e]={i:e,l:!1,exports:{}};return o[e].call(p.exports,p,p.exports,__webpack_require__),p.l=!0,p.exports}var n={};__webpack_require__.m=o,__webpack_require__.c=n,__webpack_require__.i=function(o){return o},__webpack_require__.d=function(o,n,e){__webpack_require__.o(o,n)||Object.defineProperty(o,n,{configurable:!1,enumerable:!0,get:e})},__webpack_require__.n=function(o){var n=o&&o.__esModule?function(){return o.default}:function(){return o};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(o,n){return Object.prototype.hasOwnProperty.call(o,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=232)}({220:function(o,n,e){function webpackContext(o){return e(webpackContextResolve(o))}function webpackContextResolve(o){var n=p[o];if(!(n+1))throw new Error("Cannot find module '"+o+"'.");return n}var p={"./appicon/apple-touch-icon-114.png":235,"./appicon/apple-touch-icon-120.png":236,"./appicon/apple-touch-icon-144.png":237,"./appicon/apple-touch-icon-152.png":238,"./appicon/apple-touch-icon-57.png":239,"./appicon/apple-touch-icon-72.png":240,"./appicon/apple-touch-icon-76.png":241,"./appicon/apple-touch-icon.png":242,"./appicon/favicon.ico":243,"./bg-select.png":244,"./icons/Diaspora-asterisk.svg":245,"./icons/carrot-icon--black.png":246,"./icons/carrot-icon--white.png":247,"./icons/diaspora-icon--black.png":248,"./icons/diaspora-icon--white.png":249,"./icons/scuttle.png":250,"./icons/shaarli.png":251,"./icons/unmark-icon--black.png":252,"./list.png":253,"./logo-square.svg":254,"./logo-w.png":255,"./logo-wallabag.svg":256,"./table.png":257};webpackContext.keys=function(){return Object.keys(p)},webpackContext.resolve=webpackContextResolve,o.exports=webpackContext,webpackContext.id=220},227:function(o,n){},232:function(o,n,e){"use strict";e(227),function(o){o.keys().forEach(o)}(e(220))},235:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-114.png"},236:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-120.png"},237:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-144.png"},238:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-152.png"},239:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-57.png"},240:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-72.png"},241:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-76.png"},242:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon.png"},243:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/favicon.ico"},244:function(o,n,e){o.exports=e.p+"themes/_global/img/bg-select.png"},245:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/Diaspora-asterisk.svg"},246:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--black.png"},247:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--white.png"},248:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--black.png"},249:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--white.png"},250:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/scuttle.png"},251:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/shaarli.png"},252:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/unmark-icon--black.png"},253:function(o,n,e){o.exports=e.p+"themes/_global/img/list.png"},254:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-square.svg"},255:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-w.png"},256:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-wallabag.svg"},257:function(o,n,e){o.exports=e.p+"themes/_global/img/table.png"}});
!function(o){function __webpack_require__(e){if(n[e])return n[e].exports;var p=n[e]={i:e,l:!1,exports:{}};return o[e].call(p.exports,p,p.exports,__webpack_require__),p.l=!0,p.exports}var n={};__webpack_require__.m=o,__webpack_require__.c=n,__webpack_require__.i=function(o){return o},__webpack_require__.d=function(o,n,e){__webpack_require__.o(o,n)||Object.defineProperty(o,n,{configurable:!1,enumerable:!0,get:e})},__webpack_require__.n=function(o){var n=o&&o.__esModule?function(){return o.default}:function(){return o};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(o,n){return Object.prototype.hasOwnProperty.call(o,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=242)}({230:function(o,n,e){function webpackContext(o){return e(webpackContextResolve(o))}function webpackContextResolve(o){var n=p[o];if(!(n+1))throw new Error("Cannot find module '"+o+"'.");return n}var p={"./appicon/apple-touch-icon-114.png":245,"./appicon/apple-touch-icon-120.png":246,"./appicon/apple-touch-icon-144.png":247,"./appicon/apple-touch-icon-152.png":248,"./appicon/apple-touch-icon-57.png":249,"./appicon/apple-touch-icon-72.png":250,"./appicon/apple-touch-icon-76.png":251,"./appicon/apple-touch-icon.png":252,"./appicon/favicon.ico":253,"./bg-select.png":254,"./icons/Diaspora-asterisk.svg":255,"./icons/carrot-icon--black.png":256,"./icons/carrot-icon--white.png":257,"./icons/diaspora-icon--black.png":258,"./icons/diaspora-icon--white.png":259,"./icons/scuttle.png":260,"./icons/shaarli.png":261,"./icons/unmark-icon--black.png":262,"./list.png":263,"./logo-square.svg":264,"./logo-w.png":265,"./logo-wallabag.svg":266,"./table.png":267};webpackContext.keys=function(){return Object.keys(p)},webpackContext.resolve=webpackContextResolve,o.exports=webpackContext,webpackContext.id=230},237:function(o,n){},242:function(o,n,e){"use strict";e(237),function(o){o.keys().forEach(o)}(e(230))},245:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-114.png"},246:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-120.png"},247:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-144.png"},248:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-152.png"},249:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-57.png"},250:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-72.png"},251:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon-76.png"},252:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/apple-touch-icon.png"},253:function(o,n,e){o.exports=e.p+"themes/_global/img/appicon/favicon.ico"},254:function(o,n,e){o.exports=e.p+"themes/_global/img/bg-select.png"},255:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/Diaspora-asterisk.svg"},256:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--black.png"},257:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/carrot-icon--white.png"},258:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--black.png"},259:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/diaspora-icon--white.png"},260:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/scuttle.png"},261:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/shaarli.png"},262:function(o,n,e){o.exports=e.p+"themes/_global/img/icons/unmark-icon--black.png"},263:function(o,n,e){o.exports=e.p+"themes/_global/img/list.png"},264:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-square.svg"},265:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-w.png"},266:function(o,n,e){o.exports=e.p+"themes/_global/img/logo-wallabag.svg"},267:function(o,n,e){o.exports=e.p+"themes/_global/img/table.png"}});

View file

@ -1330,6 +1330,15 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=
clipboard@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.4.tgz#836dafd66cf0fea5d71ce5d5b0bf6e958009112d"
integrity sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==
dependencies:
good-listener "^1.2.2"
select "^1.1.2"
tiny-emitter "^2.0.0"
cliui@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@ -1909,6 +1918,11 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
delegate@^3.1.2:
version "3.2.0"
resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166"
integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==
delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
@ -2843,6 +2857,13 @@ globule@^1.0.0:
lodash "~4.17.10"
minimatch "~3.0.2"
good-listener@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"
integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=
dependencies:
delegate "^3.1.2"
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
version "4.1.15"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
@ -5758,6 +5779,11 @@ select-hose@^2.0.0:
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=
select@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"
integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=
selfsigned@^1.9.1:
version "1.10.4"
resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd"
@ -6443,6 +6469,11 @@ timers-browserify@^2.0.4:
dependencies:
setimmediate "^1.0.4"
tiny-emitter@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423"
integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"