Skip to content

Commit

Permalink
♻️ Pull request comments
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw committed Mar 22, 2023
1 parent 4c9d1a1 commit 0d6346c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ Homarr uses [GitMoji](https://gitmoji.dev/).
We would appreciate it if everyone keeps their commit messages withing these rulings.

### Tests

> Components should be tested using unit tests. A unit is the smallest isolated part of the component. Unit tests must not have any dependencies and must be isolated.
- Place testfiles directly at the root of the unit
- Only test a single unit of work inside a unit test
- You may test multiple units inside one test file
Expand Down
1 change: 1 addition & 0 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');

module.exports = {
// https://www.i18next.com/overview/configuration-options#logging
i18n: {
defaultLocale: 'en',
locales: [
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ module.exports = withBundleAnalyzer({
},
reactStrictMode: true,
output: 'standalone',
i18n: i18n,
i18n,
});
8 changes: 8 additions & 0 deletions src/modules/Docker/ContainerActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
);
}

/**
* @deprecated legacy code
*/
function tryMatchType(imageName: string): ServiceType {
const match = MatchingImages.find(({ image }) => imageName.includes(image));
if (match) {
Expand All @@ -216,6 +219,11 @@ function tryMatchType(imageName: string): ServiceType {
return 'Other';
}

/**
* @deprecated
* @param container the container to match
* @returns a new service
*/
const tryMatchService = (container: Dockerode.ContainerInfo | undefined) => {
if (container === undefined) return {};
const name = container.Names[0].substring(1);
Expand Down
7 changes: 7 additions & 0 deletions src/tools/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MantineTheme } from '@mantine/core';

import { OptionValues } from '../modules/ModuleTypes';

export interface Settings {
Expand Down Expand Up @@ -74,6 +75,12 @@ export type ServiceType =
| 'Sabnzbd'
| 'NZBGet';

/**
* @deprecated
* @param name the name to match
* @param form the form
* @returns the port from the map
*/
export function tryMatchPort(name: string | undefined, form?: any) {
if (!name) {
return undefined;
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
environment: 'happy-dom',
coverage: {
provider: 'c8',
reporter: ['html'],
all: true,
exclude: ['.next/', '.yarn/', 'data/']
exclude: ['.next/', '.yarn/', 'data/'],
},
setupFiles: [
"./setupVitest.ts"
]
'./tests/setupVitest.ts',
],
},
});

0 comments on commit 0d6346c

Please sign in to comment.