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

TIDO v5: show panels wrapper which contains text and switch between different types of text content #533

Merged
merged 60 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
30b4ec3
chore: import css files to use default TIDO and tailwind css
Nov 28, 2024
bbf544b
chore: define a basic default config
Nov 28, 2024
1015aa9
feat: add ConfigContext in the App
Nov 28, 2024
9fad0de
chore: use absolute path in the project
Nov 28, 2024
6b1ad4a
chore: movethe configuration of absolute path to tsconfig.json
Nov 28, 2024
72001c8
feat: add text on each panel for each pre-configured panel
Nov 29, 2024
dca9e88
feat: switch the text tab using buttons toggle
Nov 29, 2024
640991e
refactor: create a new component for the Text Switching buttons
Nov 29, 2024
7182af5
chore: remove unneccessary span
Nov 29, 2024
faf367d
chore: add primereact as dev dependency
Dec 2, 2024
8463aae
chore: remove the import of primeicons
Dec 2, 2024
a749063
chore: configure 'single' quotes in eslint config file
Dec 2, 2024
3321f4e
style: convert the 'double' to 'single' quotes
Dec 2, 2024
1b80a18
style: convert the 'double quotes' to 'single quotes' for the PanelsW…
Dec 2, 2024
5c4757e
refactor: define the ConfigProvider as a separate component and updat…
Dec 3, 2024
6dde4f9
refactor: differentiate between collection or manifest by using the a…
Dec 3, 2024
ca6b896
wip(types): add panel config interface
Dec 3, 2024
6cb5a5c
chore: make the config smaller temporarily
Dec 4, 2024
d04af4e
chore: add types in the Panel component
Dec 4, 2024
2be3ab0
chore: add types in ContentTypesToggle component
Dec 4, 2024
35f1192
chore: add further Typescript types to components
Dec 4, 2024
5cb2e44
refactor: add two separate functions getManifestUrl() and getCollecti…
Dec 4, 2024
651b43e
chore: adapt a few things regarding types
Dec 4, 2024
02da22b
chore: add types in CustomHTML component
Dec 4, 2024
9b9a878
refactor: reassign content types by using array map function
Dec 5, 2024
58b7172
style: use tailwind size instead of pixels
Dec 5, 2024
b32c64a
style: rename the textType of item content to contentType
Dec 5, 2024
e67e003
refactor: rewrite the declaration of text - CustomHTML in Panel
Dec 5, 2024
ab35663
wip(loadConfig): accumulate default and custom config
Dec 5, 2024
b4e904a
chore(errorHandling): add an error component
Dec 5, 2024
703f584
chore: add error handling when loading document and item data in Pane…
Dec 6, 2024
6861f14
refactor: move readHtml() and getUrlActiveText() to utils panel file
Dec 6, 2024
f17a8ff
chore: add an example of custom config
Dec 6, 2024
0d3bc07
refactor: use index to toggle between text content types in Panel
Dec 6, 2024
285a19d
chore: restore the value in include in tsconfig
Dec 6, 2024
4f4df05
refactor: remove sass
paulpestov Dec 6, 2024
d331e29
refactor: use ESLint correctly
paulpestov Dec 6, 2024
ad3afca
refactor: update CI script
paulpestov Dec 6, 2024
a16ff7d
style: rename the type for panel config to PanelConfig
Dec 8, 2024
a10a199
refactor: rewrite App component as FC component using an interface fo…
Dec 8, 2024
7bb74d7
chore: remove updateConfig in ConfigContext, instead just use setConfig
Dec 8, 2024
c0f7771
refactor: remove redundant initOpenedPanels()
Dec 9, 2024
30d4c4a
chore: add small eslint fixes
Dec 9, 2024
ed5232c
chore: include error handling in get() which fetches api data
Dec 9, 2024
5d3e22c
refactor: rewrite the logic of getting the item url: 1. we get the ma…
Dec 9, 2024
e925221
feat: introduce error handling for fetch request
Dec 10, 2024
cddbfbc
refactor: remove useEffect in PanelsWrapper() since its not necessary
Dec 10, 2024
8710611
style: remove semicolons
Dec 11, 2024
119d2a6
chore: add widthText as prop to CustomHTML component to show the text…
Dec 11, 2024
fc4caca
refactor: assign only one task to isDataFetchedCorrectly, which retur…
Dec 11, 2024
ee60244
refactor: add try catch in Panel.tsx when receiving the response
Dec 11, 2024
590a149
refactor: rewrite getManifestUrl()
Dec 11, 2024
76c7e42
wip(read Data): restructure readData, use the entrypoint as an object
Dec 11, 2024
a21954b
refactor(read Data): write separate function for reading Manifest and…
Dec 11, 2024
1bccadf
refactor: update http client for type safety
paulpestov Dec 11, 2024
585a342
chore: make app component cleaner
Dec 12, 2024
fdcb737
refactor: use clicked index to update the active content text index
Dec 12, 2024
8728873
refactor: write more compact/pure the function assignContentTypes()
Dec 12, 2024
42c36d5
chore: remove unnecessary function getActiveContentUrl()
Dec 12, 2024
d81f4c0
refactor: update linting rules and code style
paulpestov Dec 12, 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
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Node.js CI

on:
push:
branches: [ "develop", "main-variants" ]
branches: [ "develop", "next" ]
pull_request:
branches: [ "develop", "main", "main-variants" ]
branches: [ "develop", "main", "next" ]
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -45,10 +45,10 @@ jobs:
run: npm ci
- name: Run Linting
run: npm run lint
- name: Run tests
run: |
npm run start:mock-api &
npm run test
# - name: Run tests
# run: |
# npm run start:mock-api &
# npm run test
# - name: Save test video folder
# if: always()
# uses: actions/upload-artifact@v4
Expand Down
20 changes: 0 additions & 20 deletions .stylelintrc

This file was deleted.

38 changes: 24 additions & 14 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from "@eslint/js";
import globals from "globals";
import react from 'eslint-plugin-react';
import reactHooks from "eslint-plugin-react-hooks";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ["dist"] },
{
ignores: ['/dist', '/tests'],
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
react,
"react-hooks": reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
"react/jsx-curly-spacing": ["error", {"when": "never"}],
"react/jsx-equals-spacing": ["error", "never"],
"react/function-component-definition": ["error", { "namedComponents": "arrow-function" }],
"@/quotes": [
"error",
"single",
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
semi: ["error", "never"],
"object-curly-spacing": ["error", "always"]
},
},
)
}
);
15 changes: 13 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@
<script type="module" src="/src/main.tsx"></script>
<script>
window.addEventListener('load', function () {
window.tido = new window.Tido();
});
window.tido = new window.Tido({
globalTree: true,
panels: [
{
entrypoint: {
url: 'https://api.ahiqar.sub.uni-goettingen.de/textapi/ahiqar/syriac/collection.json',
type: 'collection'
}
}
],
}
)
})
</script>
</body>
</html>
7 changes: 1 addition & 6 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
"compilerOptions": {}
}
Loading
Loading