Skip to content

Commit

Permalink
Merge branch 'master' into cookie-monster
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Aug 22, 2024
2 parents 6b5cf48 + 0812f13 commit 6747a8d
Show file tree
Hide file tree
Showing 76 changed files with 557 additions and 442 deletions.
12 changes: 10 additions & 2 deletions Backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
############################################################
# IMPORTANT
#
# Supported Platforms:
# - Intel/AMD 64-bit
# - ARM 64-bit
############################################################

# Docker multi-stage build
FROM mcr.microsoft.com/dotnet/sdk:8.0.303-jammy-amd64 AS builder
FROM mcr.microsoft.com/dotnet/sdk:8.0.303-jammy AS builder
WORKDIR /app

# Copy csproj and restore (fetch dependencies) as distinct layers.
Expand All @@ -11,7 +19,7 @@ COPY . ./
RUN dotnet publish -c Release -o build

# Build runtime image.
FROM mcr.microsoft.com/dotnet/aspnet:8.0.7-jammy-amd64
FROM mcr.microsoft.com/dotnet/aspnet:8.0.7-jammy

ENV ASPNETCORE_URLS=http://+:5000
ENV COMBINE_IS_IN_CONTAINER=1
Expand Down
10 changes: 9 additions & 1 deletion Backend/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ public class User
[BsonElement("username")]
public string Username { get; set; }

/// <summary> Not implemented in frontend. </summary>
[BsonElement("uiLang")]
public string UILang { get; set; }

[Required]
[BsonElement("glossSuggestion")]
[BsonRepresentation(BsonType.String)]
public AutocompleteSetting GlossSuggestion { get; set; }

[Required]
[BsonElement("token")]
public string Token { get; set; }
Expand All @@ -94,6 +98,7 @@ public User()
Password = "";
Username = "";
UILang = "";
GlossSuggestion = AutocompleteSetting.On;
Token = "";
IsAdmin = false;
WorkedProjects = new();
Expand All @@ -115,6 +120,7 @@ public User Clone()
Password = Password,
Username = Username,
UILang = UILang,
GlossSuggestion = GlossSuggestion,
Token = Token,
IsAdmin = IsAdmin,
WorkedProjects = WorkedProjects.ToDictionary(kv => kv.Key, kv => kv.Value),
Expand All @@ -136,6 +142,7 @@ public bool ContentEquals(User other)
other.Password.Equals(Password, StringComparison.Ordinal) &&
other.Username.Equals(Username, StringComparison.Ordinal) &&
other.UILang.Equals(UILang, StringComparison.Ordinal) &&
other.GlossSuggestion.Equals(GlossSuggestion) &&
other.Token.Equals(Token, StringComparison.Ordinal) &&
other.IsAdmin == IsAdmin &&

Expand Down Expand Up @@ -172,6 +179,7 @@ public override int GetHashCode()
hash.Add(Password);
hash.Add(Username);
hash.Add(UILang);
hash.Add(GlossSuggestion);
hash.Add(Token);
hash.Add(IsAdmin);
return hash.ToHashCode();
Expand Down
3 changes: 2 additions & 1 deletion Backend/Repositories/UserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ public async Task<ResultOfUpdate> Update(string userId, User user, bool updateIs
.Set(x => x.ProjectRoles, user.ProjectRoles)
.Set(x => x.Agreement, user.Agreement)
.Set(x => x.Username, user.Username)
.Set(x => x.UILang, user.UILang);
.Set(x => x.UILang, user.UILang)
.Set(x => x.GlossSuggestion, user.GlossSuggestion);

// If .Avatar or .Token has been set to null or "",
// this prevents it from being erased in the database
Expand Down
2 changes: 1 addition & 1 deletion Backend/Services/PermissionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public string GetUserId(HttpContext request)
/// <summary> Creates a JWT token for the given user. </summary>
public async Task<User?> MakeJwt(User user)
{
const int hoursUntilExpires = 4;
const int hoursUntilExpires = 12;
var tokenHandler = new JwtSecurityTokenHandler();
var secretKey = Environment.GetEnvironmentVariable("COMBINE_JWT_SECRET_KEY")!;
var key = Encoding.ASCII.GetBytes(secretKey);
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
############################################################
# IMPORTANT
#
# Supported Platforms:
# - Intel/AMD 64-bit
# - ARM 64-bit
############################################################

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

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,9 @@ The process for configuring and deploying _TheCombine_ for production targets is
- [JS](https://www.w3schools.com/js/default.asp)
- [TS](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
- [Our style guide](docs/style_guide/ts_style_guide.md)
- [React](https://reactjs.org/)
- [React Hooks](https://reactjs.org/docs/hooks-intro.html)
- [React](https://react.dev/learn)
- [React Hooks](https://react.dev/reference/react/hooks)
- [MUI](https://mui.com/material-ui/getting-started/) (styled/themed components)
- [Redux concepts](https://redux.js.org/tutorials/fundamentals/part-2-concepts-data-flow)
- [Redux tutorials](https://redux.js.org/tutorials/typescript-quick-start)
- [React-i18next](https://react.i18next.com/) (text localization)
Expand Down
7 changes: 7 additions & 0 deletions database/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
############################################################
# IMPORTANT
#
# Supported Platforms:
# - Intel/AMD 64-bit
# - ARM 64-bit
############################################################
FROM mongo:7.0.12-jammy

WORKDIR /
Expand Down
15 changes: 6 additions & 9 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Dockerfile to build a Kubernetes Worker container for the Combine. The
# image shall contain a collection of scripts to perform the following functions:
# - backup The Combine database and backend data files
# - restore The Combine database and backend data files from a previous backup
# - monitor specified secrets for changes and push the updated secrets to AWS
# S3 storage
# - check the current TLS secret for updates in AWS S3 storage and update the
# secret accordingly.
# The scripts are written in Python.
############################################################
# IMPORTANT
#
# Supported Platforms:
# - Intel/AMD 64-bit
############################################################

FROM ubuntu:22.04

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/user_guide/docs/account.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cómo registrarse, iniciar sesión y editar su cuenta.

## Registrarse

Para crear una nueva cuenta, pulse el botón [REGISTRARSE](../../signup) en la página de inicio de sesión.
Para crear una nueva cuenta, pulse el botón [Registrarse](../../signup) en la página de inicio de sesión.

!!! note "Nota"

Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ How to sign up, log in, and edit your account.

## Sign Up

To create a new account, click the [SIGN UP](../signup) button on the Login page.
To create a new account, click the [Sign Up](../signup) button on the Login page.

!!! note "Note"

Expand Down
6 changes: 3 additions & 3 deletions docs/user_guide/docs/goals.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ El centro del panel muestra hasta 5 ejemplos de formas vernáculas en las que ap
en cada ocurrencia.

En la parte superior del panel hay tres botones para designar si el carácter debe incluirse en el inventario de
caracteres de la lengua vernácula: "ACEPTAR", "NO DECIDIDO" y "RECHAZAR". Al pulsar cualquiera de estos botones se
caracteres de la lengua vernácula: "Aceptar", "No decidido" y "Rechazar". Al pulsar cualquiera de estos botones se
actualizará la designación en la parte inferior de la ficha de personaje. (Estas actualizaciones del inventario del
personaje no se guardan en el proyecto hasta que pulse el botón GUARDAR en la parte inferior de la página)
personaje no se guardan en el proyecto hasta que pulse el botón Guardar en la parte inferior de la página)

En la parte inferior del panel se encuentra la herramienta Buscar y Reemplazar. Si _cada_ aparición del carácter debe
sustituirse por otra cosa, escriba el carácter o cadena de sustitución en la casilla "Sustituir por" y pulse el botón
APLICAR.
Aplicar.

!!! warning "Importante"

Expand Down
12 changes: 6 additions & 6 deletions docs/user_guide/docs/goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ next set: "Save & Continue" and "Defer".

#### Save & Continue

![Merge Duplicates Save and Continue button](images/mergeSaveAndContinue.png)
![Merge Duplicates Save & Continue button](images/mergeSaveAndContinue.png)

The blue "Save and Continue" button does two things. First, it saves all changes made (i.e., all moved, merged, or
deleted senses), updating the words in the database. Second, it saves the resulting set of words as non-duplicates.
The blue "Save & Continue" button does two things. First, it saves all changes made (i.e., all moved, merged, or deleted
senses), updating the words in the database. Second, it saves the resulting set of words as non-duplicates.

!!! tip "Tip"

Expand Down Expand Up @@ -211,12 +211,12 @@ The middle of the panel shows up to 5 example vernacular forms in which the char
in each occurrence.

At the top of the panel are three buttons for designating whether the character should be included in the vernacular
language's character inventory: "ACCEPT", "UNDECIDED", and "REJECT". Pressing any of these buttons will update the
language's character inventory: "Accept", "Undecided", and "Reject". Pressing any of these buttons will update the
designation at the bottom of the character tile. (These updates to the character inventory are not saved to the project
until you click the SAVE button at the bottom of the page.)
until you click the Save button at the bottom of the page.)

At the bottom of the panel is a Find-and-Replace tool. If _every_ occurrence of the character should be replaced with
something else, type the replacement character or string in the "Replace with" box and click the APPLY button.
something else, type the replacement character or string in the "Replace with" box and click the Apply button.

!!! warning "Important"

Expand Down
21 changes: 14 additions & 7 deletions docs/user_guide/docs/project.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Al crear un proyecto, tiene la opción de empezar con un proyecto vacío o de im

Si tiene datos léxicos en un archivo [LIFT](https://software.sil.org/lifttools) (probablemente exportado de The Combine,
[WeSay](https://software.sil.org/wesay), [FLEx](https://software.sil.org/fieldworks) o
[Lexique Pro](https://software.sil.org/lexiquepro)), puede hacer clic en el botón BROWSE junto a "¿Cargar los datos
[Lexique Pro](https://software.sil.org/lexiquepro)), puede hacer clic en el botón Navegar junto a "¿Cargar los datos
existentes?" para importar los datos a su proyecto.

Si decide no importar datos durante la creación del proyecto, podrá hacerlo más adelante (véase [más abajo](#import)).
Expand Down Expand Up @@ -198,19 +198,26 @@ In this settings tab, you can change the semantic domain language and manage cus
El _idioma de los_ dominios semánticos controla el idioma en el que se muestran los títulos y descripciones de los
dominios semánticos en [Entrada de datos](./dataEntry.md).

The _custom semantic domains_ supported at this time are the [established domains](https://semdom.org/) with `.0` added
to the end of the id. For example, domain _4.2.6.2: Sports_ has two standard subdomains, _4.2.6.2.1: Football, Soccer_
and _4.2.6.2.2: Basketball_. If another sport is dominant among the people group gathering their language, it can be
added as domain _4.2.6.2.0_.
At this time, The Combine only supports _custom semantic domains_ that extend the
[established domains](https://semdom.org/). For each established domain, one custom subdomain can be created, which will
have `.0` added to the end of the domain id. For example, domain _6.2.1.1: Growing Grain_ has three standard subdomains,
for Rice, Wheat, and Maize. If another grain, such as Barley, is dominant among the people group gathering words, it can
be added as domain _6.2.1.1.0_.

For each custom domain, you can add a name, description, and questions to help with word collection in that domain.
![Add Custom Domain](../images/projectSettingsDomsCustomAdd.png){.center}

For each custom domain, you can add a description and questions to help with word collection in that domain.

![Edit Custom Domain](../images/projectSettingsDomsCustomEdit.png){.center}

!!! note "Nota"

Custom semantic domains are included in the project export and can be imported into FieldWorks. However, the
questions are not included.

Custom semantic domains will appear in the domain tree for the project, but will not be visible to other projects.
Custom semantic domains will be available to all project users doing Data Entry.

![See Custom Domain](../images/projectSettingsDomsCustomSee.png){.center}

!!! note "Nota"

Expand Down
21 changes: 14 additions & 7 deletions docs/user_guide/docs/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When creating a project, you have the option to start with an empty project or t

If you have lexical data in a [LIFT](https://software.sil.org/lifttools) file (likely exported from The Combine,
[WeSay](https://software.sil.org/wesay), [FLEx](https://software.sil.org/fieldworks), or
[Lexique Pro](https://software.sil.org/lexiquepro)), you can click the BROWSE button next to "Upload existing data?" to
[Lexique Pro](https://software.sil.org/lexiquepro)), you can click the Browse button next to "Upload existing data?" to
import the data into your project.

If you choose not to import data during project creation, you may still do so later (see [below](#import)).
Expand Down Expand Up @@ -196,19 +196,26 @@ In this settings tab, you can change the semantic domain language and manage cus
The _semantic domains language_ controls the language in which semantic domain titles and descriptions are displayed in
[Data Entry](./dataEntry.md).

The _custom semantic domains_ supported at this time are the [established domains](https://semdom.org/) with `.0` added
to the end of the id. For example, domain _4.2.6.2: Sports_ has two standard subdomains, _4.2.6.2.1: Football, Soccer_
and _4.2.6.2.2: Basketball_. If another sport is dominant among the people group gathering their language, it can be
added as domain _4.2.6.2.0_.
At this time, The Combine only supports _custom semantic domains_ that extend the
[established domains](https://semdom.org/). For each established domain, one custom subdomain can be created, which will
have `.0` added to the end of the domain id. For example, domain _6.2.1.1: Growing Grain_ has three standard subdomains,
for Rice, Wheat, and Maize. If another grain, such as Barley, is dominant among the people group gathering words, it can
be added as domain _6.2.1.1.0_.

For each custom domain, you can add a name, description, and questions to help with word collection in that domain.
![Add Custom Domain](images/projectSettingsDomsCustomAdd.png){.center}

For each custom domain, you can add a description and questions to help with word collection in that domain.

![Edit Custom Domain](images/projectSettingsDomsCustomEdit.png){.center}

!!! note "Note"

Custom semantic domains are included in the project export and can be imported into FieldWorks. However, the
questions are not included.

Custom semantic domains will appear in the domain tree for the project, but will not be visible to other projects.
Custom semantic domains will be available to all project users doing Data Entry.

![See Custom Domain](images/projectSettingsDomsCustomSee.png){.center}

!!! note "Note"

Expand Down
19 changes: 13 additions & 6 deletions docs/user_guide/docs/project.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,26 @@ In this settings tab, you can change the semantic domain language and manage cus

*语义领域语言*决定[词条输入](./dataEntry.md)中表达语义领域标题和描述的语言。

The _custom semantic domains_ supported at this time are the [established domains](https://semdom.org/) with `.0` added
to the end of the id. For example, domain _4.2.6.2: Sports_ has two standard subdomains, _4.2.6.2.1: Football, Soccer_
and _4.2.6.2.2: Basketball_. If another sport is dominant among the people group gathering their language, it can be
added as domain _4.2.6.2.0_.
At this time, The Combine only supports _custom semantic domains_ that extend the
[established domains](https://semdom.org/). For each established domain, one custom subdomain can be created, which will
have `.0` added to the end of the domain id. For example, domain _6.2.1.1: Growing Grain_ has three standard subdomains,
for Rice, Wheat, and Maize. If another grain, such as Barley, is dominant among the people group gathering words, it can
be added as domain _6.2.1.1.0_.

For each custom domain, you can add a name, description, and questions to help with word collection in that domain.
![Add Custom Domain](../images/projectSettingsDomsCustomAdd.png){.center}

For each custom domain, you can add a description and questions to help with word collection in that domain.

![Edit Custom Domain](../images/projectSettingsDomsCustomEdit.png){.center}

!!! note "笔记"

Custom semantic domains are included in the project export and can be imported into FieldWorks. However, the
questions are not included.

Custom semantic domains will appear in the domain tree for the project, but will not be visible to other projects.
Custom semantic domains will be available to all project users doing Data Entry.

![See Custom Domain](../images/projectSettingsDomsCustomSee.png){.center}

!!! note "笔记"

Expand Down
8 changes: 8 additions & 0 deletions maintenance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
# secret accordingly.
# The scripts are written in Python.

############################################################
# IMPORTANT
#
# Supported Platforms:
# - Intel/AMD 64-bit
# - ARM 64-bit
############################################################

FROM sillsdev/aws-kubectl:0.3.0

USER root
Expand Down
Loading

0 comments on commit 6747a8d

Please sign in to comment.