Skip to content

Commit d14b75c

Browse files
authored
fix bugs in previous release (#1827)
* add korean and indonesian to the local picker * add ui language picker to project sidebar * use a fallback for crypto random to make it easier to test on mobile * make it easy to run a local prod ui build of fw lite * make sure display: block is not overridden, don't try to center text horizontally in prose mirror * after login trigger a sync to update the sync dialog login state * show synced status when hovering over sync menu * upgrade bits ui to fix an issue with a tooltip not closing when it was open before a dialog opened. This also required upgrading to svelte 5.33 * fix some failing tests when running on windows against a linux client * don't try to use versions of svelte greater than 5.33 due to storybook issues
1 parent 92ac4ae commit d14b75c

File tree

12 files changed

+241
-178
lines changed

12 files changed

+241
-178
lines changed

backend/FwLite/FwLiteWeb/FwLiteWebKernel.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public static IServiceCollection AddFwLiteWebServices(this IServiceCollection se
2323
services.AddFwLiteProjectSync();
2424
services.AddMiniLcmRouteServices();
2525
services.AddFwLiteShared(environment);
26-
if (environment.IsDevelopment())
27-
{
28-
services.Configure<FwLiteConfig>(config => config.UseDevAssets = true);
29-
}
3026

3127
services.AddOptions<FwLiteWebConfig>().BindConfiguration("FwLiteWeb");
3228

backend/FwLite/FwLiteWeb/appsettings.Development.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"LogFileName": null
1515
},
1616
"FwLite": {
17-
"UpdateCheckCondition": "Never"
17+
"UpdateCheckCondition": "Never",
18+
"UseDevAssets": true
1819
}
1920
}

backend/FwLite/Taskfile.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ tasks:
1414
dir: ./FwLiteWeb
1515
cmd: dotnet watch --no-hot-reload
1616
web-prod:
17+
deps: [ ui:build-viewer-app ]
1718
dir: ./FwLiteWeb
18-
cmds:
19-
- dotnet publish --artifacts-path ../artifacts
20-
- cd ../artifacts/publish/FwLiteWeb/release && dotnet FwLiteWeb.dll
19+
cmd: dotnet run -- --FwLite:UseDevAssets=false
2120
web-chaos:
2221
label: Run FwLiteWeb with some Chaos injected to http requests to lexbox, requests will have chaos 30% of the time, this includes some latency of 5 seconds
2322
dir: ./FwLiteWeb

backend/Testing/FwHeadless/MediaFileTestFixture.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public async Task DisposeAsync()
5757
}
5858
var request = new HttpRequestMessage(HttpMethod.Get, url);
5959
var result = await HttpClient.SendAsync(request);
60-
return (await result.Content.ReadFromJsonAsync<FileListing>(), result);
60+
if (!result.IsSuccessStatusCode) return (null, result);
61+
var fileListing = await result.Content.ReadFromJsonAsync<FileListing>();
62+
//ensure the file listing is consistent with the os the tests are running on, keeps the tests simpler
63+
if (fileListing is not null) fileListing = new ([..fileListing.Files.Select(f => f.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar)) ?? []]);
64+
return (fileListing, result);
6165
}
6266

6367
public async Task<(Guid, HttpResponseMessage)> PostFile(string localPath, string? overrideFilename = null, string? overrideSubfolder = null, string? contentType = null, bool deleteContentLengthHeader = false, FileMetadata? metadata = null, string loginAs = "admin", IDictionary<string, string>? extraFields = null)

frontend/pnpm-lock.yaml

Lines changed: 201 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packages:
44

55
catalog:
66
vite: ^6.0.3
7-
svelte: ^5.28.0
7+
svelte: ~5.33.19
88
svelte-check: ^4.1.4
99
svelte-preprocess: ^6.0.3
1010
"@sveltejs/vite-plugin-svelte": ^5.0.3

frontend/viewer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@vitest/browser": "catalog:",
6666
"@vitest/ui": "catalog:",
6767
"autoprefixer": "^10.4.20",
68-
"bits-ui": "1.8.0",
68+
"bits-ui": "2.8.11",
6969
"clsx": "^2.1.1",
7070
"eslint": "catalog:",
7171
"eslint-plugin-storybook": "^9.0.8",

frontend/viewer/src/lib/components/lcm-rich-text-editor/lcm-rich-text-editor.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@
278278

279279
<style lang="postcss" global>
280280
.ProseMirror {
281-
display: block;
282-
place-content: center;
281+
display: block !important; /*prevent display from being overridden by .flex in the inputVariant class */
282+
align-content: center;
283283
flex-grow: 1;
284284
outline: none;
285285
cursor: text;

frontend/viewer/src/lib/i18n/LocalizationPicker.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
const languages: Record<string, string> = {
1010
'en': 'English',
1111
'fr': 'Français',
12-
'es': 'Español'
12+
'es': 'Español',
13+
'id': 'Bahasa Indonesia',
14+
'ko': '한국어'
1315
};
1416
const currentLanguage = $derived(languages[$locale] ?? 'Unknown: ' + $locale);
1517
</script>

frontend/viewer/src/lib/utils.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ export function cn(...inputs: ClassValue[]) {
88
}
99

1010
export function randomId(): string {
11-
return crypto.randomUUID();
11+
if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) {
12+
return crypto.randomUUID();
13+
}
14+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
15+
const r = Math.random() * 16 | 0;
16+
const v = c === 'x' ? r : (r & 0x3 | 0x8);
17+
return v.toString(16);
18+
});
1219
}
1320

1421
export function firstTruthy<T, U>(items: T[], mapper: (item: T) => U): U | undefined {
@@ -21,7 +28,7 @@ export function firstTruthy<T, U>(items: T[], mapper: (item: T) => U): U | undef
2128

2229
export function defaultEntry(): IEntry {
2330
return {
24-
id: crypto.randomUUID(),
31+
id: randomId(),
2532
citationForm: {},
2633
lexemeForm: {},
2734
note: {},

0 commit comments

Comments
 (0)