Skip to content

Commit

Permalink
Dismiss tour from overlay (#2525) (#2531)
Browse files Browse the repository at this point in the history
* Shows "(Deleted User)" instead of UUID when user not found (#2354) (#2465)

* Shows "(Deleted User)" instead of long, unreadable UUID in case the user is not found

In case a user is not found, at present unreadable and long UUIDs are shown which kill the look and feel of the application. This patch replaces the UUID with a more explanatory string.

* Update server/services/store/mattermostauthlayer/mattermostauthlayer.go

Co-authored-by: Doug Lauder <[email protected]>
(cherry picked from commit 6881918)

Co-authored-by: Akshay Vasudeva Rao <[email protected]>

* Update CHANGELOG.md for v0.15

Added one more merged PR to the list

* Added ability to dismiss tour from overlay

* GH-2212 - Update global link on board (#2492) (#2495)

(cherry picked from commit 49df41f)

Co-authored-by: Asaad Mahmood <[email protected]>

* GH-2387 - Fixing link in comments (#2480) (#2498)

(cherry picked from commit 5e2cf0b)

Co-authored-by: Asaad Mahmood <[email protected]>

* Addead feature to start product tour on using the welcome template (#2468)

* Fixed a bug where images of the welcome board were not copied over. (#2453)

* Fixed a buig where images of welcome board were not copied over

* Lint fixes

* Fixed test

* Fixed test

* Fixed intended behavio

* lint fixes

* Fixed tests

* Fixed tests

Co-authored-by: Mattermost Build <[email protected]>
Co-authored-by: Akshay Vasudeva Rao <[email protected]>
Co-authored-by: Winson Wu <[email protected]>
Co-authored-by: Asaad Mahmood <[email protected]>
Co-authored-by: Mattermod <[email protected]>
(cherry picked from commit a53e947)

Co-authored-by: Harshil Sharma <[email protected]>
  • Loading branch information
mattermost-build and harshilsharma63 authored Mar 11, 2022
1 parent f0ddb87 commit 46c96e8
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 6 deletions.
1 change: 1 addition & 0 deletions webapp/src/components/cardDialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('components/cardDialog', () => {
cards: {
[card.id]: card,
},
current: card.id,
},
boards: {
boards: {
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/centerPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('components/centerPanel', () => {
cards: {
templates: [card1, card2],
cards: [card1, card2],
current: card1.id,
},
views: {
views: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
import React, {useEffect} from 'react'

import {FormattedMessage} from 'react-intl'

Expand All @@ -10,8 +10,21 @@ import './add_properties.scss'
import {Utils} from '../../../utils'
import addProperty from '../../../../static/addProperty.gif'

import {CardTourSteps, TOUR_CARD} from '../index'
import {BaseTourSteps, CardTourSteps, TOUR_BASE, TOUR_CARD} from '../index'
import TourTipRenderer from '../tourTipRenderer/tourTipRenderer'
import {OnboardingBoardTitle, OnboardingCardTitle} from '../../cardDetail/cardDetail'
import {useAppDispatch, useAppSelector} from '../../../store/hooks'
import {
getMe,
getOnboardingTourCategory,
getOnboardingTourStarted,
getOnboardingTourStep,
patchProps,
} from '../../../store/users'
import {IUser, UserConfigPatch, UserPropPrefix} from '../../../user'
import mutator from '../../../mutator'
import {getCurrentBoard} from '../../../store/boards'
import {getCurrentCard} from '../../../store/cards'

const AddPropertiesTourStep = (): JSX.Element | null => {
const title = (
Expand All @@ -29,6 +42,53 @@ const AddPropertiesTourStep = (): JSX.Element | null => {

const punchout = useMeasurePunchouts(['.octo-propertyname.add-property'], [])

const me = useAppSelector<IUser|null>(getMe)
const dispatch = useAppDispatch()

const board = useAppSelector(getCurrentBoard)
const isOnboardingBoard = board ? board.title === OnboardingBoardTitle : false

const card = useAppSelector(getCurrentCard)
const isOnboardingCard = card ? card.title === OnboardingCardTitle : false

const onboardingTourStarted = useAppSelector(getOnboardingTourStarted)
const onboardingTourCategory = useAppSelector(getOnboardingTourCategory)
const onboardingTourStep = useAppSelector(getOnboardingTourStep)

// start the card tour if onboarding card is opened up
// and the user is still on the base tour
useEffect(() => {
async function task() {
if (!me || !card) {
return
}

const should = card.id &&
isOnboardingBoard &&
isOnboardingCard &&
onboardingTourStarted &&
onboardingTourCategory === TOUR_BASE &&
onboardingTourStep === BaseTourSteps.OPEN_A_CARD.toString()

if (!should) {
return
}

const patch: UserConfigPatch = {}
patch.updatedFields = {}
patch.updatedFields[UserPropPrefix + 'tourCategory'] = TOUR_CARD
patch.updatedFields[UserPropPrefix + 'onboardingTourStep'] = CardTourSteps.ADD_PROPERTIES.toString()

const updatedProps = await mutator.patchUserConfig(me.id, patch)
if (updatedProps) {
dispatch(patchProps(updatedProps))
}
}

// this hack is needed to allow performing async task in useEffect
task()
}, [card])

return (
<TourTipRenderer
key='AddPropertiesTourStep'
Expand Down
5 changes: 1 addition & 4 deletions webapp/src/components/pulsating_dot/pulsating_dot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
align-items: center;
justify-content: center;
margin-left: auto;

&-clickable {
cursor: pointer;
}
cursor: pointer;

&,
&::before,
Expand Down

0 comments on commit 46c96e8

Please sign in to comment.