R64 A1-A6:新员工入门引导
这个提交包含在:
@@ -0,0 +1,48 @@
|
||||
export const ONBOARDING_WELCOME_STORAGE_KEY = "hyb_oa_show_welcome";
|
||||
export const ONBOARDING_ACTIVE_STORAGE_KEY = "hyb_oa_onboarding_active";
|
||||
export const ONBOARDING_DISMISSED_STORAGE_KEY = "hyb_oa_getting_started_dismissed";
|
||||
|
||||
function canUseLocalStorage() {
|
||||
return typeof window !== "undefined" && typeof window.localStorage !== "undefined";
|
||||
}
|
||||
|
||||
export function markOnboardingEntryReady() {
|
||||
if (!canUseLocalStorage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.localStorage.setItem(ONBOARDING_WELCOME_STORAGE_KEY, "1");
|
||||
window.localStorage.setItem(ONBOARDING_ACTIVE_STORAGE_KEY, "1");
|
||||
window.localStorage.removeItem(ONBOARDING_DISMISSED_STORAGE_KEY);
|
||||
}
|
||||
|
||||
export function shouldShowWelcomeDialog() {
|
||||
return canUseLocalStorage() && window.localStorage.getItem(ONBOARDING_WELCOME_STORAGE_KEY) === "1";
|
||||
}
|
||||
|
||||
export function clearWelcomeDialogFlag() {
|
||||
if (!canUseLocalStorage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.localStorage.removeItem(ONBOARDING_WELCOME_STORAGE_KEY);
|
||||
}
|
||||
|
||||
export function shouldShowGettingStartedCard() {
|
||||
if (!canUseLocalStorage()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
window.localStorage.getItem(ONBOARDING_ACTIVE_STORAGE_KEY) === "1" &&
|
||||
window.localStorage.getItem(ONBOARDING_DISMISSED_STORAGE_KEY) !== "1"
|
||||
);
|
||||
}
|
||||
|
||||
export function dismissGettingStartedCard() {
|
||||
if (!canUseLocalStorage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.localStorage.setItem(ONBOARDING_DISMISSED_STORAGE_KEY, "1");
|
||||
}
|
||||
@@ -7,6 +7,12 @@ export const TEST_IDS = {
|
||||
topbar: {
|
||||
profileTrigger: "topbar-profile-trigger",
|
||||
},
|
||||
onboarding: {
|
||||
welcomeDialog: "onboarding-welcome-dialog",
|
||||
welcomeClose: "onboarding-welcome-close",
|
||||
gettingStartedCard: "onboarding-getting-started-card",
|
||||
gettingStartedDismiss: "onboarding-getting-started-dismiss",
|
||||
},
|
||||
workflow: {
|
||||
tasksTable: "workflow-tasks-table",
|
||||
taskRow: "workflow-task-row",
|
||||
|
||||
在新工单中引用
屏蔽一个用户