Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Dependency List
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 826
    • Issues 826
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 70
    • Merge Requests 70
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Packages
    • Packages
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds FrontendMinds Frontend
  • Merge Requests
  • !374

Open
Opened 2 hours ago by Marcelo Rivera@eiennohi
  • Report abuse
Report abuse

[Sprint/HipsterHedgehog] (feat): ability to copy and paste images into posts and comments

closes minds#553

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.com/eiennohi/front.git sprint/HipsterHedgehog.feat.ability-to-copy-and-paste-images-into-posts-and-comments
git checkout -b eiennohi/front-sprint/HipsterHedgehog.feat.ability-to-copy-and-paste-images-into-posts-and-comments FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff eiennohi/front-sprint/HipsterHedgehog.feat.ability-to-copy-and-paste-images-into-posts-and-comments

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge eiennohi:sprint/HipsterHedgehog.feat.ability-to-copy-and-paste-images-into-posts-and-comments into master
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #67726978 passed for 3d2a29fa on eiennohi:sprint/HipsterHedgehog.feat.ability-to-copy-and-paste-images-into-posts-and-comments
    Requires 2 more approvals from Devs.
    Emiliano Balbuena
    Emiliano Balbuena
    Ben Hayward
    Ben Hayward
    Mark Harding
    Mark Harding
    Martin Santangelo
    Martin Santangelo
    Brian Hatchet
    Brian Hatchet
    Ready to be merged automatically. Ask someone with write access to this repository to merge this request

    Allows commits from members who can merge to the target branch

    Closes minds#553

    Deletes source branch

    • Discussion 3
    • Commits 2
    • Pipelines 1
    • Changes 12
    0/3 discussions resolved
    • Loading...
    • Brian Hatchet
      Brian Hatchet :speech_balloon: @brianhatchet started a discussion on the diff 12 minutes ago
      src/app/common/directives/paste/attachment-paste.directive.ts
      6
      7 private focused: boolean = false;
      8
      9
      10 @HostListener('focus') onFocus() {
      11 this.focused = true;
      12 }
      13
      14 @HostListener('focusout') onFocusOut() {
      15 this.focused = false;
      16 }
      17
      18 @HostListener('window:paste', ['$event']) onPaste(event: ClipboardEvent) {
      19 if (this.focused) {
      20 for (let index in event.clipboardData.items) {
      21 const item: DataTransferItem = event.clipboardData.items[index];
      • Brian Hatchet
        Brian Hatchet :speech_balloon: @brianhatchet · 12 minutes ago
        Maintainer

        This just works from the raw clipboard? We don't need to do any encoding? Sounds both awesome and terrifying.

      Please register or sign in to reply
    • Brian Hatchet
      Brian Hatchet :speech_balloon: @brianhatchet started a discussion on the diff 12 minutes ago
      src/app/modules/comments/poster/poster.component.ts
      134 146 this.triedToPost = false;
      135 file.value = null;
      136 147 this.detectChanges();
      137 148 })
      138 149 .catch(e => {
      139 150 console.error(e);
      140 151 this.canPost = true;
      141 152 this.triedToPost = false;
      142 file.value = null;
      143 153 this.detectChanges();
      144 154 });
      145
      146 this.detectChanges();
      147 155 }
      148 156
      149 157 removeAttachment(file: HTMLInputElement) {
      • Brian Hatchet
        Brian Hatchet :speech_balloon: @brianhatchet · 12 minutes ago
        Maintainer

        Can we name this something more specific like ```fileElement``? My dumb brain keeps reading that as an input stream

      Please register or sign in to reply
    • Brian Hatchet
      Brian Hatchet :speech_balloon: @brianhatchet started a discussion on the diff 12 minutes ago
      src/app/common/directives/paste/attachment-paste.directive.ts
      1 import { Directive, EventEmitter, HostListener, Output } from '@angular/core';
      2
      3 @Directive({ selector: '[m-attachment-paste]' })
      4 export class AttachmentPasteDirective {
      5 @Output('onFilePaste') onFilePaste: EventEmitter<File> = new EventEmitter<File>();
      6
      7 private focused: boolean = false;
      8
      9
      10 @HostListener('focus') onFocus() {
      11 this.focused = true;
      12 }
      13
      • Brian Hatchet
        Brian Hatchet :speech_balloon: @brianhatchet · 12 minutes ago
        Maintainer

        This feels like it should be unit tested and also a total pain in the ass to test.

      Please register or sign in to reply
    • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
    Please register or sign in to reply
    Assignee
    None
    Assign to
    None
    Milestone
    None
    Assign milestone
    None
    Time tracking
    No estimate or time spent
    0
    Labels
    None
    Assign labels
    • View project labels
    Lock merge request
    Unlocked
    6
    6 participants
    user avatar
    Emiliano Balbuena
    user avatar
    Ben Hayward
    user avatar
    Mark Harding
    user avatar
    Martin Santangelo
    user avatar
    Brian Hatchet
    user avatar
    Marcelo Rivera
    Reference: minds/front!374