Skip to content

Commit

Permalink
Merge branch 'master' into mrt
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Mar 20, 2024
2 parents 24a67e3 + 8f2f3b3 commit 71fbece
Show file tree
Hide file tree
Showing 89 changed files with 110 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ spec:
- name: CERT_PROXY_NAMESPACE
value: {{ .Release.Namespace }}
image: {{ include "cert-proxy-server.containerImage" . }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
imagePullPolicy: Always
name: combine-cert-proxy
resources: {}
resources:
requests:
cpu: 2m
memory: 100M
limits:
memory: 150M
restartPolicy: Always
{{- if ne .Values.global.pullSecretName "None" }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ spec:
key: SERVER_NAME
name: {{ .Values.envNginxProxy }}
image: nginx:1.21
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
ports:
- containerPort: 80
resources: {}
resources:
requests:
cpu: 1m
memory: 10M
limits:
memory: 50M
volumeMounts:
- name: nginx-html
mountPath: /usr/share/nginx/html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ spec:
name: env-backend-secrets
ports:
- containerPort: 5000
resources: {}
resources:
requests:
cpu: 5m
memory: 960Mi
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 4Gi
{{- end }}
volumeMounts:
- mountPath: /home/app/.CombineFiles
name: backend-data
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/thecombine/charts/backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ global:
combineJwtSecretKey: "Override"
combineSmtpUsername: "Override"
combineSmtpPassword: "Override"
# Values for pulling container image from image registry
imagePullPolicy: "Override"
imageTag: "latest"
# Define the image registry to use (may be blank for local images)
imageRegistry: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ spec:
name: database
ports:
- containerPort: 27017
resources: {}
resources:
requests:
cpu: 25m
memory: 950Mi
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 2Gi
{{- end }}
volumeMounts:
- mountPath: /data/db
name: database-data
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/thecombine/charts/database/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ global:
# Update strategy should be "Recreate" or "Rolling Update"
updateStrategy: Recreate
pullSecretName: "None"
# Values for pulling container image from image registry
imagePullPolicy: "Override"
imageTag: "latest"
# Define the image registry to use (may be blank for local images)
imageRegistry: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ spec:
ports:
- containerPort: 80
- containerPort: 443
resources: {}
resources:
requests:
cpu: 1m
memory: 15M
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 40M
{{- end }}
volumeMounts:
- mountPath: /usr/share/nginx/fonts
name: font-data
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/thecombine/charts/frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ global:
pullSecretName: aws-login-credentials
# Update strategy should be "Recreate" or "Rolling Update"
updateStrategy: Recreate
# Values for pulling container image from image registry
imagePullPolicy: "Override"
imageTag: "latest"
# Define the image registry to use (may be blank for local images)
imageRegistry: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ spec:
- deployment/maintenance
- --
- combine-backup-job.sh
resources: {}
resources:
requests:
cpu: 200m
memory: 150M
limits:
memory: 150M
securityContext:
capabilities: {}
terminationMessagePath: /dev/termination-log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ spec:
configMapKeyRef:
key: local_font_url
name: env-maintenance
resources: {}
resources:
requests:
cpu: 200m
memory: 1200Mi
{{- if .Values.global.includeResourceLimits }}
limits:
memory: 4Gi
{{- end }}
volumeMounts:
- mountPath: {{ .Values.fontsDir }}
name: font-data
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/thecombine/charts/maintenance/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ global:
awsSecretAccessKey: "Override"
pullSecretName: "None"
awsS3Access: aws-s3-credentials
# Values for pulling container image from image registry
imagePullPolicy: "Override"
imageTag: "latest"
# Define the image registry to use (may be blank for local images)
imageRegistry: ""
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/thecombine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ global:
# Update strategy should be "Recreate" or "Rolling Update"
updateStrategy: Recreate

includeResourceLimits: false

aws-login:
enabled: true

Expand Down
1 change: 1 addition & 0 deletions deploy/scripts/setup_files/profiles/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ charts:
global:
imageRegistry: ""
imagePullPolicy: Never
includeResourceLimits: false
awsS3Location: dev.thecombine.app

ingressClass: nginx
Expand Down
1 change: 1 addition & 0 deletions deploy/scripts/setup_files/profiles/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ charts:
fontStorageAccessMode: ReadWriteMany
imagePullPolicy: Always
pullSecretName: None
includeResourceLimits: true
certManager:
enabled: false
cert-proxy-server:
Expand Down
1 change: 1 addition & 0 deletions deploy/scripts/setup_files/profiles/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ charts:
awsS3Location: prod.thecombine.app
fontStorageAccessMode: ReadWriteMany
imagePullPolicy: Always
includeResourceLimits: true
tlsSecretName: thecombine-app-tls
certManager:
enabled: false
2 changes: 0 additions & 2 deletions src/components/App/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { act, create } from "react-test-renderer";
import configureMockStore from "redux-mock-store";
import thunk from "redux-thunk";

import "tests/reactI18nextMock";

import { defaultState } from "components/App/DefaultState";
import App from "components/App/component";

Expand Down
2 changes: 0 additions & 2 deletions src/components/AppBar/tests/AppBarComponent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { MemoryRouter } from "react-router-dom";
import { act, create } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { defaultState } from "components/App/DefaultState";
import AppBar from "components/AppBar/AppBarComponent";

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/tests/Logo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ beforeAll(() => {
describe("Logo", () => {
it("navigates to Project Screen on click", () => {
testRenderer.root.findByType(Button).props.onClick();
expect(mockNavigate).toBeCalledWith(Path.ProjScreen);
expect(mockNavigate).toHaveBeenCalledWith(Path.ProjScreen);
});
});
2 changes: 0 additions & 2 deletions src/components/AppBar/tests/NavigationButtons.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { Provider } from "react-redux";
import renderer, { ReactTestInstance } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { Permission } from "api";
import NavigationButtons, {
dataCleanupButtonId,
Expand Down
2 changes: 0 additions & 2 deletions src/components/AppBar/tests/ProjectButtons.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Provider } from "react-redux";
import { ReactTestRenderer, act, create } from "react-test-renderer";
import configureMockStore, { MockStoreEnhanced } from "redux-mock-store";

import "tests/reactI18nextMock";

import { Permission } from "api/models";
import ProjectButtons, {
projButtonId,
Expand Down
2 changes: 0 additions & 2 deletions src/components/AppBar/tests/SpeakerMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Provider } from "react-redux";
import { act, create, ReactTestRenderer } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { Speaker } from "api/models";
import SpeakerMenu, { SpeakerMenuList } from "components/AppBar/SpeakerMenu";
import { defaultState } from "components/Project/ProjectReduxTypes";
Expand Down
2 changes: 0 additions & 2 deletions src/components/AppBar/tests/UserMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Provider } from "react-redux";
import { act, create, ReactTestRenderer } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import UserMenu, { UserMenuList } from "components/AppBar/UserMenu";
import { Path } from "types/path";

Expand Down
14 changes: 7 additions & 7 deletions src/components/Buttons/LoadingButton.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { Button, CircularProgress } from "@mui/material";
import { ButtonProps } from "@mui/material/Button";
import React, { ReactElement } from "react";
import { type ButtonProps } from "@mui/material/Button";
import { type ReactElement, type ReactNode } from "react";

import { themeColors } from "types/theme";

interface LoadingProps {
buttonProps?: ButtonProps & { "data-testid"?: string };
children?: React.ReactNode;
children?: ReactNode;
disabled?: boolean;
loading?: boolean;
}

/**
* A button that shows a spinning wheel when loading=true
*/
/** A button that shows a spinning wheel when `loading = true`.
* Default button props: `color: "primary", variant: "contained"`. */
export default function LoadingButton(props: LoadingProps): ReactElement {
return (
<Button
variant="contained"
color="primary"
disabled={props.disabled || props.loading}
variant="contained"
{...props.buttonProps}
>
{props.children}
Expand Down
2 changes: 0 additions & 2 deletions src/components/Buttons/tests/DeleteButtonWithDialog.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ReactTestRenderer, act, create } from "react-test-renderer";

import "tests/reactI18nextMock";

import DeleteButtonWithDialog from "components/Buttons/DeleteButtonWithDialog";
import { CancelConfirmDialog } from "components/Dialogs";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import renderer from "react-test-renderer";

import "tests/reactI18nextMock";

import DeleteEntry from "components/DataEntry/DataEntryTable/EntryCellComponents/DeleteEntry";

describe("DeleteEntry", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
create,
} from "react-test-renderer";

import "tests/reactI18nextMock";

import EntryNote from "components/DataEntry/DataEntryTable/EntryCellComponents/EntryNote";

const mockText = "Test text";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { Word } from "api/models";
import { SenseList } from "components/DataEntry/DataEntryTable/NewEntry/SenseDialog";
import StyledMenuItem from "components/DataEntry/DataEntryTable/NewEntry/StyledMenuItem";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { Word } from "api/models";
import StyledMenuItem from "components/DataEntry/DataEntryTable/NewEntry/StyledMenuItem";
import { VernList } from "components/DataEntry/DataEntryTable/NewEntry/VernDialog";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Provider } from "react-redux";
import { type ReactTestRenderer, act, create } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import {
GlossWithSuggestions,
VernWithSuggestions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
} from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { Word } from "api/models";
import { defaultState } from "components/App/DefaultState";
import {
Expand Down
2 changes: 0 additions & 2 deletions src/components/DataEntry/DataEntryTable/tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
} from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { Gloss, SemanticDomain, Sense, Word } from "api/models";
import { defaultState } from "components/App/DefaultState";
import DataEntryTable, {
Expand Down
2 changes: 0 additions & 2 deletions src/components/DataEntry/tests/DataEntryHeader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { Provider } from "react-redux";
import renderer, { ReactTestInstance } from "react-test-renderer";
import configureMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import { SemanticDomainFull } from "api/models";
import DataEntryHeader from "components/DataEntry/DataEntryHeader";
import { newSemanticDomain } from "types/semanticDomain";
Expand Down
4 changes: 1 addition & 3 deletions src/components/DataEntry/tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { Provider } from "react-redux";
import renderer from "react-test-renderer";
import createMockStore from "redux-mock-store";

import "tests/reactI18nextMock";

import DataEntry, {
smallScreenThreshold,
treeViewDialogId,
Expand Down Expand Up @@ -74,7 +72,7 @@ describe("DataEntry", () => {

it("fetches domain", async () => {
await renderDataEntry({ currentDomain: mockDomain });
expect(mockGetSemanticDomainFull).toBeCalledWith(
expect(mockGetSemanticDomainFull).toHaveBeenCalledWith(
mockDomain.id,
mockDomain.lang
);
Expand Down
7 changes: 1 addition & 6 deletions src/components/Dialogs/ButtonConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ export default function ButtonConfirmation(
</Button>
<LoadingButton
loading={loading}
buttonProps={{
onClick: onConfirm,
color: "primary",
variant: "contained",
id: props.buttonIdConfirm,
}}
buttonProps={{ id: props.buttonIdConfirm, onClick: onConfirm }}
>
{t("buttons.confirm")}
</LoadingButton>
Expand Down
Loading

0 comments on commit 71fbece

Please sign in to comment.