copy to clipboard ok

This commit is contained in:
Baptiste Lemoine 2020-01-16 12:00:39 +01:00
parent 7c64f1f8f0
commit 4098f7ec5c
8 changed files with 65 additions and 6 deletions

View File

@ -27,6 +27,7 @@
"@ngx-translate/http-loader": "^4.0.0",
"chart.js": "^2.8.0",
"font-awesome": "^4.7.0",
"ngx-clipboard": "^12.3.0",
"ngx-markdown": "^8.2.1",
"ngx-toaster": "^1.0.1",
"primeicons": "^2.0.0",

View File

@ -44,10 +44,12 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ConfigService} from "./services/config.service";
import {PollService} from "./services/poll.service";
import {ToastModule} from 'primeng/toast';
import {MessageService} from "primeng";
import {MessageModule, MessageService} from "primeng";
import {PollDisplayComponent} from './pages/poll-display/poll-display.component';
import {VotingComponent} from './pages/voting/voting.component';
import { VotingCommentComponent } from './pages/voting/voting-comment/voting-comment.component';
import {VotingCommentComponent} from './pages/voting/voting-comment/voting-comment.component';
import {ResettableInputDirective} from './ui/directives/resettable-input.directive';
import {ClipboardModule} from "ngx-clipboard";
export class MyMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) {
@ -89,14 +91,17 @@ export function HttpLoaderFactory(http: HttpClient) {
PollDisplayComponent,
VotingComponent,
VotingCommentComponent,
ResettableInputDirective,
],
imports: [
ClipboardModule,
CommonModule,
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
ToastModule,
MessageModule,
MarkdownModule.forRoot(),
TranslateModule.forRoot({
missingTranslationHandler: {

View File

@ -17,11 +17,15 @@
</p>
<p>
Pour accéder au sondage et à tous ses paramètres : {{config.urlAdmin}}
Pour accéder au sondage et à tous ses paramètres :
<a href="{{config.urlAdmin}}">{{config.urlAdmin}}
</a>
</p>
<button
class="btn"
(click)="copyLink(config.urlAdmin)"
[ngxClipboard]
cbContent="{{config.urlAdmin}}"
>
<i class="fa fa-copy"></i>
Copier le lien
@ -40,11 +44,16 @@
<h2 i18n>{{"resume.users"|translate}}</h2>
<p>
Pour accéder au sondage : {{config.urlPublic}}
Pour accéder au sondage :
<a href="{{config.urlPublic}}">{{config.urlPublic}}
</a>
</p>
<button
class="btn"
(click)="copyLink(config.urlPublic)"
[ngxClipboard]
cbContent="{{config.urlPublic}}"
>
<i class="fa fa-copy"></i>
Copier le lien
@ -79,3 +88,4 @@
</a>
</section>

View File

@ -0,0 +1,5 @@
:host {
button {
margin-right: 1em;
}
}

View File

@ -2,6 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {BaseComponent} from '../base-page/base.component';
import {HttpClient} from '@angular/common/http';
import {ConfigService} from "../../services/config.service";
import {MessageService} from 'primeng/api';
@Component({
selector: 'framadate-end-confirmation',
@ -11,7 +12,10 @@ import {ConfigService} from "../../services/config.service";
export class EndConfirmationComponent extends BaseComponent implements OnInit {
mailToRecieve = '';
constructor(public config: ConfigService, public http: HttpClient) {
constructor(public config: ConfigService,
public http: HttpClient,
private messageService: MessageService
) {
super(config);
this.mailToRecieve = this.config.myEmail;
}
@ -20,7 +24,7 @@ export class EndConfirmationComponent extends BaseComponent implements OnInit {
}
copyLink(str: any) {
this.messageService.add({severity: 'success', summary: 'Service Message', detail: 'Via MessageService'});
}
sendToEmail() {

View File

@ -0,0 +1,8 @@
import { ResettableInputDirective } from './resettable-input.directive';
describe('ResettableInputDirective', () => {
it('should create an instance', () => {
const directive = new ResettableInputDirective();
expect(directive).toBeTruthy();
});
});

View File

@ -0,0 +1,11 @@
import {Directive} from '@angular/core';
@Directive({
selector: '[framadateResettableInput]'
})
export class ResettableInputDirective {
constructor() {
}
}

View File

@ -5304,6 +5304,14 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
ngx-clipboard@^12.3.0:
version "12.3.0"
resolved "https://registry.yarnpkg.com/ngx-clipboard/-/ngx-clipboard-12.3.0.tgz#8e61a894ff57249db64b733d26f9a0b98c08829f"
integrity sha512-ToSsuDv9I1L0g+TcthePcZ4B859/MpoarlHVr2KnHWy3pR8SxfJlNyP2i9STYRQkJ5bSEg65RFErW4tx52lHYQ==
dependencies:
ngx-window-token "^2.0.0"
tslib "^1.9.0"
ngx-markdown@^8.2.1:
version "8.2.1"
resolved "https://registry.yarnpkg.com/ngx-markdown/-/ngx-markdown-8.2.1.tgz#53bafde382aa69ae6787abf0d72bf63bc028105a"
@ -5320,6 +5328,13 @@ ngx-toaster@^1.0.1:
resolved "https://registry.yarnpkg.com/ngx-toaster/-/ngx-toaster-1.0.1.tgz#ee54f83bcbe3da26210097baac08445952899515"
integrity sha1-7lT4O8vj2iYhAJe6rAhEWVKJlRU=
ngx-window-token@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ngx-window-token/-/ngx-window-token-2.0.1.tgz#8f91221af4116aa9f49bb3f7a6f1111639884fba"
integrity sha512-rvqdqJEfnWXQFU5fyfYt06E10tR/UtFOYdF3QebfcOh5VIJhnTKiprX8e4B9OrX7WEVFm9BT8uV72xXcEgsaKA==
dependencies:
tslib "^1.9.0"
nice-try@^1.0.4:
version "1.0.5"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"