Merge pull request #210 from kimatata/develop

This commit is contained in:
kimatata
2025-04-12 23:55:57 +09:00
committed by GitHub
13 changed files with 4370 additions and 3090 deletions

View File

@@ -1,29 +0,0 @@
version: 2
updates:
# root
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
# frontend
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
target-branch: "develop"
# backend
- package-ecosystem: "npm"
directory: "/backend"
schedule:
interval: "weekly"
target-branch: "develop"
# docs
- package-ecosystem: "npm"
directory: "/docs"
schedule:
interval: "weekly"
target-branch: "develop"

88
eslint.config.mjs Normal file
View File

@@ -0,0 +1,88 @@
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginReact from 'eslint-plugin-react';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import * as eslintPluginImport from 'eslint-plugin-import';
import eslintPluginUnusedImports from 'eslint-plugin-unused-imports';
import eslintPluginOnlyWarn from 'eslint-plugin-only-warn';
import eslintPluginNext from '@next/eslint-plugin-next';
export default tseslint.config(
{
name: 'unittcms/ignore-globally',
ignores: ['**/node_modules/', '**/.next/', '**/docs/'],
},
{
name: 'unittcms/load-plugins',
languageOptions: {
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
import: eslintPluginImport,
'unused-imports': eslintPluginUnusedImports,
react: eslintPluginReact,
'react-hooks': eslintPluginReactHooks,
'@next/next': eslintPluginNext,
'only-warn': eslintPluginOnlyWarn,
},
settings: {
react: {
version: 'detect',
},
next: {
rootDir: './*',
},
},
},
// Following settings ar on/off rules
{
name: 'unittcms/global-tuning',
extends: [eslint.configs.recommended],
rules: {
'import/order': 'error',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
},
{
name: 'unittcms/for-typescript',
files: ['**/*.ts', '**/*.tsx'],
extends: [
tseslint.configs.strict,
eslintPluginReact.configs.flat.recommended,
eslintPluginReact.configs.flat['jsx-runtime'],
],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-namespace': 'off',
'react/prop-types': 'off',
...eslintPluginReactHooks.configs.recommended.rules,
},
},
{
name: 'unittcms/for-nextjs',
files: ['frontend/**/*.{ts,tsx,js,jsx}'],
rules: {
...eslintPluginNext.configs.recommended.rules,
...eslintPluginNext.configs['core-web-vitals'].rules,
},
},
{
name: 'eslint-config-prettier',
...eslintConfigPrettier,
}
);

View File

@@ -223,7 +223,7 @@
"download": "Download", "download": "Download",
"delete_file": "Delete file", "delete_file": "Delete file",
"click_to_upload": "Click to upload", "click_to_upload": "Click to upload",
"or_drag_and_drop": "or drag and drop", "or_drag_and_drop": " or drag and drop",
"max_file_size": "Max. file size", "max_file_size": "Max. file size",
"are_you_sure_leave": "Are you sure you want to leave the page?" "are_you_sure_leave": "Are you sure you want to leave the page?"
}, },

File diff suppressed because it is too large Load Diff

View File

@@ -22,8 +22,6 @@
"boring-avatars": "^1.11.2", "boring-avatars": "^1.11.2",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"eslint": "8.57.1",
"eslint-config-next": "14.2.24",
"framer-motion": "^11.18.2", "framer-motion": "^11.18.2",
"intl-messageformat": "^10.7.15", "intl-messageformat": "^10.7.15",
"lucide-react": "^0.475.0", "lucide-react": "^0.475.0",

View File

@@ -9,7 +9,7 @@ type Props = {
}; };
export default function DemoImage({ imageName, altText }: Props) { export default function DemoImage({ imageName, altText }: Props) {
const { theme, setTheme } = useTheme(); const { theme } = useTheme();
const [currentTheme, setCurrentTheme] = useState('light'); const [currentTheme, setCurrentTheme] = useState('light');
useEffect(() => { useEffect(() => {
@@ -20,13 +20,7 @@ export default function DemoImage({ imageName, altText }: Props) {
return ( return (
<> <>
<Image <Image src={`/top/${currentTheme}/${imageName}.png`} alt={altText} shadow="md" className="max-w-full" />
src={`/top/${currentTheme}/${imageName}.png`}
alt={altText}
height={500}
shadow="md"
className="max-w-full"
/>
</> </>
); );
} }

View File

@@ -94,7 +94,7 @@ export default function HeaderNavbarMenu({ messages, locale }: Props) {
<NavbarItem className="hidden md:block"> <NavbarItem className="hidden md:block">
<Chip size="sm" variant="flat"> <Chip size="sm" variant="flat">
<Link className="data-[active=true]:text-primary data-[active=true]:font-medium" href="/" locale={locale}> <Link className="data-[active=true]:text-primary data-[active=true]:font-medium" href="/" locale={locale}>
1.0.0-beta.9 1.0.0-beta.10
</Link> </Link>
</Chip> </Chip>
</NavbarItem> </NavbarItem>

View File

@@ -99,7 +99,7 @@ export default function Home({ params }: PageType) {
<Divider className="my-12" /> <Divider className="my-12" />
<div className="w-full text-center py-2"> <div className="w-full text-center py-2">
<div>Copyright © 2024 UnitTCMS</div> <div>Copyright © 2024-present UnitTCMS</div>
</div> </div>
</section> </section>
); );

View File

@@ -190,6 +190,25 @@ export default function CaseEditor({
} }
}; };
const onStepUpdate = (stepId: number, changeStep: StepType) => {
if (changeStep.editState === 'notChanged') {
changeStep.editState = 'changed';
}
if (testCase.Steps) {
setTestCase({
...testCase,
Steps: testCase.Steps.map((step) => {
if (step.id === stepId) {
return changeStep;
} else {
return step;
}
}),
});
}
};
useEffect(() => { useEffect(() => {
async function fetchDataEffect() { async function fetchDataEffect() {
if (!tokenContext.isSignedIn()) { if (!tokenContext.isSignedIn()) {
@@ -394,20 +413,7 @@ export default function CaseEditor({
<CaseStepsEditor <CaseStepsEditor
isDisabled={!tokenContext.isProjectDeveloper(Number(projectId))} isDisabled={!tokenContext.isProjectDeveloper(Number(projectId))}
steps={testCase.Steps} steps={testCase.Steps}
onStepUpdate={(stepId, changeStep) => { onStepUpdate={onStepUpdate}
if (testCase.Steps) {
setTestCase({
...testCase,
Steps: testCase.Steps.map((step) => {
if (step.id === stepId) {
return changeStep;
} else {
return step;
}
}),
});
}
}}
onStepPlus={onPlusClick} onStepPlus={onPlusClick}
onStepDelete={onDeleteClick} onStepDelete={onDeleteClick}
messages={messages} messages={messages}

View File

@@ -35,7 +35,7 @@ export default function StepsEditor({ isDisabled, steps, onStepUpdate, onStepPlu
label={messages.detailsOfTheStep} label={messages.detailsOfTheStep}
value={step.step} value={step.step}
onValueChange={(changeValue) => { onValueChange={(changeValue) => {
onStepUpdate(step.id, { ...step, step: changeValue, editState: 'changed' }); onStepUpdate(step.id, { ...step, step: changeValue });
}} }}
/> />
</div> </div>
@@ -46,7 +46,7 @@ export default function StepsEditor({ isDisabled, steps, onStepUpdate, onStepPlu
label={messages.expectedResult} label={messages.expectedResult}
value={step.result} value={step.result}
onValueChange={(changeValue) => { onValueChange={(changeValue) => {
onStepUpdate(step.id, { ...step, result: changeValue, editState: 'changed' }); onStepUpdate(step.id, { ...step, result: changeValue });
}} }}
/> />
</div> </div>

View File

@@ -1,8 +1,3 @@
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
/* TODO Temporary use until NextUI's Toast is released. */
.Toastify__toast-body {
font-family: 'systems-ui';
}

4663
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,17 +7,29 @@
"test": "vitest", "test": "vitest",
"coverage": "vitest run --coverage", "coverage": "vitest run --coverage",
"e2e": "playwright test", "e2e": "playwright test",
"report": "playwright show-report" "report": "playwright show-report",
"lint": "eslint",
"lint:fix": "eslint --fix"
}, },
"devDependencies": { "devDependencies": {
"@next/eslint-plugin-next": "^15.3.0",
"@playwright/test": "^1.48.2", "@playwright/test": "^1.48.2",
"@types/node": "^22.8.1", "@types/node": "^22.8.1",
"@vitest/coverage-v8": "^1.6.0", "@vitest/coverage-v8": "^1.6.0",
"eslint": "^9.24.0",
"eslint-config-next": "^15.3.0",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-unused-imports": "^4.1.4",
"express": "^4.21.0", "express": "^4.21.0",
"globals": "^16.0.0",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"sequelize": "^6.37.4", "sequelize": "^6.37.4",
"sqlite3": "^5.1.7", "sqlite3": "^5.1.7",
"supertest": "^7.0.0", "supertest": "^7.0.0",
"typescript-eslint": "^8.24.1",
"vitest": "^1.6.0" "vitest": "^1.6.0"
} }
} }