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

Update preflights and format everything #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ exclude =
old,
build,
dist
venv
max-line-length = 200
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ src/resources
venv
node_modules
translations/static
package-lock.json
package-lock.json
.pytest_cache
.vscode
commaLinkList.html
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"tabWidth": 4,
"overrides": [
{
"files": "**/*.html",
"files": "src/**/*.html",
"options": { "parser": "lwc" }
}
]
Expand Down
2 changes: 1 addition & 1 deletion biblia/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'biblia.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblia.settings")

application = get_asgi_application()
1 change: 1 addition & 0 deletions biblia/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import os

import dj_database_url
import dotenv

Expand Down
4 changes: 2 additions & 2 deletions biblia/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path("", include("translations.urls")),
Expand Down
2 changes: 1 addition & 1 deletion biblia/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'biblia.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblia.settings")

application = get_wsgi_application()
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'biblia.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblia.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand All @@ -17,5 +17,5 @@ def main():
execute_from_command_line(sys.argv)


if __name__ == '__main__':
if __name__ == "__main__":
main()
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@
],
"license": "MIT",
"lint-staged": {
"**/*.{css,html,js,json,md,ts,yaml,yml}": [
"**/*.{css,js,json,md,ts,yaml,yml}": [
"prettier --write"
],
"src/**/*.html": [
"prettier --write"
],
"./src/**/*.js": [
"eslint"
],
"**/*.py": [
"isort",
"black",
"flake8"
]
Expand All @@ -47,8 +51,8 @@
"build": "lwc-services build -m production -w webpack.config.js",
"build:development": "lwc-services build -w webpack.config.js",
"lint": "eslint ./src/**/*.js",
"prettier": "prettier --write \"**/*.{css,html,js,json,md,ts,yaml,yml}\"",
"prettier:verify": "prettier --list-different \"**/*.{css,html,js,json,md,ts,yaml,yml}\"",
"prettier": "prettier --write \"**/*.{css,js,json,md,ts,yaml,yml}\" \"src/**/*.html\"",
"prettier:verify": "prettier --list-different \"**/*.{css,js,json,md,ts,yaml,yml}\" \"src/**/*.html\"",
"test:unit": "lwc-services test:unit",
"test:unit:coverage": "lwc-services test:unit --coverage",
"test:unit:debug": "lwc-services test:unit --debug",
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool.isort]
profile = "black"
multi_line_output = 3

[tool.black]
line-length = 88
target-version = ['py38']
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
black
flake8
isort
isort
11 changes: 8 additions & 3 deletions src/modules/bib/addVolume/addVolume.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { LightningElement, track } from 'lwc';
import { createRecord, getRecordUiUrl, getRecordApiUrl, getRecordsFromApi } from 'bib/drf';
import {
createRecord,
getRecordUiUrl,
getRecordApiUrl,
getRecordsFromApi
} from 'bib/drf';
import { Feature } from 'bib/feature';

export default class AddVolume extends LightningElement {
Expand Down Expand Up @@ -44,8 +49,8 @@ export default class AddVolume extends LightningElement {

async connectedCallback() {
// Start async loads of data from DRF to improve responsiveness.
await getRecordsFromApi("persons");
await getRecordsFromApi("texts");
await getRecordsFromApi('persons');
await getRecordsFromApi('texts');
}

// Change Handlers
Expand Down
32 changes: 24 additions & 8 deletions src/modules/bib/dataTable/dataTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
<th scope="col"></th>
</template>
<template for:each={columns} for:item="col">
<th scope="col" key={col.id} data-col={col.id} onclick={handleColumnClick}>
<th
scope="col"
key={col.id}
data-col={col.id}
onclick={handleColumnClick}
>
{col.name}
<template if:true={col.isSortedAscending}><small class="ml-1">▲</small></template>
<template if:true={col.isSortedAscending}>
<small class="ml-1">▲</small>
</template>
<template if:true={col.isSortedDescending}>
<small class="ml-1">▼</small>
</template>
Expand All @@ -21,8 +28,12 @@
<tr key={rec.record.id}>
<template if:true={allowsSelection}>
<td>
<input type="checkbox" data-record={rec.id} onchange={handleSelectionChange}
value={rec.selected} />
<input
type="checkbox"
data-record={rec.id}
onchange={handleSelectionChange}
value={rec.selected}
/>
</td>
</template>
<template for:each={rec.values} for:item="entry">
Expand All @@ -41,8 +52,13 @@
{entry.value}
</template>
<template if:true={entry.isPillListType}>
<template for:each={entry.value} for:item="pill">
<span key={pill.id} class={pill.pillClass}>{pill.value}</span>
<template
for:each={entry.value}
for:item="pill"
>
<span key={pill.id} class={pill.pillClass}
>{pill.value}</span
>
</template>
</template>
</td>
Expand All @@ -51,6 +67,6 @@
</template>
</tbody>
</table>
<hr>
<hr />
<small class="text-muted">Showing {recordsShown} of {recordCount}.</small>
</template>
</template>
Loading