Skip to content

Commit

Permalink
Merge branch 'master' into word-card-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Jan 23, 2025
2 parents 04f2f19 + dd8e83a commit 2840bf9
Show file tree
Hide file tree
Showing 84 changed files with 1,084 additions and 43,320 deletions.
1 change: 0 additions & 1 deletion .env.local.template

This file was deleted.

13 changes: 4 additions & 9 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@ jobs:
aka.ms:443
api.github.com:443
api.nuget.org:443
builds.dotnet.microsoft.com:443
dc.services.visualstudio.com:443
deb.debian.org:80
dotnetbuilds.azureedge.net:443
dotnetcli.azureedge.net:443
github.com:443
md-hdd-t032zjxllntc.z26.blob.storage.azure.net:443
objects.githubusercontent.com:443
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup dotnet
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install ffmpeg
Expand Down Expand Up @@ -110,18 +109,16 @@ jobs:
aka.ms:443
api.github.com:443
api.nuget.org:443
builds.dotnet.microsoft.com:443
dc.services.visualstudio.com:443
dotnetcli.azureedge.net:443
github.com:443
objects.githubusercontent.com:443
ts-crl.ws.symantec.com:80
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# Manually install .NET to work around:
# https://github.com/github/codeql-action/issues/757
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: "8.0.x"
- name: Initialize CodeQL
Expand Down Expand Up @@ -153,15 +150,13 @@ jobs:
egress-policy: block
allowed-endpoints: >
*.data.mcr.microsoft.com:443
*.symcb.com:80
api.nuget.org:443
archive.ubuntu.com:80
dc.services.visualstudio.com:443
deb.debian.org:80
github.com:443
mcr.microsoft.com:443
security.ubuntu.com:80
ts-crl.ws.symantec.com:80
# For subfolders, currently a full checkout is required.
# See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
github.com:443
objects.githubusercontent.com:443
pypi.org:443
uploads.github.com:443
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/combine_deploy_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
egress-policy: block
allowed-endpoints: >
api.ecr-public.us-east-1.amazonaws.com:443
api.github.com:443
archive.ubuntu.com:80
auth.docker.io:443
cdn.dl.k8s.io:443
deb.debian.org:80
dl.k8s.io:443
files.pythonhosted.org:443
get.helm.sh:443
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Build combine_deploy
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@v6.10.0
with:
context: "{{defaultContext}}:deploy"
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commit_message_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ permissions: # added using https://github.com/step-security/secure-workflows

jobs:
commit-message-lint:
uses: sillsdev/FieldWorks/.github/workflows/CommitMessage.yml@22859ef68af99ffbd016eca4e503278db8007913
uses: sillsdev/FieldWorks/.github/workflows/CommitMessage.yml@d6f2ee1ed5aa1257e408a4afab2aab8fd8268764
3 changes: 0 additions & 3 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ jobs:
api.nuget.org:443
archive.ubuntu.com:80
auth.docker.io:443
codecov.io:443
dc.services.visualstudio.com:443
deb.debian.org:80
docker.io:443
dotnetcli.azureedge.net:443
files.pythonhosted.org:443
github.com:443
mcr.microsoft.com:443
Expand All @@ -51,7 +49,6 @@ jobs:
security.ubuntu.com:80
storage.googleapis.com:443
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
uploader.codecov.io:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ jobs:
*.actions.githubusercontent.com:443
*.cloudfront.net:443
*.data.mcr.microsoft.com:443
api.ecr-public.us-east-1.amazonaws.com:443
api.ecr-public.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
api.github.com:443
api.nuget.org:443
archive.ubuntu.com:80
auth.docker.io:443
dc.services.visualstudio.com:443
deb.debian.org:80
docker.io:443
dotnetcli.azureedge.net:443
files.pythonhosted.org:443
github.com:443
mcr.microsoft.com:443
Expand All @@ -47,7 +46,7 @@ jobs:
security.debian.org:80
security.ubuntu.com:80
storage.googleapis.com:443
sts.us-east-1.amazonaws.com:443
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build The Combine
id: build_combine
Expand Down
2 changes: 1 addition & 1 deletion Backend.Tests/Models/ProjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void TestClone()
LiftImported = true,
DefinitionsEnabled = true,
GrammaticalInfoEnabled = true,
AutocompleteSetting = AutocompleteSetting.On,
AutocompleteSetting = OffOnSetting.On,
SemDomWritingSystem = new("fr", "Français"),
VernacularWritingSystem = new("en", "English", "Calibri"),
AnalysisWritingSystems = new() { new("es", "Español") },
Expand Down
22 changes: 11 additions & 11 deletions Backend/BackendFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.10.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />
<PackageReference Include="RelaxNG" Version="3.2.3">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.5.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.1" />
<PackageReference Include="MailKit" Version="4.8.0" />
<PackageReference Include="MailKit" Version="4.9.0" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.6"/>

<!-- SIL Maintained Dependencies. -->
<PackageReference Include="icu.net" Version="2.10.1-beta.5" />
<PackageReference Include="icu.net" Version="3.0.0" />
<PackageReference Include="Icu4c.Win.Full.Lib" Version="62.2.3-beta" />
<PackageReference Include="SIL.Core" Version="14.1.1" />
<PackageReference Include="SIL.Core.Desktop" Version="14.1.1">
<PackageReference Include="SIL.Core" Version="15.0.0" />
<PackageReference Include="SIL.Core.Desktop" Version="15.0.0">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="SIL.DictionaryServices" Version="14.1.1">
<PackageReference Include="SIL.DictionaryServices" Version="15.0.0">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="SIL.Lift" Version="14.1.1">
<PackageReference Include="SIL.Lift" Version="15.0.0">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="SIL.WritingSystems" Version="14.1.1" />
<PackageReference Include="SIL.WritingSystems" Version="15.0.0" />
</ItemGroup>
</Project>
10 changes: 6 additions & 4 deletions Backend/Controllers/SpeakerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;

namespace BackendFramework.Controllers
{
Expand Down Expand Up @@ -96,9 +97,9 @@ public async Task<IActionResult> GetSpeaker(string projectId, string speakerId)

/// <summary> Creates a <see cref="Speaker"/> for the specified projectId </summary>
/// <returns> Id of created Speaker </returns>
[HttpGet("create/{name}", Name = "CreateSpeaker")]
[HttpPut("create", Name = "CreateSpeaker")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> CreateSpeaker(string projectId, string name)
public async Task<IActionResult> CreateSpeaker(string projectId, [FromBody, BindRequired] string name)
{
// Check permissions
if (!await _permissionService.HasProjectPermission(
Expand Down Expand Up @@ -193,9 +194,10 @@ public async Task<IActionResult> RemoveConsent(string projectId, string speakerI

/// <summary> Updates the <see cref="Speaker"/>'s name for the specified projectId and speakerId </summary>
/// <returns> Id of updated Speaker </returns>
[HttpGet("update/{speakerId}/{name}", Name = "UpdateSpeakerName")]
[HttpPut("update/{speakerId}", Name = "UpdateSpeakerName")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> UpdateSpeakerName(string projectId, string speakerId, string name)
public async Task<IActionResult> UpdateSpeakerName(
string projectId, string speakerId, [FromBody, BindRequired] string name)
{
// Check permissions
if (!await _permissionService.HasProjectPermission(
Expand Down
10 changes: 5 additions & 5 deletions Backend/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ public async Task<IActionResult> GetUser(string userId)
}

/// <summary> Returns <see cref="User"/> with the specified email address. </summary>
[HttpGet("getemail/{email}", Name = "GetUserByEmail")]
[HttpPut("getbyemail", Name = "GetUserByEmail")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(User))]
public async Task<IActionResult> GetUserByEmail(string email)
public async Task<IActionResult> GetUserByEmail([FromBody, BindRequired] string email)
{
if (!_permissionService.IsCurrentUserAuthorized(HttpContext))
{
Expand Down Expand Up @@ -200,17 +200,17 @@ public async Task<IActionResult> CreateUser([FromBody, BindRequired] User user)

/// <summary> Checks whether specified email address is taken or empty. </summary>
[AllowAnonymous]
[HttpGet("isemailtaken/{email}", Name = "IsEmailUnavailable")]
[HttpPut("isemailtaken", Name = "IsEmailUnavailable")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
public async Task<IActionResult> IsEmailUnavailable(string email)
public async Task<IActionResult> IsEmailUnavailable([FromBody, BindRequired] string email)
{
var isUnavailable = string.IsNullOrWhiteSpace(email) || await _userRepo.GetUserByEmail(email) is not null;
return Ok(isUnavailable);
}

/// <summary> Updates <see cref="User"/> with specified id. </summary>
/// <returns> Id of updated user. </returns>
[HttpPut("{userId}", Name = "UpdateUser")]
[HttpPut("updateuser/{userId}", Name = "UpdateUser")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> UpdateUser(string userId, [FromBody, BindRequired] User user)
{
Expand Down
2 changes: 1 addition & 1 deletion Backend/Controllers/UserRoleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public async Task<IActionResult> ChangeOwner(string projectId, string oldUserId,
if (newResult != ResultOfUpdate.Updated)
{
return StatusCode(StatusCodes.Status304NotModified, newRoleId);
};
}

// Change the old owner to a project admin
oldUserRole.Role = Role.Administrator;
Expand Down
8 changes: 4 additions & 4 deletions Backend/Models/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Project
[Required]
[BsonElement("autocompleteSetting")]
[BsonRepresentation(BsonType.String)]
public AutocompleteSetting AutocompleteSetting { get; set; }
public OffOnSetting AutocompleteSetting { get; set; }

[Required]
[BsonElement("semDomWritingSystem")]
Expand Down Expand Up @@ -92,7 +92,7 @@ public Project()
LiftImported = false;
DefinitionsEnabled = false;
GrammaticalInfoEnabled = false;
AutocompleteSetting = AutocompleteSetting.On;
AutocompleteSetting = OffOnSetting.On;
SemDomWritingSystem = new();
VernacularWritingSystem = new();
AnalysisWritingSystems = new();
Expand Down Expand Up @@ -186,10 +186,10 @@ public override int GetHashCode()
var hash = new HashCode();
hash.Add(Id);
hash.Add(Name);
hash.Add(IsActive);
hash.Add(LiftImported);
hash.Add(DefinitionsEnabled);
hash.Add(GrammaticalInfoEnabled);
hash.Add(IsActive);
hash.Add(AutocompleteSetting);
hash.Add(SemDomWritingSystem);
hash.Add(VernacularWritingSystem);
Expand Down Expand Up @@ -329,7 +329,7 @@ public UserCreatedProject()
}
}

public enum AutocompleteSetting
public enum OffOnSetting
{
Off,
On
Expand Down
4 changes: 2 additions & 2 deletions Backend/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class User
[Required]
[BsonElement("glossSuggestion")]
[BsonRepresentation(BsonType.String)]
public AutocompleteSetting GlossSuggestion { get; set; }
public OffOnSetting GlossSuggestion { get; set; }

[Required]
[BsonElement("token")]
Expand All @@ -98,7 +98,7 @@ public User()
Password = "";
Username = "";
UILang = "";
GlossSuggestion = AutocompleteSetting.On;
GlossSuggestion = OffOnSetting.On;
Token = "";
IsAdmin = false;
WorkedProjects = new();
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
############################################################

# User guide build environment
FROM python:3.12.7-slim-bookworm AS user_guide_builder
FROM python:3.12.8-slim-bookworm AS user_guide_builder

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,9 @@ A rapid word collection tool. See the [User Guide](https://sillsdev.github.io/Th
- `COMBINE_SMTP_ADDRESS`
- `COMBINE_SMTP_FROM`

2. _(Optional)_ To opt in to segment.com analytics to test the analytics during development:
2. Run `npm start` from the project directory to install dependencies and start the project.

```bash
# For Windows, use `copy`.
cp .env.local.template .env.local
```

3. Run `npm start` from the project directory to install dependencies and start the project.

4. Consult our [C#](docs/style_guide/c_sharp_style_guide.md) and [TypeScript](docs/style_guide/ts_style_guide.md) style
3. Consult our [C#](docs/style_guide/c_sharp_style_guide.md) and [TypeScript](docs/style_guide/ts_style_guide.md) style
guides for best coding practices in this project.

[chocolatey]: https://chocolatey.org/
Expand Down Expand Up @@ -550,7 +543,7 @@ the corresponding videos and any transcript translations downloaded from Crowdin
optionally attach them to a video file), run from within a Python virtual environment:

```bash
python scripts/subtitle_tutorial_video.py -s <subtitles_subfolder_name> [-i <input_video_path> -o <output_video_path] [-v]
python scripts/subtitle_tutorial_video.py -s <subtitles_subfolder_name> [-i <input_video_path> -o <output_video_path>] [-v]
```

## Setup Local Kubernetes Cluster
Expand Down
2 changes: 1 addition & 1 deletion database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - Intel/AMD 64-bit
# - ARM 64-bit
############################################################
FROM mongo:7.0.15-jammy
FROM mongo:7.0.16-jammy

WORKDIR /

Expand Down
4 changes: 2 additions & 2 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# - Intel/AMD 64-bit
############################################################

FROM ubuntu:22.04
FROM python:3.12.8-slim-bookworm

USER root

RUN apt-get update && \
apt-get install -y python3 python3-pip nano curl openssh-client iputils-ping && \
apt-get install -y python3-pip nano curl openssh-client iputils-ping && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
Loading

0 comments on commit 2840bf9

Please sign in to comment.