mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 05:30:01 +00:00
add description
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { BehaviorSubject, ReplaySubject, bufferCount, concat, first, firstValueFrom } from "rxjs";
|
||||
|
||||
import { validate } from "./achievement-processor";
|
||||
import { ItemCreatedProgressEvent } from "./examples/example-achievements";
|
||||
import { itemAdded$, itemUpdated$ } from "./examples/example-events";
|
||||
import { ItemCreatedProgressEvent } from "./examples/achievement-events";
|
||||
import {
|
||||
ItemCreatedAchievement,
|
||||
ItemCreatedProgress,
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
TotallyAttachedAchievement,
|
||||
TotallyAttachedValidator,
|
||||
} from "./examples/example-validators";
|
||||
import { itemAdded$, itemUpdated$ } from "./examples/user-events";
|
||||
import { AchievementEvent } from "./types";
|
||||
|
||||
describe("event-processor", () => {
|
||||
|
||||
@@ -13,6 +13,7 @@ const FiveItemsCreatedAchievement = "five-vault-items-created" as AchievementId;
|
||||
const TotallyAttachedValidator = {
|
||||
achievement: TotallyAttachedAchievement,
|
||||
name: "Totally attached <3",
|
||||
description: "Attached a file to a send or item",
|
||||
metric: ItemCreatedProgress,
|
||||
validator: Type.HasTag,
|
||||
trigger: "once",
|
||||
@@ -35,6 +36,7 @@ const TotallyAttachedValidator = {
|
||||
const ItemCreatedTracker = {
|
||||
achievement: ItemCreatedMetric,
|
||||
name: `[TRACKER] ${ItemCreatedProgress}`,
|
||||
description: `Measures ${ItemCreatedProgress}`,
|
||||
metric: ItemCreatedProgress,
|
||||
validator: Type.Threshold,
|
||||
trigger: { high: 1 },
|
||||
@@ -52,6 +54,7 @@ const ItemCreatedValidator = {
|
||||
achievement: ItemCreatedAchievement,
|
||||
name: "What an item!",
|
||||
metric: ItemCreatedProgress,
|
||||
description: "Add an item to your vault",
|
||||
validator: Type.Threshold,
|
||||
trigger: { high: 1 },
|
||||
hidden: false,
|
||||
@@ -69,6 +72,7 @@ const ItemCreatedValidator = {
|
||||
const ThreeItemsCreatedValidator = {
|
||||
achievement: ThreeItemsCreatedAchievement,
|
||||
name: "Three times a charm",
|
||||
description: "Add three items to your vault",
|
||||
metric: ItemCreatedProgress,
|
||||
validator: Type.Threshold,
|
||||
trigger: { low: 2, high: 3 },
|
||||
@@ -89,6 +93,7 @@ const ThreeItemsCreatedValidator = {
|
||||
const FiveItemsCreatedValidator = {
|
||||
achievement: FiveItemsCreatedAchievement,
|
||||
name: "fiiivvve GoOoOoOolllllllD RIIIIIINGS!!!!!!",
|
||||
description: "Add five items to your vault",
|
||||
metric: ItemCreatedProgress,
|
||||
validator: Type.Threshold,
|
||||
trigger: { low: 4, high: 5 },
|
||||
|
||||
@@ -28,6 +28,9 @@ export type Achievement = {
|
||||
// human-readable name of the achievement
|
||||
name: string;
|
||||
|
||||
// human-readable description of the achievement
|
||||
description?: string;
|
||||
|
||||
// the metric observed by low/high triggers
|
||||
metric?: MetricId;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ItemCreatedProgressEvent } from "./examples/example-achievements";
|
||||
import { ItemCreatedProgressEvent } from "./examples/achievement-events";
|
||||
import { ItemCreatedProgress } from "./examples/example-validators";
|
||||
import { mapProgressByName } from "./util";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user