Skip to content

Commit

Permalink
feat: removed sort and filter tour (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
awais-ansari authored Jan 9, 2024
1 parent ee61d1c commit 035d766
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 41 deletions.
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 @@ const DiscussionsProductTour = () => {
}, []);

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

0 comments on commit 035d766

Please sign in to comment.