Skip to content

Commit dfcaf0d

Browse files
authored
Make example project slightly more realistic (#2268)
1 parent 9d47e7e commit dfcaf0d

3 files changed

Lines changed: 295 additions & 163 deletions

File tree

backend/FwLite/LcmCrdt/CrdtProjectsService.cs

Lines changed: 1 addition & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public record CreateProjectRequest(
127127

128128
public async Task<CrdtProject> CreateExampleProject(string name)
129129
{
130-
return await CreateProject(new(name, name, AfterCreate: SampleProjectData, SeedNewProjectData: true, Role: UserProjectRole.Manager));
130+
return await CreateProject(new(name, name, AfterCreate: ExampleProjectData.Seed, SeedNewProjectData: true, Role: UserProjectRole.Manager));
131131
}
132132

133133
public virtual async Task<CrdtProject> CreateProject(CreateProjectRequest request)
@@ -254,159 +254,4 @@ internal static async Task SeedSystemData(DataModel dataModel, Guid clientId)
254254

255255
[GeneratedRegex("^[a-zA-Z0-9][a-zA-Z0-9-_]+$")]
256256
public static partial Regex ProjectCode();
257-
258-
public static async Task SampleProjectData(IServiceProvider provider, CrdtProject project)
259-
{
260-
var lexboxApi = provider.GetRequiredService<IMiniLcmApi>();
261-
await lexboxApi.CreateWritingSystem(new()
262-
{
263-
Id = Guid.NewGuid(),
264-
Type = WritingSystemType.Vernacular,
265-
WsId = "de",
266-
Name = "German",
267-
Abbreviation = "de",
268-
Font = "Arial",
269-
Exemplars = WritingSystem.LatinExemplars
270-
});
271-
272-
await lexboxApi.CreateWritingSystem(new()
273-
{
274-
Id = Guid.NewGuid(),
275-
Type = WritingSystemType.Vernacular,
276-
WsId = "en",
277-
Name = "English",
278-
Abbreviation = "en",
279-
Font = "Arial",
280-
Exemplars = WritingSystem.LatinExemplars
281-
});
282-
283-
await lexboxApi.CreateWritingSystem(new()
284-
{
285-
Id = Guid.NewGuid(),
286-
Type = WritingSystemType.Vernacular,
287-
WsId = "en-Zxxx-x-audio",
288-
Name = "English (A)",
289-
Abbreviation = "Eng 🔊",
290-
Font = "Arial",
291-
Exemplars = WritingSystem.LatinExemplars
292-
});
293-
294-
await lexboxApi.CreateWritingSystem(new()
295-
{
296-
Id = Guid.NewGuid(),
297-
Type = WritingSystemType.Analysis,
298-
WsId = "en",
299-
Name = "English",
300-
Abbreviation = "en",
301-
Font = "Arial",
302-
Exemplars = WritingSystem.LatinExemplars
303-
});
304-
await lexboxApi.CreateWritingSystem(new()
305-
{
306-
Id = Guid.NewGuid(),
307-
Type = WritingSystemType.Analysis,
308-
WsId = "fr",
309-
Name = "French",
310-
Abbreviation = "fr",
311-
Font = "Arial",
312-
Exemplars = WritingSystem.LatinExemplars
313-
});
314-
await lexboxApi.CreateWritingSystem(new()
315-
{
316-
Id = Guid.NewGuid(),
317-
Type = WritingSystemType.Analysis,
318-
WsId = "en-Zxxx-x-audio",
319-
Name = "English (A)",
320-
Abbreviation = "Eng 🔊",
321-
Font = "Arial",
322-
Exemplars = WritingSystem.LatinExemplars
323-
});
324-
325-
await lexboxApi.CreateEntry(new()
326-
{
327-
Id = Guid.NewGuid(),
328-
LexemeForm = { ["en"] = "Apple" },
329-
CitationForm = { ["en"] = "Apple" },
330-
LiteralMeaning = { ["en"] = new RichString("Fruit") },
331-
Senses =
332-
[
333-
new()
334-
{
335-
Gloss = { ["en"] = "Fruit" },
336-
Definition =
337-
{
338-
["en"] =
339-
new RichString(
340-
"fruit with red, yellow, or green skin with a sweet or tart crispy white flesh")
341-
},
342-
SemanticDomains = [],
343-
ExampleSentences = [new() { Sentence = { ["en"] = new RichString("We ate an apple") } }]
344-
}
345-
]
346-
});
347-
348-
await lexboxApi.CreateEntry(new()
349-
{
350-
Id = Guid.NewGuid(),
351-
LexemeForm = { ["en"] = "Banana" },
352-
CitationForm = { ["en"] = "Banana" },
353-
LiteralMeaning = { ["en"] = new RichString("Fruit") },
354-
Senses =
355-
[
356-
new()
357-
{
358-
Gloss = { ["en"] = "Fruit" },
359-
Definition = { ["en"] = new RichString("long curved fruit with yellow skin and soft sweet flesh") },
360-
SemanticDomains = [],
361-
ExampleSentences =
362-
[new() { Sentence = { ["en"] = new RichString("The monkey peeled a banana") } }]
363-
}
364-
]
365-
});
366-
367-
await lexboxApi.CreateEntry(new()
368-
{
369-
Id = Guid.NewGuid(),
370-
LexemeForm = { ["en"] = "Orange" },
371-
CitationForm = { ["en"] = "Orange" },
372-
LiteralMeaning = { ["en"] = new RichString("Fruit") },
373-
Senses =
374-
[
375-
new()
376-
{
377-
Gloss = { ["en"] = "Fruit" },
378-
Definition =
379-
{
380-
["en"] = new RichString("round citrus fruit with orange skin and juicy segments inside")
381-
},
382-
SemanticDomains = [],
383-
ExampleSentences =
384-
[new() { Sentence = { ["en"] = new RichString("I squeezed the orange for juice") } }]
385-
}
386-
]
387-
});
388-
389-
await lexboxApi.CreateEntry(new()
390-
{
391-
Id = Guid.NewGuid(),
392-
LexemeForm = { ["en"] = "Grape" },
393-
CitationForm = { ["en"] = "Grape" },
394-
LiteralMeaning = { ["en"] = new RichString("Fruit") },
395-
Senses =
396-
[
397-
new()
398-
{
399-
Gloss = { ["en"] = "Fruit" },
400-
Definition =
401-
{
402-
["en"] =
403-
new RichString("small round or oval fruit growing in clusters, used for wine or eating")
404-
},
405-
SemanticDomains = [],
406-
ExampleSentences =
407-
[new() { Sentence = { ["en"] = new RichString("The vineyard was full of ripe grapes") } }]
408-
}
409-
]
410-
});
411-
}
412257
}

0 commit comments

Comments
 (0)