Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: removed sort and filter tour #638

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion src/discussions/post-comments/comments/CommentsSort.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const CommentSortDropdown = () => {
<>
<div className="comments-sort d-flex justify-content-end mx-4 mt-2">
<Button
id="comment-sort"
alt={intl.formatMessage(messages.actionsAlt)}
ref={setTarget}
variant="tertiary"
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/posts/post-filter-bar/PostFilterBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const PostFilterBar = () => {
cohort: capitalize(selectedCohort?.name),
})}
</span>
<span id="icon-tune">
<span>
<Collapsible.Visible whenClosed>
<Icon src={Tune} />
</Collapsible.Visible>
Expand Down
13 changes: 5 additions & 8 deletions src/discussions/tours/DiscussionsProductTour.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
}, []);

return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!isEmpty(config) && (
<ProductTour
tours={config}
/>
)}
</>
!isEmpty(config) && (
<ProductTour

Check warning on line 21 in src/discussions/tours/DiscussionsProductTour.jsx

View check run for this annotation

Codecov / codecov/patch

src/discussions/tours/DiscussionsProductTour.jsx#L21

Added line #L21 was not covered by tests
tours={config}
/>
)
);
};

Expand Down
23 changes: 10 additions & 13 deletions src/discussions/tours/constants.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import messages from './messages';

/**
*
* @param {Object} intl
* @returns {Object} tour checkpoints
*/
export default function tourCheckpoints(intl) {
return {
NOT_RESPONDED_FILTER: [
EXAMPLE_TOUR: [
{
body: intl.formatMessage(messages.notRespondedFilterTourBody),
placement: 'right',
target: '#icon-tune',
title: intl.formatMessage(messages.notRespondedFilterTourTitle),
},
],
RESPONSE_SORT: [
{
body: intl.formatMessage(messages.responseSortTourBody),
placement: 'left',
target: '#comment-sort',
title: intl.formatMessage(messages.responseSortTourTitle),
title: intl.formatMessage(messages.exampleTourTitle),
body: intl.formatMessage(messages.exampleTourBody),
target: '#example-tour-target',
placement: 'bottom',
},
],
};
Expand Down
26 changes: 8 additions & 18 deletions src/discussions/tours/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,15 @@ const messages = defineMessages({
defaultMessage: 'Okay',
description: 'Action to end current tour',
},
notRespondedFilterTourBody: {
id: 'tour.body.notRespondedFilter',
defaultMessage: 'Now you can filter discussions to find posts with no response.',
description: 'Body of the tour for the not responded filter',
exampleTourTitle: {
id: 'tour.example.title',
defaultMessage: 'Example Tour',
description: 'Title for example tour',
},
notRespondedFilterTourTitle: {
id: 'tour.title.notRespondedFilter',
defaultMessage: 'New filtering option!',
description: 'Title of the tour for the not responded filter',
},
responseSortTourBody: {
id: 'tour.body.responseSortTour',
defaultMessage: 'Responses and comments are now sorted by newest first. Please use this option to change the sort order',
description: 'Body of the tour for the response sort',
},
responseSortTourTitle: {
id: 'tour.title.responseSortTour',
defaultMessage: 'Sort Responses!',
description: 'Title of the tour for the response sort',
exampleTourBody: {
id: 'tour.example.body',
defaultMessage: 'This is an example tour',
description: 'Body for example tour',
},
});

Expand Down
Loading