Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic UI #35

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6cff943
first ui draft
Rdeisenroth Dec 21, 2023
31e8dd5
add card carousel
Rdeisenroth Dec 28, 2023
ea5fc89
improve overall page style
Rdeisenroth Dec 28, 2023
da44bd3
add stubs for other pages
Rdeisenroth Dec 28, 2023
5ad8b5c
improve button styles
Rdeisenroth Dec 28, 2023
e9f9888
remove unnecessary import
Rdeisenroth Dec 28, 2023
002e0b0
more style stuff
Rdeisenroth Dec 30, 2023
498a624
Merge branch 'fix/ktor-setup' into ui
Rdeisenroth Dec 30, 2023
d12e25c
add rubric schema
Rdeisenroth Jan 3, 2024
02b60d7
Merge branch 'master' into ui
Rdeisenroth Jan 7, 2024
f6a7b19
fix 406 error for rest endpoints
Rdeisenroth Feb 27, 2024
0e4f53b
fix content negation conflict
Rdeisenroth Feb 27, 2024
6e40cd0
prepare for gql in frontend
Rdeisenroth Feb 29, 2024
90570c8
Merge branch 'master' into ui
Rdeisenroth Mar 25, 2024
68c9d9f
add kotlin reflect dependency (for db references)
Rdeisenroth Mar 25, 2024
d56de00
add protobuf definitions for rubric
Rdeisenroth Mar 25, 2024
7794112
fix Appollo Cors in frontend
Rdeisenroth Mar 29, 2024
ebe987d
grab courses from backend
Rdeisenroth Mar 29, 2024
e3f7d00
add individual course page
Rdeisenroth Mar 29, 2024
fbe02cb
improve carousel css
Rdeisenroth Mar 29, 2024
07db5da
add package to protobuf files
Rdeisenroth Mar 29, 2024
00c1f80
preparations for rubrics
Rdeisenroth Mar 29, 2024
a05b138
Merge branch 'master' into ui
Rdeisenroth Apr 2, 2024
b8df6b3
fix eslint stuff
Rdeisenroth Apr 11, 2024
c125e47
add assignment and course member views
Rdeisenroth Apr 11, 2024
166b5d2
add row actions
Rdeisenroth Apr 11, 2024
b6a2c08
current state
Rdeisenroth Jun 18, 2024
51d1361
add basic rubric view
Rdeisenroth Jun 19, 2024
b559ab0
minor style improvements
Rdeisenroth Jun 19, 2024
7b8ce83
add pie chart
Rdeisenroth Jun 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apollo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
client: {
service: {
name: 'lab-hub',
url: 'http://localhost:8080/graphql'
},
includes: ['hub/ui/app/**/*.{ts,tsx}'],
}
};
102 changes: 77 additions & 25 deletions common/eslint-config-custom/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,83 @@ const project = resolve(process.cwd(), "tsconfig.json");
*/

module.exports = {
extends: [
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
"eslint-config-turbo",
].map(require.resolve),
parserOptions: {
project,
},
globals: {
React: true,
JSX: true,
},
settings: {
"import/resolver": {
typescript: {
extends: [
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
"eslint-config-turbo",
].map(require.resolve),
parserOptions: {
project,
},
},
},
ignorePatterns: ["node_modules/", "dist/"],
// add rules configurations here
rules: {
"import/no-default-export": "off",
},
globals: {
React: true,
JSX: true,
},
settings: {
"import/resolver": {
typescript: {
project,
},
},
},
ignorePatterns: ["node_modules/", "dist/", "__generated__"],
// add rules configurations here
rules: {
"import/no-default-export": "off",
"@typescript-eslint/no-unused-vars": "warn",
"unicorn/filename-case": "warn",
"import/no-extraneous-dependencies": "off", // since we define dependencies at top level this is not needed
"import/no-default-export": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-empty-function": "warn",
"camelcase": "warn",
"no-console": "warn",
"tsdoc/syntax": "off",
"react/jsx-key": "off",
"quotes": [
"error",
"double"
],
"linebreak-style": [
"error",
"unix"
],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
],
"object-curly-spacing": [
"warn",
"always"
],
"comma-spacing": [
"warn",
{
"before": false,
"after": true
}
],
},
};
6 changes: 6 additions & 0 deletions common/eslint-config-custom/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
92 changes: 72 additions & 20 deletions common/eslint-config-custom/react-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,79 @@ const project = resolve(process.cwd(), "tsconfig.json");
*/

module.exports = {
extends: [
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/react",
].map(require.resolve),
parserOptions: {
project,
},
globals: {
JSX: true,
},
settings: {
"import/resolver": {
typescript: {
extends: [
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/react",
].map(require.resolve),
parserOptions: {
project,
},
},
},
ignorePatterns: ["node_modules/", "dist/", ".eslintrc.js"],
globals: {
JSX: true,
},
settings: {
"import/resolver": {
typescript: {
project,
},
},
},
ignorePatterns: ["node_modules/", "dist/", ".eslintrc.js", "__generated__"],

rules: {
// add specific rules configurations here
},
rules: {
"import/no-default-export": "off",
"@typescript-eslint/no-unused-vars": "warn",
"unicorn/filename-case": "warn",
"import/no-extraneous-dependencies": "off", // since we define dependencies at top level this is not needed
"import/no-default-export": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"camelcase": "warn",
"no-console": "warn",
"tsdoc/syntax": "off",
"react/jsx-key": "off",
"quotes": [
"error",
"double"
],
"linebreak-style": [
"error",
"unix"
],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
],
"object-curly-spacing": [
"warn",
"always"
],
"comma-spacing": [
"warn",
{
"before": false,
"after": true
}
],
},
};
21 changes: 21 additions & 0 deletions common/eslint-config-custom/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Config } from 'tailwindcss'

const config: Config = {
content: [
'../../common/ui/components/**/*.{js,ts,jsx,tsx,mdx}',
'../../common/ui/lib/**/*.{js,ts,jsx,tsx,mdx}',
'../../common/ui/models/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
},
},
},
plugins: [],
}
export default config
33 changes: 33 additions & 0 deletions common/protobuf/criterion.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

import "number_range.proto";
import "point_range.proto";
import "test_run.proto";
import "criterion_accumulator.proto";
import "showcase_string.proto";

// Represents a criterion in a rubric.
message Criterion {
// The id of the criterion.
string id = 1;
// The name of the criterion.
ShowcaseString name = 2;
// The description of the criterion.
ShowcaseString description = 3;
// The possible amount of points that can be achieved.
NumberRange possible_points = 4;
// The points that have been achieved.
PointRange achieved_points = 5;
// The message displayed if the criterion is not fulfilled.
ShowcaseString message = 6;
// Tests used to determine the achieved points.
repeated TestRun tests = 7;
// The accumulator used to determine the achieved points.
CriterionAccumulator test_accumulator = 8;
// The children of the criterion.
repeated Criterion children = 9;
// The accumulator used to determine the achieved points of the children.
CriterionAccumulator children_accumulator = 10;
}
15 changes: 15 additions & 0 deletions common/protobuf/criterion_accumulator.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

// Enumerates the types of accumulators used to determine achieved points of a criterion.
enum CriterionAccumulator {
// Default accumulator: requires all tests to be successful.
AND = 0;
// Requires at least one test to be successful.
OR = 1;
// Requires no test to be successful.
NOT = 2;
// Adds 1 point for each successful test.
SUM = 3;
}
11 changes: 11 additions & 0 deletions common/protobuf/number_range.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

// Defines a range of numbers. The range is inclusive.
message NumberRange {
// Minimum value of the range (inclusive)
int32 min = 1;
// Maximum value of the range (inclusive)
int32 max = 2;
}
15 changes: 15 additions & 0 deletions common/protobuf/point_range.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

import "number_range.proto";

// Defines a range of points. The range is inclusive.
message PointRange {
oneof value {
// Single point value
int32 single = 1;
// Range of points
NumberRange range = 2;
}
}
24 changes: 24 additions & 0 deletions common/protobuf/rubric.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

import "point_range.proto";
import "criterion.proto";
import "showcase_string.proto";
import "number_range.proto";

// Represents a rubric containing criteria.
message Rubric {
// The id of the rubric.
string id = 1;
// The name of the rubric.
ShowcaseString name = 2;
// The description of the rubric.
ShowcaseString description = 3;
// The possible amount of points that can be achieved.
NumberRange possible_points = 4;
// The points that have been achieved.
PointRange achieved_points = 5;
// The criteria of the rubric.
repeated Criterion criteria = 6;
}
15 changes: 15 additions & 0 deletions common/protobuf/showcase_string.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

// Represents a string that can have both text and HTML representations.
message ShowcaseString {
oneof value {
// Simple text representation
string simple = 1;
// Text representation
string text = 2;
// HTML representation
string html = 3;
}
}
24 changes: 24 additions & 0 deletions common/protobuf/test_run.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";

package org.sourcegrade.lab.proto;

import "showcase_string.proto";
import "test_state.proto";

// Represents the result of a test.
message TestRun {
// The id of the test.
string id = 1;
// The name of the test.
string name = 2;
// The state of the test.
TestState state = 3;
// The message of the test.
ShowcaseString message = 4;
// The stacktrace of the test.
string stacktrace = 5;
// The duration of the test in milliseconds.
int64 duration = 6;
// The children of the test.
repeated TestRun children = 7;
}
Loading