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

Add a beta warning warning people about the fact we're still in beta. #685

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions frontend/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ export enum MetricEvents {
WaitingListEmailRemoved = 'apmt.signup.email-removed',
}

export enum Dismissibles {
BetaWarning = 'beta-warning'
}

export default {
AlertSchemes,
BookingCalendarView,
Expand Down Expand Up @@ -304,4 +308,5 @@ export default {
TableDataType,
TooltipPosition,
WaitingListAction,
Dismissibles,
};
15 changes: 15 additions & 0 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,21 @@
"shareMyLink": "Share my link",
"reportBug": "Report Bug"
},
"notices": {
"betaWarning": {
"heading": "As we're currently in beta, we do have some issues we're dealing with:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Da wir aktuell in der Beta-Phase sind, hier einige Tips um Probleme zu umgehen:

(As we're currently in beta, here are a few tips to avoid problems) - I think this sounds a bit more positive than "issues"

"list": [
"Please check your spam folder as some emails might end up there",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Überprüfe den Spam Ordner, da einige Emails dort landen könnten

"If Zoom meetings don't appear in your appointment invite, please disconnect and reconnect your zoom account in the {connectedAccounts} section of the settings",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Falls Zoom Meetings nicht in der Kalender-Einladung auftauchen, bitte trenne die Verbindung im {connectedAccounts} Abschnitt der Einstellungen, und stelle sie erneut her

"If you experience other issues, please use the {contactUs} form, or join us on our {matrixChannel}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sollte es noch weitere Probleme geben, nutze das {contactUs}, oder kommt in unseren {matrixChannel}

],
"linkText": {
"connectedAccounts": "Connected Accounts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verbundene Konten

"contactUs": "contact us",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kontaktformular

"matrixChannel": "Matrix Channel"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matrix Kanal

Copy link
Member

@kewisch kewisch Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though you might want to sway away from the technology and say something about it simply being a chat.

With "chat room" it could be

Sollte es noch weitere Probleme geben, nutze das {contactUs}, oder kommt in unseren {matrixChannel}

with matrixChannel = Chat

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've stuck with matrix channel for now.

}
}
},
"placeholder": {
"biWeeklyCafeDates": "Bi-weekly Café Dates…",
"emailAddress": "john.doe{'@'}example.com",
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ export type User = {
uniqueHash: string;
};

/**
* User activity as in the things they do within our application
* Used to store the state of dismissables and such.
*/
export type UserActivity = {
dismissedBetaWarning: boolean,
};

export type Subscriber = {
id?: number;
username: string;
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/stores/user-activity-store.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a short comment about what "user activity" is? Like what can I expect is stored here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep no worries. It's mostly to store the state of UI elements that are dismissed or minimized and we want that data to stick. I'll add a comment!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineStore } from 'pinia';
import { UserActivity } from '@/models';
import { useLocalStorage } from '@vueuse/core';
import { Dismissibles } from '@/definitions';

const initialUserActivityObject = {
dismissedBetaWarning: false,
} as UserActivity;

export const useUserActivityStore = defineStore('user-activity', () => {
const data = useLocalStorage('tba/user-activity', initialUserActivityObject);

const dismiss = (dismissible: Dismissibles) => {
if (dismissible === Dismissibles.BetaWarning) {
data.value.dismissedBetaWarning = true;
}
};

return { dismiss, data };
});
90 changes: 89 additions & 1 deletion frontend/src/views/ScheduleView.vue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I forgot we already had the NoticeBar component 👏🏻

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {
BookingCalendarView,
DateFormatStrings,
DEFAULT_SLOT_DURATION,
DEFAULT_SLOT_DURATION, Dismissibles,
EventLocationType,
MeetingLinkProviderType,
} from '@/definitions';
Expand All @@ -23,10 +23,13 @@ import {
} from '@/models';
import ScheduleCreation from '@/components/ScheduleCreation.vue';
import CalendarQalendar from '@/components/CalendarQalendar.vue';
import NoticeBar from '@/tbpro/elements/NoticeBar.vue';
import PrimaryButton from '@/tbpro/elements/PrimaryButton.vue';

// stores
import { useAppointmentStore } from '@/stores/appointment-store';
import { useCalendarStore } from '@/stores/calendar-store';
import { useUserActivityStore } from '@/stores/user-activity-store';

const { t } = useI18n();
const route = useRoute();
Expand All @@ -36,8 +39,10 @@ const refresh = inject(refreshKey);

const appointmentStore = useAppointmentStore();
const calendarStore = useCalendarStore();
const userActivityStore = useUserActivityStore();
const { pendingAppointments } = storeToRefs(appointmentStore);
const { connectedCalendars } = storeToRefs(calendarStore);
const { data: userActivityData } = storeToRefs(userActivityStore);

// current selected date, if not in route: defaults to now
const activeDate = ref(route.params.date ? dj(route.params.date as string) : dj());
Expand Down Expand Up @@ -146,9 +151,43 @@ onMounted(async () => {
const eventsTo = dj(activeDate.value).endOf('month').format('YYYY-MM-DD');
await getRemoteEvents(eventsFrom, eventsTo);
});

const dismiss = () => {
userActivityStore.dismiss(Dismissibles.BetaWarning);
};
</script>

<template>
<notice-bar type="info" id="beta-warning" v-if="!userActivityData.dismissedBetaWarning">
<p>{{ t('notices.betaWarning.heading') }}</p>
<ul>
<li>{{ t('notices.betaWarning.list.0') }}</li>
<li>
<i18n-t keypath="notices.betaWarning.list.1">
<template v-slot:connectedAccounts>
<router-link class="underline" :to="{ path: '/settings/connectedAccounts' }" target="_blank">
{{ t('notices.betaWarning.linkText.connectedAccounts') }}
</router-link>
</template>
</i18n-t>
</li>
<li>
<i18n-t keypath="notices.betaWarning.list.2">
<template v-slot:contactUs>
<router-link class="underline" :to="{ name: 'contact' }" target="_blank">
{{ t('notices.betaWarning.linkText.contactUs') }}
</router-link>
</template>
<template v-slot:matrixChannel>
<a class="underline" href="https://matrix.to/#/#tb-services:mozilla.org" target="_blank">
{{ t('notices.betaWarning.linkText.matrixChannel') }}
</a>
</template>
</i18n-t>
</li>
</ul>
<primary-button class="dismiss" size="small" @click="dismiss">Dismiss</primary-button>
</notice-bar>
<!-- page title area -->
<div class="flex select-none flex-col items-start justify-between lg:flex-row">
<div class="text-4xl font-light">{{ t('label.dashboard') }}</div>
Expand Down Expand Up @@ -180,3 +219,52 @@ onMounted(async () => {
/>
</div>
</template>
<style scoped>
@import '@/assets/styles/custom-media.pcss';

#beta-warning {
position: relative;
/* The navbar provides margin already */
margin: 0 0 2rem;

:deep(.icon) {
top: 0.75rem;
}

:deep(.body) {
text-align: left;
margin-left: 0.5rem;
line-height: 1.5;

a {
text-decoration: underline;
}

ul {
list-style: circle;
margin-left: 1rem;
font-weight: 400;
}

.dismiss {
margin: 1rem auto;
}
}
}

@media (--md) {
#beta-warning {
position: relative;
margin: 0 1rem 2rem;

:deep(.body) {
.dismiss {
position: absolute;
top: 0.75rem;
right: 1rem;
margin: 0;
}
}
}
}
</style>