36 Commits

Author SHA1 Message Date
mattwr18
c8c71a52c6 Follow @Tirokk PR review suggestions
- Favor lowercase for words in a sentence after the first
- Use exclamation marks for successful actions that use a toastr
- place events at the end of the list on components
- place class above events
- it would be nice to come to a consensus based on best practices, like
  I had a doubt and places the class definition below the props, is that
what others do?
2020-01-31 13:09:37 +01:00
mattwr18
853ff9b92b Stub component, rename component, refactor
- We need to stub the Editor since it throws difficult to interpret
  errors about view.root.getSelection, but we want to stub it's methods
as well, so that we don't need a guard clause just for tests.

- CommentForm is already multiword
- Favor update over result for Vue apollo smart queries
2020-01-23 14:03:14 +01:00
mattwr18
d15037607c Add component test for direct reply to comment
- we have found it challenging to add component tests that mount the
  tiptap editor, so we are stubbing it, which means that we will add e2e
tests to up the coverage of how much of the workflow has automated tests
2020-01-23 13:05:36 +01:00
Alexander Friedland
9776efe760
Merge branch 'master' into 1680-Direct_answer_on_Comment 2020-01-22 11:46:04 +01:00
ogerly
21fa211e0c test: specs not ok, lint is ok 2020-01-22 11:31:23 +01:00
ogerly
00c0397919 test: specs is not ok 2020-01-22 11:25:44 +01:00
ogerly
73b005a900 test: added some test 2020-01-20 11:18:35 +01:00
mattwr18
fdf00fc0c6 Follow @alina-beck's PR review suggestions
- Update styling
- Avoid nested tags
- Rename components with two names
- Add story

- Co-authored-by: Alina Beck <alina.beck@mail.com>
2020-01-20 10:04:30 +01:00
mattwr18
6877c9da91 Use new base-button, rename CSS class 2020-01-16 12:29:28 +01:00
ogerly
8edb551c15 ready to be merged or rebased 2020-01-15 07:40:01 +01:00
ogerly
9d09dae2f4 slug from editor comands set 2020-01-14 18:36:35 +01:00
ogerly
223d1ca3c0 remove console 2020-01-07 06:02:19 +01:00
ogerly
9aa680ce50 Fix lint 2020-01-07 05:40:09 +01:00
ogerly
28839ee2b4 click on 'answered' to put the username of the respective comment into the editor as a mention. 2020-01-06 18:02:46 +01:00
ogerly
490fb7fdeb first example dynamisch usermention for answer comments 2019-12-21 22:11:38 +01:00
Moriz Wahl
3b49744b51 directory created a path names changed 2019-11-27 14:28:57 +01:00
Alina Beck
77f4810ddc set up global localVue
by setting up localVue with all required plugins (such as styleguide and vuex)
in a separate testSetup file we can avoid doing this individually in all component tests
the testSetup is executed before each test suite, so each test file gets a fresh
instance of localVue
2019-11-20 12:31:40 +03:00
Alina Beck
4e6572a042 replace ds-icon with base-icon 2019-11-19 12:26:07 +03:00
mattwr18
6d1044d292 Hide new CommentForm while editing a comment 2019-10-21 16:08:01 +02:00
Alina Beck
a306b9cf4b use constants, truncate only comments with more than 300 characters 2019-10-16 13:56:57 +03:00
roschaefer
6a50ef6134 fix: storybook story of Comment.vue
This is the best solution that I can think of right now. Sure, it's not
so great to pass a property down from the page component. But at least
it fixes the storybook story, which is something.
2019-10-16 01:14:32 +02:00
Alina Beck
2090e3939b add $route mock to Comment and CommentList spec 2019-10-15 16:07:09 +03:00
Alina Beck
202da2a67c remove unused css 2019-10-15 15:47:24 +03:00
Alina Beck
134cea4e47 expand targeted comment by default 2019-10-15 15:44:22 +03:00
Alina Beck
597ca3029f improve html and css for collapse-button 2019-10-15 15:07:30 +03:00
Alina Beck
6318ced7a0 refactor comment component to just use one content viewer 2019-10-15 14:52:02 +03:00
Alina Beck
cd9f2633d7 highlight comment targeted in anchor link 2019-10-15 12:09:01 +03:00
roschaefer
3912b21ea2 refactor: use named slot for additional text
@mattwr18 I can see odd behaviour of the EDITED marker on mobile: The
text would just overlap.

The current behaviour has its flaws, e.g. if you have a long text it
won't wrap but overflow the comment card. But putting the additional
text into a named slot is certainly better than adding some nodes next
to the `<hc-user>` component.
2019-10-04 01:00:31 +02:00
mattwr18
a5e3c52e1d Show that a Post/Comment has been edited 2019-10-03 12:01:04 +02:00
roschaefer
08e73747bd refactor: set global defaults of vue-scrollto 2019-10-01 17:51:16 +02:00
roschaefer
db1bcdd3d2 refactor: register vue-scrollto in nuxt.config.js
This will allow us to use this.$scrollTo in components. I'm now also
using this in the mixin. With so many `this`s it gets horribly
difficult to properly test the mixin in isolation. So I decided to test
the mixin on the component directly.
2019-10-01 17:25:28 +02:00
roschaefer
9da40c4895 fix: avoid many scrollTo calls for n components
Thank you @vbelolapotkov for pointing out the flaws here:
https://github.com/Human-Connection/Human-Connection/pull/1756#discussion_r329361572

So here is my attempt to fix it:
* Install `vue-scrollto` which relies on `requestAnimationFrame`
  - apparently this is better on Safari and IE? 🤔
  - Mocking out entire modules is easier in jest:
    https://jestjs.io/docs/en/bypassing-module-mocks
* Require `checkAnchor` to be implemented on the component
2019-10-01 11:55:18 +02:00
Vasily Belolapotkov
2c705a8680 sync with master to resolve merge conflicts 2019-09-29 20:33:39 +03:00
mattwr18
0f40df7cb4 Fix bug UpdateComment, Fix styling on Comment
- There was a bug that updates to comments were not being displayed
because of a v-show... https://vuejs.org/v2/guide/conditional.html#v-if-vs-v-show
Basically, what it says that is important for this bug is
"v-if...ensures that event listeners and child components inside the
conditional block are properly destroyed and re-created during toggles"

- Since we are using the editor to display comments in ContentViewer, we
need to set the min-height to 0px

- Co-authored-by: Alina Beck <alina.beck@mail.com>
- Co-authored-by: Robert Schäfer <git@roschaefer.de>
2019-09-25 13:39:18 +02:00
mattwr18
766c670269 Fix import path 2019-09-25 08:26:24 +02:00
mattwr18
ee99673cec Add Comment story, add spacing above user info 2019-09-25 08:26:24 +02:00