Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
d0dabb4
InitialCommit
invalid-email-address Jan 16, 2024
db66b41
DB接続用の設定、SQLの修正、変数名が誤字っていたのを修正しました。
Indie-Kimura Jan 16, 2024
c1d7144
gitファイル
Indie-Kimura Jan 16, 2024
98ed9a0
必要モジュールの更新
Indie-Kimura Jan 16, 2024
6f007a1
ログイン処理の実装
Indie-Kimura Jan 16, 2024
49963d1
load_userの修正
Indie-Kimura Jan 17, 2024
729e356
・ログアウト機能、ユーザー情報ロード機能
Indie-Kimura Jan 29, 2024
100b6ae
blueprintを導入して、moduleごとにファイルを分けました。
Indie-Kimura Jan 29, 2024
7312156
flaskのdebugモードをオンにします。
Indie-Kimura Jan 30, 2024
a4cca11
とりあえず画面が出る。
Indie-Kimura Feb 2, 2024
af50ba8
バグ修正
Indie-Kimura Feb 2, 2024
cd1f0cb
Merge commit 'af50ba8c01a6c934df5089d9f296f3fb245bc65d' into fix/admi…
invalid-email-address Feb 5, 2024
2a13b01
命名規則としてはシークエンスは"affiliation_id_id_seq"が正しかったので修正します
Indie-Kimura Feb 6, 2024
88cfe3c
アイテム登録画面の描画用のjpcoar2.0スキーマを2つ追加
Indie-Kimura Feb 9, 2024
a88e5a0
フロント部分の項目追加機能、項目削除機能、パネル部分のトグル機能を追加
Indie-Kimura Feb 14, 2024
de02230
cssの修正
Indie-Kimura Feb 14, 2024
5f616b8
conflict fix .gitignore
invalid-email-address Feb 14, 2024
f40779f
Merge pull request #1 from ivis-teraoka/main
ivis-teraoka Feb 14, 2024
146e63a
ファイルアップロード、ファイルドラッグアンドドロップ機能の追加
Indie-Kimura Feb 15, 2024
d408ca7
オーバーレイリポジトリ 管理者画面
kanon-yoneji Feb 16, 2024
36b14f8
アイテム登録画面のform全体のreactを作成
Indie-Kimura Feb 16, 2024
cfdbc61
・アイテム登録時、一時フォルダなしでメモリ内でコンテンツファイル、サムネイル、xmlを書き出し、zipを生成する処理に修正
Indie-Kimura Feb 19, 2024
3e1c533
zipファイルをrequestで他リポジトリに投げる処理を追加しました。
Indie-Kimura Feb 19, 2024
0aa90c1
uwsgi-nginxテスト
Indie-Kimura Feb 19, 2024
3331fd6
とりあえずnginx-uwsgi-flask構造になった。
Indie-Kimura Feb 20, 2024
6801c19
db接続先設定のハードコードではなくしました。
Indie-Kimura Feb 20, 2024
92b7942
dockerのバインドをnginxにもすることにしたため、nginxでもstaticファイルを読み込めるようにした。
Indie-Kimura Feb 20, 2024
cade748
Merge pull request #1 from Indie-Kimura/test-uwsgi-nginx
Indie-Kimura Feb 20, 2024
9a0dab3
管理者が機関を追加する処理、プルダウンの追加処理
kanon-yoneji Feb 21, 2024
399247f
footerとタイトル修正
kanon-yoneji Feb 21, 2024
aed41e2
Merge pull request #4 from kanon-yoneji/fix/admin_setting
ivis-teraoka Feb 21, 2024
0c0bafb
Merge branch 'current' into development(1)(2)(3)
ivis-teraoka Feb 21, 2024
e189566
Merge pull request #3 from Indie-Kimura/development(1)(2)(3)
ivis-teraoka Feb 21, 2024
fe7267c
管理者が機関を追加する処理、プルダウンの追加処理
kanon-yoneji Feb 21, 2024
edfd774
Revert "管理者が機関を追加する処理、プルダウンの追加処理"
kanon-yoneji Feb 21, 2024
3c5cf6c
Revert "Revert "管理者が機関を追加する処理、プルダウンの追加処理""
kanon-yoneji Feb 21, 2024
b7a8a12
タイトル修正
kanon-yoneji Feb 21, 2024
3216c4b
fixed conflict
kanon-yoneji Feb 21, 2024
fdb8ecc
Merge pull request #5 from kanon-yoneji/fix/admin_setting
ivis-teraoka Feb 21, 2024
c9e8b79
views.py
kanon-yoneji Feb 21, 2024
d00bf6a
Merge pull request #6 from kanon-yoneji/fix/admin_setting
ivis-teraoka Feb 21, 2024
18b1010
fixed conflict
kanon-yoneji Feb 22, 2024
7d0c5f1
fixed conflict
kanon-yoneji Feb 22, 2024
f1f2b7b
間違えてプッシュしてしまったものの修正
kanon-yoneji Feb 22, 2024
8366039
間違えてプッシュしてしまったものの修正
kanon-yoneji Feb 22, 2024
65e7f10
フロントエンド
Indie-Kimura Feb 22, 2024
b6e92cc
環境変数に一時ファイル置き場を追加
Indie-Kimura Feb 22, 2024
1d83924
モーダルの追加
Indie-Kimura Feb 26, 2024
342335f
react-modalのcss調整、
Indie-Kimura Feb 27, 2024
6bc5acf
とりあえず動作版
Indie-Kimura Feb 27, 2024
20cd3ce
Merge pull request #7 from Indie-Kimura/development(1)(2)(3)
ivis-teraoka Feb 27, 2024
45ec313
pdf read
invalid-email-address Feb 27, 2024
e80013c
resolve conflict
invalid-email-address Feb 27, 2024
c8eda59
自動入力用の修正を加えた。
Indie-Kimura Feb 28, 2024
1d89105
コンポーネントの並び順を変更
Indie-Kimura Feb 28, 2024
f32df4c
Merge branch 'ivis-weko3-dev:main' into devlopment-(1)(2)(3)
Indie-Kimura Feb 29, 2024
1cbc8bf
Merge pull request #8 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Feb 29, 2024
b5e294f
fix js in ajax
invalid-email-address Feb 29, 2024
e73bdcc
update git ignore
invalid-email-address Feb 29, 2024
d5c87c7
resolve conflict
invalid-email-address Feb 29, 2024
506e830
Merge pull request #9 from ivis-teraoka/current
ivis-teraoka Feb 29, 2024
428ad72
ファイルの構造を単体テストが実行しやすいように変更
Indie-Kimura Feb 29, 2024
5c2ed04
仮のtox構成
Indie-Kimura Feb 29, 2024
b02ea91
モデルモジュール分け
Indie-Kimura Mar 1, 2024
7e7a556
tox(単体テスト)を流すのに必要なファイルを用意しました。
Indie-Kimura Mar 1, 2024
edd53b3
不要なprint文を削除しました。
Indie-Kimura Mar 1, 2024
97247b4
models.pyを分けた際の修正が漏れていたため修正しました。
Indie-Kimura Mar 1, 2024
fe175fb
pdf自動入力用のスキーマを追加しました。
Indie-Kimura Mar 1, 2024
c3e0dbd
・pdfからの自動入力をフロント側で対応しました。
Indie-Kimura Mar 2, 2024
3c252c3
・自動入力時エラーとなった場合、モーダルに表示されます。
Indie-Kimura Mar 2, 2024
1300dd9
pdfエラー時のモーダル表示を修正
Indie-Kimura Mar 4, 2024
9827571
Merge pull request #10 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 4, 2024
fe245ef
・外部モジュールであるgrobid_clientをsrcフォルダに移動しました。
Indie-Kimura Mar 4, 2024
f186a2f
単体テスト用のrequirementsを更新しました。
Indie-Kimura Mar 4, 2024
06586a7
・単体テストのconftestのテンプレートを作成しました。
Indie-Kimura Mar 4, 2024
a4aaf8b
requirementsにmock、pytest-mockを追加しました。
Indie-Kimura Mar 4, 2024
513b15d
postgres用のsqlの修正です。
Indie-Kimura Mar 4, 2024
c2cdccd
自動入力で上書きできるやつ
Indie-Kimura Mar 4, 2024
2f1d24e
Merge branch 'current' of https://github.com/ivis-weko3-dev/jairoclou…
kanon-yoneji Mar 4, 2024
a2384ca
・depositor_modelsの単体テストコード
Indie-Kimura Mar 5, 2024
e59a71e
Merge pull request #11 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 5, 2024
52477e5
Merge branch 'current' of https://github.com/ivis-weko3-dev/jairoclou…
kanon-yoneji Mar 5, 2024
4fb1c7a
depositor_loginモジュールの単体テストコード
Indie-Kimura Mar 5, 2024
2869a5c
Merge pull request #1 from Indie-Kimura/devlopment-(1)(2)(3)
kanon-yoneji Mar 5, 2024
22b9930
depositor_item_register単体テストコード途中
Indie-Kimura Mar 5, 2024
fa06304
depositor_item_registerの単体テストコード
Indie-Kimura Mar 5, 2024
9299eb3
depositor_item_register単体テストコードの修正
Indie-Kimura Mar 6, 2024
76c295a
ext.pyをcoverage100%にする変更
Indie-Kimura Mar 6, 2024
074f2ca
パスワードがモックとはいえpython側で固定なのはよくなかった。なので環境変数で指定できるようにします。
Indie-Kimura Mar 6, 2024
43bf452
・ハイライトをwekoと同じ色に変更しました。
Indie-Kimura Mar 6, 2024
d88d28f
item_registerの単体テストコード100%完了
Indie-Kimura Mar 7, 2024
eaff173
単体テストコード追加、コード修正
kanon-yoneji Mar 7, 2024
808a41d
Merge pull request #13 from kanon-yoneji/fix/admin_setting
ivis-teraoka Mar 7, 2024
51f2a88
Merge pull request #12 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 7, 2024
faf616e
ext.pyカバレッジ100%修正
kanon-yoneji Mar 7, 2024
8901979
Merge pull request #14 from kanon-yoneji/fix/admin_setting
ivis-teraoka Mar 7, 2024
c69f9e6
jpcoar2.0の統制語彙から抜けがあったので追加
Indie-Kimura Mar 7, 2024
10d37fc
xml化するキーリストからjpcoar:contributorが抜けていたため追加します。
Indie-Kimura Mar 8, 2024
a471bd6
権利者情報>権利者名のjsonschemaが間違っていたため修正します。
Indie-Kimura Mar 8, 2024
56f2dea
・xml化する際、キーとキーが一致しなくても値をなる場合を処理できていなかったのでその処理を追加します。
Indie-Kimura Mar 8, 2024
675e4d6
バグ修正に伴う単体テストコード修正です。
Indie-Kimura Mar 8, 2024
b34ecb4
Merge pull request #15 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 8, 2024
3141997
バグ修正
kanon-yoneji Mar 8, 2024
9b57348
Merge pull request #16 from kanon-yoneji/fix/admin_setting
ivis-teraoka Mar 8, 2024
adb7947
install.shにおいてdocker-composeが使われていましたが、docker composeに変更します。
Indie-Kimura Mar 11, 2024
d4dedef
Merge pull request #17 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 11, 2024
9a392bc
W2023-41-014のバグ修正です。
Indie-Kimura Mar 12, 2024
93ed5f6
変数名、メソッド名のケースをキャメルケースに統一
Indie-Kimura Mar 12, 2024
45011dd
・app.jsの不要なコメントを削除
Indie-Kimura Mar 12, 2024
55169d4
jsdocをある程度追加しました。
Indie-Kimura Mar 12, 2024
d7ffef7
Merge pull request #18 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 12, 2024
bcf309f
weko、invenioは関係ないので変数名、ファイル名を変更します。
Indie-Kimura Mar 13, 2024
664750b
Merge pull request #19 from Indie-Kimura/devlopment-(1)(2)(3)
ivis-teraoka Mar 14, 2024
8afa0a7
Merge pull request #1 from ivis-weko3-dev/W2023-41
iviskazukiakashi Mar 19, 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
129 changes: 8 additions & 121 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,160 +1,47 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so
*.pyc

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
# lib/
# lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

app/tmp/*

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.pytest_cache/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
*.db
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM python:3.12-slim-bookworm
WORKDIR /code
ENV FLASK_APP=app
ENV FLASK_DEBUG=1
RUN adduser --uid 1000 --disabled-password --gecos '' depositor

COPY /app/requirements.txt ./
# COPY /app/requirements-depositor-modules.txt ./

ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/code/app

ENV PYTHONPATH=$PYTHONPATH:/code/app/modules/depositor_admin_setting
ENV PYTHONPATH=$PYTHONPATH:/code/app/modules/depositor_item_register
ENV PYTHONPATH=$PYTHONPATH:/code/app/modules/depositor_login
ENV PYTHONPATH=$PYTHONPATH:/code/app/modules/depositor_models
ENV PYTHONPATH=$PYTHONPATH:/code/src/grobid_client

ENV DEPOSITOR_WEB_HOST=127.0.0.1
ENV DEPOSITOR_POSTGRESQL_HOST=postgresql
ENV DEPOSITOR_POSTGRESQL_DBNAME=depositor
ENV DEPOSITOR_POSTGRESQL_DBUSER=depositor
ENV DEPOSITOR_POSTGRESQL_DBPASS=dbpass123

# shibbolethログインがモックの為、パスワードは固定値
ENV MOCK_PASSWORD=testpass
# 一時ファイルを置くフォルダのパス、コンテナ内のフォルダを参照しているため絶対パスで指定するとコンテナ内でのみ一時フォルダが生成される。
# マウントされている位置のパスを指定するとローカルにも保存される。
ENV TMPORARY_FILE_PATH=./tmp/

RUN apt-get update
RUN apt-get -y install libpq-dev
RUN apt-get install gcc -y

RUN pip install --upgrade pip

RUN pip install -r requirements.txt
37 changes: 37 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

import logging
import sys
import os
from flask import Flask
from flask_login import LoginManager
from depositor_login.ext import LoginApp
from depositor_admin_setting.ext import AdminSettingApp
from depositor_item_register.ext import ItemRegisterApp
from depositor_models.db_setting import init_db, DATABASE_URI
from depositor_models.user import User_manager

app = Flask(__name__)
app.config['SECRET_KEY'] = "secret"
app.config['SQLALCHEMY_TRACK_MODIFICATIONS']=False

# 接続先DBの設定
app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
app.logger.setLevel(logging.INFO)
app.logger.addHandler(logging.StreamHandler(sys.stdout))
app.logger.setLevel(logging.DEBUG)

init_db(app)
login_manager = LoginManager()
login_manager.init_app(app)

loginapp = LoginApp()
loginapp.init_app(app)
adminapp = AdminSettingApp()
adminapp.init_app(app)
itemregister = ItemRegisterApp()
itemregister.init_app(app)

@login_manager.user_loader
def load_user(user_id):
user=User_manager.get_user_by_id(user_id)
return user
7 changes: 7 additions & 0 deletions app/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"grobid_server": "http://grobid:8070",
"batch_size": 100,
"sleep_time": 5,
"timeout": 60,
"coordinates": [ "persName", "figure", "ref", "biblStruct", "formula", "s", "note", "title" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

from .ext import AdminSettingApp
__all__ = ('AdminSettingApp')
10 changes: 10 additions & 0 deletions app/modules/depositor_admin_setting/depositor_admin_setting/ext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .views import blueprint

class AdminSettingApp(object):
def __init__(self, app=None):
if app:
self.init_app(app)

def init_app(self, app):
app.register_blueprint(blueprint)
app.extensions['adminsetting'] = self
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
function closeError() {
document.getElementById("errors").innerHTML = "";
}

function showMsg(msg , success=false) {
text = '<div class="alert ' + (success? "alert-success":"alert-danger") + ' alert-dismissable" id="alert">' +
'<button type="button" class="close" data-dismiss="alert" aria-hidden="true" onclick=closeError()>' +
'&times; </button>' + msg + '</div>';
document.getElementById("errors").insertAdjacentHTML('afterbegin',text);

}

async function componentDidMount() {
/** set errorMessage Area */
const header = document.getElementsByClassName("content-header")[0];
if (header) {
const errorElement = document.createElement('div');
errorElement.setAttribute('id', 'errors');
header.insertBefore(errorElement, header.firstChild);
}
}

function isEmpty(value){
if (!value){
return true;
}else{
return false;
}
}

function handleAddSubmit(){
closeError();
const affiliation_name = document.getElementById("affiliation_name");
const affiliation_idp_url = document.getElementById("affiliation_idp_url");
//Validate
// required check
NGList = [];
if(isEmpty(affiliation_name.value)){
NGList.push('機関名');
}
if(isEmpty(affiliation_idp_url.value)){
NGList.push('認証機関先URL');
}
if(NGList.length){
return showMsg("The following items is required. Please recheck and input." + NGList , false);
}

const form ={
'affiliation_name': document.getElementById("affiliation_name").value,
'affiliation_idp_url': document.getElementById("affiliation_idp_url").value,
}
let pattern = /^(https?|ftp)(:\/\/[\w\/:%#\$&\?\(\)~\.=\+\-]+)/
if(pattern.test(form.affiliation_idp_url)){
fetch("/admin_setting/add" ,{method:'POST' ,headers:{'Content-Type':'application/json'} ,credentials:"include", body: JSON.stringify(form)})
.then(res => {
if(!res.ok){
console.log(etext);
}
console.log("ok");
showMsg("Successfully Registered Settings." , true);
})
.catch(error => {
console.log(error);
showMsg("Failed To Register Settings" , false);
});
}else{
showMsg("Idp URL: Please input in URL format." , false);
}
}
componentDidMount();
Loading