Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion app/context/Auth/getSyncServer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const isDev = !import.meta.env.PROD
const devPort = (import.meta.env.VITE_SYNC_SERVER_PORT as string) ?? "3030"
console.log("devPort", devPort)

const httpProtocol = isDev ? "http:" : "https:"
const wsProtocol = isDev ? "ws:" : "wss:"
Expand Down
116 changes: 58 additions & 58 deletions app/data/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,72 @@ import { Project } from "schema/Project"
import tailwindColors from "tailwindcss/colors"

const projectList = `
Business: Contracts yes Contract negotiation & other back-and-forth
Business: Marketing Work on DevResults.com, writing blogs, creating materials, etc.
Business: Outreach sometimes Conferences, coffee, donuts, cold calls, etc
Business: Proposals yes Writing/editing proposals for specific prospects
DevOps: Azure migration
DevOps: CI configuration
DevOps: General Non-project-oriented DevOps work: server/VM/database configuration, etc.
Feature: Activity-Specific Stuff
Feature: Ag Grid conversions
Feature: API
Feature: Baselines
Feature: ContentObject Validation
Feature: Count First/Last
Feature: Count Unique Per Reporting Period
Feature: Dashboard
Feature: Data Tables
Feature: DevIndicators
Feature: Diagnostics
Feature: Dropbox integration
Feature: EditGrid
Feature: Enterprise
Feature: Frameworks Index 2022-S01 etc
Feature: GDPR
Feature: Google Drive integration
Feature: Ground Truth
Feature: IATI
Feature: Indexify
Feature: Instance Export
Feature: Internal Tooling Includes instance bootstrapper features, DevResults CLI, etc.
Feature: Localization Includes managing LanguageStrings, getting translations, etc.
Feature: Matrix
Feature: Metadata visualization
Feature: Notifications
Feature: Partner Permissions 2022 sprint 8 and associated work
Feature: PowerBI
Feature: Project X
Feature: Pseudonyms
Feature: Public Site
Feature: RDTs
Feature: Self-serve
Feature: Single Sign-On , and supporting clients
Feature: Standard RP Picker
Feature: Survey123
Feature: SurveyCTO
Feature: Too small to name But you can name it in the comments!
Feature: WorldAdminDivisions update
Business:Contracts yes Contract negotiation & other back-and-forth
Business:Marketing Work on DevResults.com, writing blogs, creating materials, etc.
Business:Outreach sometimes Conferences, coffee, donuts, cold calls, etc
Business:Proposals yes Writing/editing proposals for specific prospects
DevOps:Azure migration
DevOps:CI configuration
DevOps:General Non-project-oriented DevOps work:server/VM/database configuration, etc.
Feature:Activity-Specific Stuff
Feature:Ag Grid conversions
Feature:API
Feature:Baselines
Feature:ContentObject Validation
Feature:Count First-Last
Feature:Count Unique Per Reporting Period
Feature:Dashboard
Feature:Data Tables
Feature:DevIndicators
Feature:Diagnostics
Feature:Dropbox integration
Feature:EditGrid
Feature:Enterprise
Feature:Frameworks Index 2022-S01 etc
Feature:GDPR
Feature:Google Drive integration
Feature:Ground Truth
Feature:IATI
Feature:Indexify
Feature:Instance Export
Feature:Internal Tooling Includes instance bootstrapper features, DevResults CLI, etc.
Feature:Localization Includes managing LanguageStrings, getting translations, etc.
Feature:Matrix
Feature:Metadata visualization
Feature:Notifications
Feature:Partner Permissions 2022 sprint 8 and associated work
Feature:PowerBI
Feature:Project X
Feature:Pseudonyms
Feature:Public Site
Feature:RDTs
Feature:Self-serve
Feature:Single Sign-On , and supporting clients
Feature:Standard RP Picker
Feature:Survey123
Feature:SurveyCTO
Feature:Too small to name But you can name it in the comments!
Feature:WorldAdminDivisions update
Out
Overhead General meetings, company process stuff, finance stuff, HR, onboarding, learning…
Security All things security
Support: API mostly Any help provided to helping users access and use the API
Support: External tooling Providing support for "other tools" outside of DevResults (e.g. PowerBI)
Support: Ongoing mostly Includes engineering support to individual clients (but not bug fixing)
Support: Scaling training & help Videos, help materials, etc.
Support: Setup yes Everything before the instance goes live
Support: Training sometimes Training dedicated to one specific client
Tech wealth: Bug fixin Probably mostly on call. Note feature in comments if it's a major feature fix.
Tech wealth: Other Catch-all for general improvements to the codebase
Tech wealth: Optimization Work to improve performance within the app
Tech wealth: TypeScript
Tech wealth: Webpack
Support:API mostly Any help provided to helping users access and use the API
Support:External tooling Providing support for "other tools" outside of DevResults (e.g. PowerBI)
Support:Ongoing mostly Includes engineering support to individual clients (but not bug fixing)
Support:Scaling training & help Videos, help materials, etc.
Support:Setup yes Everything before the instance goes live
Support:Training sometimes Training dedicated to one specific client
Tech wealth:Bug fixin Probably mostly on call. Note feature in comments if it's a major feature fix.
Tech wealth:Other Catch-all for general improvements to the codebase
Tech wealth:Optimization Work to improve performance within the app
Tech wealth:TypeScript
Tech wealth:Webpack
Thought Leadership `
.trim()
.split("\n")
.map(line => {
const [fullCode, requiresClient, description] = line.trim().split("\t")
const [code, subCode] = fullCode.split(/:\s+/).map(s => s.trim().replaceAll(" ", "-"))
const [code, subCode] = fullCode.split(/:\s*/).map(s => s.trim().replaceAll(" ", "-"))
return {
code,
subCode,
Expand Down
10 changes: 3 additions & 7 deletions app/lib/by.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
* ```
*/
export const by =
<T extends Record<K, ConvertibleToString>, K extends keyof T>(key: K) =>
<T, K extends keyof T>(key: K) =>
(a: T, b: T) => {
const aVal = a[key].toString() ?? ""
const bVal = b[key].toString() ?? ""
const aVal = String(a[key])
const bVal = String(b[key])
return aVal.localeCompare(bVal)
}

type ConvertibleToString = {
toString(): string
}
6 changes: 3 additions & 3 deletions app/lib/test/TimeEntryView.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("TimeEntryView", () => {
},
"description": "",
"duration": 390,
"input": "Feature:Metadata-visualization 390mins",
"input": "6:30 #Feature:Metadata-visualization",
"project": {
"code": "Feature",
"color": "#f59e0b",
Expand All @@ -63,7 +63,7 @@ describe("TimeEntryView", () => {
},
"description": "",
"duration": 30,
"input": "Feature:DevIndicators 30mins",
"input": "0:30 #Feature:DevIndicators",
"project": {
"code": "Feature",
"color": "#f59e0b",
Expand Down Expand Up @@ -109,7 +109,7 @@ describe("TimeEntryView", () => {
},
"description": "",
"duration": 360,
"input": "Support:Ongoing 360mins",
"input": "6:00 #Support:Ongoing",
"project": {
"code": "Support",
"color": "#10b981",
Expand Down
84 changes: 84 additions & 0 deletions app/lib/test/findAutocompleteQuery.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { describe, expect, test } from "vitest"
import {
findAutocompleteQuery,
type AutocompleteState,
type AutocompleteTrigger,
} from "ui/AutocompleteMenu"
import { assert } from "lib/assert"

const autocompleteTriggers: AutocompleteTrigger[] = [
{ type: "PROJECT", trigger: "#" },
{ type: "CLIENT", trigger: "@" },
] as const

// the `|` character represents the cursor position
const cases: TestCase[] = [
{
name: "@ trigger at end of word",
input: "#support @usaid|",
expected: { trigger: "@", query: "usaid", start: 9, end: 15 },
},
{
name: "# trigger at end of word",
input: "#support|",
expected: { trigger: "#", query: "support", start: 0, end: 8 },
},
{
name: "trigger in middle of word",
input: "#support @usa|id pizza",
expected: { trigger: "@", query: "usaid", start: 9, end: 15 },
},
{
name: "trigger at start of word",
input: "#support |@usaid pizza",
expected: { trigger: "@", query: "usaid", start: 9, end: 15 },
},
{
name: "cursor not in trigger word",
input: "he|llo @usaid",
expected: undefined,
},
{
name: "empty string",
input: "|",
expected: undefined,
},
{
name: "spaces around trigger word",
input: " @us|aid ",
expected: { trigger: "@", query: "usaid", start: 3, end: 9 },
},
]

/**
* Takes a string containing a cursor marker `|` and returns the text without the cursor marker
* along with the position of the cursor
*/
const extractCursor = (text: string): { text: string; position: number } => {
const position = text.indexOf("|")
if (position === -1) throw new Error("No cursor marker found in test input")
return {
text: text.replace("|", ""),
position,
}
}

describe("findAutocompleteTriggerAtCursor", () => {
test.each(cases)("$name", ({ input, expected }) => {
const { text, position } = extractCursor(input)
const result = findAutocompleteQuery(text, position, autocompleteTriggers)
if (expected === undefined) {
expect(result).toBeUndefined()
} else {
assert(result !== undefined)
const { trigger, query, start, end } = result
expect({ trigger, query, start, end }).toEqual(expected)
}
})
})

type TestCase = {
name: string
input: string // includes `|` marker
expected: Pick<AutocompleteState, "trigger" | "query" | "start" | "end"> | undefined
}
2 changes: 1 addition & 1 deletion app/schema/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Project extends S.Class<Project>("Project")({
}

export const makeFullCode = (code: string, subCode?: string) =>
subCode ? `${code}: ${subCode}` : code
subCode ? `${code}:${subCode}` : code

export type ProjectEncoded = typeof Project.Encoded
/**
Expand Down
4 changes: 2 additions & 2 deletions app/schema/lib/parseProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export const parseProject = (input: string) =>
class MultipleProjectsError //
extends Data.TaggedError("parseProject/MultipleProjects")<{ input: string }>
{
message = `An entry can only have one #project code.`
message = `An entry can only have one project code.`
}

export class NoProjectError //
extends Data.TaggedError("parseProject/NoProject")<{ input: string }>
{
message = `You need to include a #project code.`
message = `You need to include a project code.`
}
2 changes: 1 addition & 1 deletion app/schema/lib/parseTimeEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ export class ProjectRequiresClientError //
project: Project
}>
{
message = `For ${this.project.fullCode}, you need to specify a @client`
message = `For ${this.project.fullCode}, you need to specify a client`
}
Loading
Loading