diff --git a/.jupyter/api_authentication/models/database_dto.py b/.jupyter/api_authentication/models/database_dto.py index 3ff298f11a16adbbd8a8362d7d80d3b14139dec2..9974642be9b7daba87c73e2e70f0af2d961ef7b9 100644 --- a/.jupyter/api_authentication/models/database_dto.py +++ b/.jupyter/api_authentication/models/database_dto.py @@ -31,7 +31,7 @@ class DatabaseDto(object): 'id': 'int', 'name': 'str', 'exchange': 'str', - 'creator': 'UserDto', + 'creator': 'UserBriefDto', 'subjects': 'list[str]', 'language': 'str', 'license': 'LicenseDto', @@ -44,7 +44,7 @@ class DatabaseDto(object): 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication': 'str', + 'publication_year': 'int', 'is_public': 'bool' } @@ -65,11 +65,11 @@ class DatabaseDto(object): 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication': 'publication', + 'publication_year': 'publication_year', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None @@ -87,7 +87,7 @@ class DatabaseDto(object): self._created = None self._deleted = None self._internal_name = None - self._publication = None + self._publication_year = None self._is_public = None self.discriminator = None self.id = id @@ -117,8 +117,8 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication is not None: - self.publication = publication + if publication_year is not None: + self.publication_year = publication_year if is_public is not None: self.is_public = is_public @@ -197,7 +197,7 @@ class DatabaseDto(object): :return: The creator of this DatabaseDto. # noqa: E501 - :rtype: UserDto + :rtype: UserBriefDto """ return self._creator @@ -207,7 +207,7 @@ class DatabaseDto(object): :param creator: The creator of this DatabaseDto. # noqa: E501 - :type: UserDto + :type: UserBriefDto """ if creator is None: raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 @@ -475,25 +475,25 @@ class DatabaseDto(object): self._internal_name = internal_name @property - def publication(self): - """Gets the publication of this DatabaseDto. # noqa: E501 + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 - :return: The publication of this DatabaseDto. # noqa: E501 - :rtype: str + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int """ - return self._publication + return self._publication_year - @publication.setter - def publication(self, publication): - """Sets the publication of this DatabaseDto. + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. - :param publication: The publication of this DatabaseDto. # noqa: E501 - :type: str + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int """ - self._publication = publication + self._publication_year = publication_year @property def is_public(self): diff --git a/.jupyter/api_container/models/database_dto.py b/.jupyter/api_container/models/database_dto.py index 408803f482399398888727d762da195cac706c9b..ef38b6a7d5a6a992f54b8e51d8f0455f45dd5ec4 100644 --- a/.jupyter/api_container/models/database_dto.py +++ b/.jupyter/api_container/models/database_dto.py @@ -31,7 +31,7 @@ class DatabaseDto(object): 'id': 'int', 'name': 'str', 'exchange': 'str', - 'creator': 'UserDto', + 'creator': 'UserBriefDto', 'subjects': 'list[str]', 'language': 'str', 'license': 'LicenseDto', @@ -44,7 +44,7 @@ class DatabaseDto(object): 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication': 'str', + 'publication_year': 'int', 'is_public': 'bool' } @@ -65,11 +65,11 @@ class DatabaseDto(object): 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication': 'publication', + 'publication_year': 'publication_year', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None @@ -87,7 +87,7 @@ class DatabaseDto(object): self._created = None self._deleted = None self._internal_name = None - self._publication = None + self._publication_year = None self._is_public = None self.discriminator = None self.id = id @@ -117,8 +117,8 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication is not None: - self.publication = publication + if publication_year is not None: + self.publication_year = publication_year if is_public is not None: self.is_public = is_public @@ -197,7 +197,7 @@ class DatabaseDto(object): :return: The creator of this DatabaseDto. # noqa: E501 - :rtype: UserDto + :rtype: UserBriefDto """ return self._creator @@ -207,7 +207,7 @@ class DatabaseDto(object): :param creator: The creator of this DatabaseDto. # noqa: E501 - :type: UserDto + :type: UserBriefDto """ if creator is None: raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 @@ -475,25 +475,25 @@ class DatabaseDto(object): self._internal_name = internal_name @property - def publication(self): - """Gets the publication of this DatabaseDto. # noqa: E501 + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 - :return: The publication of this DatabaseDto. # noqa: E501 - :rtype: str + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int """ - return self._publication + return self._publication_year - @publication.setter - def publication(self, publication): - """Sets the publication of this DatabaseDto. + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. - :param publication: The publication of this DatabaseDto. # noqa: E501 - :type: str + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int """ - self._publication = publication + self._publication_year = publication_year @property def is_public(self): diff --git a/.jupyter/api_database/models/database_dto.py b/.jupyter/api_database/models/database_dto.py index 6e1826899a9a28567c481c497616b41e3213b6ef..6e485faa9dc4f0dea3b7c3bae4063ab1be1135c7 100644 --- a/.jupyter/api_database/models/database_dto.py +++ b/.jupyter/api_database/models/database_dto.py @@ -31,7 +31,7 @@ class DatabaseDto(object): 'id': 'int', 'name': 'str', 'exchange': 'str', - 'creator': 'UserDto', + 'creator': 'UserBriefDto', 'subjects': 'list[str]', 'language': 'str', 'license': 'LicenseDto', @@ -44,7 +44,7 @@ class DatabaseDto(object): 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication': 'str', + 'publication_year': 'int', 'is_public': 'bool' } @@ -65,11 +65,11 @@ class DatabaseDto(object): 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication': 'publication', + 'publication_year': 'publication_year', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None @@ -87,7 +87,7 @@ class DatabaseDto(object): self._created = None self._deleted = None self._internal_name = None - self._publication = None + self._publication_year = None self._is_public = None self.discriminator = None self.id = id @@ -117,8 +117,8 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication is not None: - self.publication = publication + if publication_year is not None: + self.publication_year = publication_year if is_public is not None: self.is_public = is_public @@ -197,7 +197,7 @@ class DatabaseDto(object): :return: The creator of this DatabaseDto. # noqa: E501 - :rtype: UserDto + :rtype: UserBriefDto """ return self._creator @@ -207,7 +207,7 @@ class DatabaseDto(object): :param creator: The creator of this DatabaseDto. # noqa: E501 - :type: UserDto + :type: UserBriefDto """ if creator is None: raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 @@ -475,25 +475,25 @@ class DatabaseDto(object): self._internal_name = internal_name @property - def publication(self): - """Gets the publication of this DatabaseDto. # noqa: E501 + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 - :return: The publication of this DatabaseDto. # noqa: E501 - :rtype: str + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int """ - return self._publication + return self._publication_year - @publication.setter - def publication(self, publication): - """Sets the publication of this DatabaseDto. + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. - :param publication: The publication of this DatabaseDto. # noqa: E501 - :type: str + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int """ - self._publication = publication + self._publication_year = publication_year @property def is_public(self): diff --git a/.jupyter/api_database/models/database_modify_dto.py b/.jupyter/api_database/models/database_modify_dto.py index fb3958ce85f26c46f51e80c26f2226d1079b435a..f61145aa15e81aaf865f5b7d13e37deb8d1a2386 100644 --- a/.jupyter/api_database/models/database_modify_dto.py +++ b/.jupyter/api_database/models/database_modify_dto.py @@ -34,7 +34,7 @@ class DatabaseModifyDto(object): 'license': 'LicenseDto', 'language': 'str', 'is_public': 'bool', - 'publication': 'str', + 'publication_year': 'int', 'contact_person': 'str' } @@ -45,11 +45,11 @@ class DatabaseModifyDto(object): 'license': 'license', 'language': 'language', 'is_public': 'is_public', - 'publication': 'publication', + 'publication_year': 'publication_year', 'contact_person': 'contact_person' } - def __init__(self, subject=None, description=None, publisher=None, license=None, language=None, is_public=None, publication=None, contact_person=None): # noqa: E501 + def __init__(self, subject=None, description=None, publisher=None, license=None, language=None, is_public=None, publication_year=None, contact_person=None): # noqa: E501 """DatabaseModifyDto - a model defined in Swagger""" # noqa: E501 self._subject = None self._description = None @@ -57,7 +57,7 @@ class DatabaseModifyDto(object): self._license = None self._language = None self._is_public = None - self._publication = None + self._publication_year = None self._contact_person = None self.discriminator = None if subject is not None: @@ -70,7 +70,7 @@ class DatabaseModifyDto(object): if language is not None: self.language = language self.is_public = is_public - self.publication = publication + self.publication_year = publication_year if contact_person is not None: self.contact_person = contact_person @@ -211,27 +211,27 @@ class DatabaseModifyDto(object): self._is_public = is_public @property - def publication(self): - """Gets the publication of this DatabaseModifyDto. # noqa: E501 + def publication_year(self): + """Gets the publication_year of this DatabaseModifyDto. # noqa: E501 - :return: The publication of this DatabaseModifyDto. # noqa: E501 - :rtype: str + :return: The publication_year of this DatabaseModifyDto. # noqa: E501 + :rtype: int """ - return self._publication + return self._publication_year - @publication.setter - def publication(self, publication): - """Sets the publication of this DatabaseModifyDto. + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseModifyDto. - :param publication: The publication of this DatabaseModifyDto. # noqa: E501 - :type: str + :param publication_year: The publication_year of this DatabaseModifyDto. # noqa: E501 + :type: int """ - if publication is None: - raise ValueError("Invalid value for `publication`, must not be `None`") # noqa: E501 + if publication_year is None: + raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication = publication + self._publication_year = publication_year @property def contact_person(self): diff --git a/.jupyter/api_identifier/models/identifier_dto.py b/.jupyter/api_identifier/models/identifier_dto.py index aef9014351cb3765fd5b7d3d535e4359e3029d1b..5ee9095a726672927b5099a687474f420c06c11d 100644 --- a/.jupyter/api_identifier/models/identifier_dto.py +++ b/.jupyter/api_identifier/models/identifier_dto.py @@ -46,7 +46,9 @@ class IdentifierDto(object): 'query_hash': 'str', 'result_hash': 'str', 'result_number': 'int', - 'publication': 'str', + 'publication_day': 'int', + 'publication_month': 'int', + 'publication_year': 'int', 'last_modified': 'datetime' } @@ -69,11 +71,13 @@ class IdentifierDto(object): 'query_hash': 'query_hash', 'result_hash': 'result_hash', 'result_number': 'result_number', - 'publication': 'publication', + 'publication_day': 'publication_day', + 'publication_month': 'publication_month', + 'publication_year': 'publication_year', 'last_modified': 'last_modified' } - def __init__(self, id=None, cid=None, dbid=None, qid=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, creator=None, creators=None, created=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, cid=None, dbid=None, qid=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, creator=None, creators=None, created=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._cid = None @@ -93,7 +97,9 @@ class IdentifierDto(object): self._query_hash = None self._result_hash = None self._result_number = None - self._publication = None + self._publication_day = None + self._publication_month = None + self._publication_year = None self._last_modified = None self.discriminator = None if id is not None: @@ -118,7 +124,11 @@ class IdentifierDto(object): self.query_hash = query_hash self.result_hash = result_hash self.result_number = result_number - self.publication = publication + if publication_day is not None: + self.publication_day = publication_day + if publication_month is not None: + self.publication_month = publication_month + self.publication_year = publication_year if last_modified is not None: self.last_modified = last_modified @@ -535,27 +545,69 @@ class IdentifierDto(object): self._result_number = result_number @property - def publication(self): - """Gets the publication of this IdentifierDto. # noqa: E501 + def publication_day(self): + """Gets the publication_day of this IdentifierDto. # noqa: E501 - :return: The publication of this IdentifierDto. # noqa: E501 - :rtype: str + :return: The publication_day of this IdentifierDto. # noqa: E501 + :rtype: int """ - return self._publication + return self._publication_day - @publication.setter - def publication(self, publication): - """Sets the publication of this IdentifierDto. + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this IdentifierDto. - :param publication: The publication of this IdentifierDto. # noqa: E501 - :type: str + :param publication_day: The publication_day of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def publication_month(self): + """Gets the publication_month of this IdentifierDto. # noqa: E501 + + + :return: The publication_month of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this IdentifierDto. + + + :param publication_month: The publication_month of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_year(self): + """Gets the publication_year of this IdentifierDto. # noqa: E501 + + + :return: The publication_year of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this IdentifierDto. + + + :param publication_year: The publication_year of this IdentifierDto. # noqa: E501 + :type: int """ - if publication is None: - raise ValueError("Invalid value for `publication`, must not be `None`") # noqa: E501 + if publication_year is None: + raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - self._publication = publication + self._publication_year = publication_year @property def last_modified(self): diff --git a/.jupyter/api_query/api/table_data_endpoint_api.py b/.jupyter/api_query/api/table_data_endpoint_api.py index 632bf0023c0c979119e43647dec551cf4bc744ad..8f34b37dacac4db3543dd2def4951d0d24501b87 100644 --- a/.jupyter/api_query/api/table_data_endpoint_api.py +++ b/.jupyter/api_query/api/table_data_endpoint_api.py @@ -259,7 +259,7 @@ class TableDataEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', path_params, query_params, header_params, @@ -380,7 +380,7 @@ class TableDataEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', path_params, query_params, header_params, diff --git a/.jupyter/api_query/models/database_dto.py b/.jupyter/api_query/models/database_dto.py index 6cb99a24159f1d25fba0d919a86917f761598b94..008562a718b764a529bfdfbc6d14c04d0d3f9d7b 100644 --- a/.jupyter/api_query/models/database_dto.py +++ b/.jupyter/api_query/models/database_dto.py @@ -31,7 +31,7 @@ class DatabaseDto(object): 'id': 'int', 'name': 'str', 'exchange': 'str', - 'creator': 'UserDto', + 'creator': 'UserBriefDto', 'subjects': 'list[str]', 'language': 'str', 'license': 'LicenseDto', @@ -44,7 +44,7 @@ class DatabaseDto(object): 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication': 'str', + 'publication_year': 'int', 'is_public': 'bool' } @@ -65,11 +65,11 @@ class DatabaseDto(object): 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication': 'publication', + 'publication_year': 'publication_year', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, contact=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None @@ -87,7 +87,7 @@ class DatabaseDto(object): self._created = None self._deleted = None self._internal_name = None - self._publication = None + self._publication_year = None self._is_public = None self.discriminator = None self.id = id @@ -117,8 +117,8 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication is not None: - self.publication = publication + if publication_year is not None: + self.publication_year = publication_year if is_public is not None: self.is_public = is_public @@ -197,7 +197,7 @@ class DatabaseDto(object): :return: The creator of this DatabaseDto. # noqa: E501 - :rtype: UserDto + :rtype: UserBriefDto """ return self._creator @@ -207,7 +207,7 @@ class DatabaseDto(object): :param creator: The creator of this DatabaseDto. # noqa: E501 - :type: UserDto + :type: UserBriefDto """ if creator is None: raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 @@ -475,25 +475,25 @@ class DatabaseDto(object): self._internal_name = internal_name @property - def publication(self): - """Gets the publication of this DatabaseDto. # noqa: E501 + def publication_year(self): + """Gets the publication_year of this DatabaseDto. # noqa: E501 - :return: The publication of this DatabaseDto. # noqa: E501 - :rtype: str + :return: The publication_year of this DatabaseDto. # noqa: E501 + :rtype: int """ - return self._publication + return self._publication_year - @publication.setter - def publication(self, publication): - """Sets the publication of this DatabaseDto. + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this DatabaseDto. - :param publication: The publication of this DatabaseDto. # noqa: E501 - :type: str + :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 + :type: int """ - self._publication = publication + self._publication_year = publication_year @property def is_public(self): diff --git a/.jupyter/api_table/models/table_dto.py b/.jupyter/api_table/models/table_dto.py index f5394c29378cc572a4da6b387cd2b2cf88afcc2a..00af01d052aaddfcda9f0b561dd283325fcd43bd 100644 --- a/.jupyter/api_table/models/table_dto.py +++ b/.jupyter/api_table/models/table_dto.py @@ -30,6 +30,7 @@ class TableDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'creator': 'UserBriefDto', 'topic': 'str', 'description': 'str', 'created': 'datetime', @@ -40,6 +41,7 @@ class TableDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'creator': 'creator', 'topic': 'topic', 'description': 'description', 'created': 'created', @@ -47,10 +49,11 @@ class TableDto(object): 'internal_name': 'internal_name' } - def __init__(self, id=None, name=None, topic=None, description=None, created=None, columns=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, creator=None, topic=None, description=None, created=None, columns=None, internal_name=None): # noqa: E501 """TableDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._creator = None self._topic = None self._description = None self._created = None @@ -59,6 +62,7 @@ class TableDto(object): self.discriminator = None self.id = id self.name = name + self.creator = creator self.topic = topic self.description = description if created is not None: @@ -112,6 +116,29 @@ class TableDto(object): self._name = name + @property + def creator(self): + """Gets the creator of this TableDto. # noqa: E501 + + + :return: The creator of this TableDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this TableDto. + + + :param creator: The creator of this TableDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + @property def topic(self): """Gets the topic of this TableDto. # noqa: E501 diff --git a/.jupyter/load_test.py b/.jupyter/load_test.py index bdf47dee1dcb92117e56a8bd362e247f2d9f1156..55ce49c3b66b281463654f18bd34fd83d8963270 100644 --- a/.jupyter/load_test.py +++ b/.jupyter/load_test.py @@ -5,6 +5,7 @@ import os import shutil import uuid from postgres import Postgres +from datetime import date import api_query.rest from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi @@ -98,7 +99,7 @@ def update_database(container_id, database_id, is_public=True): }, "language": "en", "is_public": is_public, - "publication": "2022-07-19" + "publication_year": date.year }, container_id, database_id) print("updated database with id %d" % response.id) return response @@ -203,7 +204,9 @@ def create_identifier(container_id, database_id, query_id, visibility="everyone" "affiliation": "TU Wien", "orcid": "0000-0002-9272-6225" }], - "publication": "2022-07-16", + "publication_day": date.day, + "publication_month": date.month, + "publication_year": date.year, "related_identifiers": [{ "value": "http://localhost:3000/container/" + str(container_id) + "/database/" + str(database_id), "type": "URL", diff --git a/fda-database-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java b/fda-database-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java index 028a2326f6d74fa205e138ce828da4d0c225be88..4b6fc8d4c40a3b8d506099d15bb436afa9764eac 100644 --- a/fda-database-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java +++ b/fda-database-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java @@ -104,6 +104,7 @@ public abstract class BaseUnitTest { public final static String DATABASE_1_NAME = "Weather"; public final static String DATABASE_1_DESCRIPTION = "Weather somewhere in the world"; public final static String DATABASE_1_PUBLISHER = "TU Wien"; + public final static Short DATABASE_1_PUBLICATION_YEAR = 2022; public final static Boolean DATABASE_1_PUBLIC = false; public final static String DATABASE_1_INTERNALNAME = "weather"; public final static String DATABASE_1_EXCHANGE = "fda." + DATABASE_1_INTERNALNAME; @@ -127,7 +128,7 @@ public abstract class BaseUnitTest { .description(DATABASE_1_DESCRIPTION) .language(LanguageTypeDto.EN) .license(LICENSE_1_DTO) - .publication("2022-08-01") + .publicationYear(DATABASE_1_PUBLICATION_YEAR) .publisher(DATABASE_1_PUBLISHER) .build(); diff --git a/fda-database-service/services/src/main/java/at/tuwien/service/impl/MariaDbServiceImpl.java b/fda-database-service/services/src/main/java/at/tuwien/service/impl/MariaDbServiceImpl.java index bcf28c23b44a07dabcfd299e16f5728f4a529066..62daeb5dd8c97282bc7951343e8704957cdd3c52 100644 --- a/fda-database-service/services/src/main/java/at/tuwien/service/impl/MariaDbServiceImpl.java +++ b/fda-database-service/services/src/main/java/at/tuwien/service/impl/MariaDbServiceImpl.java @@ -201,7 +201,7 @@ public class MariaDbServiceImpl extends HibernateConnector implements DatabaseSe database.setIsPublic(modifyDto.getIsPublic()); database.setDescription(modifyDto.getDescription()); database.setPublisher(modifyDto.getPublisher()); - database.setPublication(modifyDto.getPublication()); + database.setPublicationYear(modifyDto.getPublicationYear()); database.setLanguage(databaseMapper.languageTypeDtoToLanguageType(modifyDto.getLanguage())); final Database dbdb = databaseRepository.save(database); diff --git a/fda-identifier-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java b/fda-identifier-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java index b658042f0411073d2e6f31b0b43a7aac4d8f7694..3d73541ada4d1faf1f64b0b2009dcced171a20da 100644 --- a/fda-identifier-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java +++ b/fda-identifier-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java @@ -246,7 +246,7 @@ public abstract class BaseUnitTest { public final static Instant IDENTIFIER_1_CREATED = Instant.ofEpochSecond(1641588352); public final static Instant IDENTIFIER_1_MODIFIED = Instant.ofEpochSecond(1541588352); public final static Instant IDENTIFIER_1_EXECUTION = Instant.ofEpochSecond(1541588352); - public final static String IDENTIFIER_1_PUBLICATION_YEAR = "2022-07-14"; + public final static Short IDENTIFIER_1_PUBLICATION_YEAR = 2022; public final static String IDENTIFIER_1_QUERY_HASH = "abc"; public final static String IDENTIFIER_1_RESULT_HASH = "def"; public final static String IDENTIFIER_1_QUERY = "SELECT `id` FROM `foobar`"; @@ -264,7 +264,9 @@ public abstract class BaseUnitTest { public final static Instant IDENTIFIER_2_CREATED = Instant.ofEpochSecond(1641588352); public final static Instant IDENTIFIER_2_MODIFIED = Instant.ofEpochSecond(1541588352); public final static Instant IDENTIFIER_2_EXECUTION = Instant.ofEpochSecond(1541588352); - public final static String IDENTIFIER_2_PUBLICATION_YEAR = "2022-07-14"; + public final static Short IDENTIFIER_2_PUBLICATION_DAY = 14; + public final static Short IDENTIFIER_2_PUBLICATION_MONTH = 7; + public final static Short IDENTIFIER_2_PUBLICATION_YEAR = 2022; public final static String IDENTIFIER_2_QUERY_HASH = "abc"; public final static String IDENTIFIER_2_RESULT_HASH = "def"; public final static String IDENTIFIER_2_QUERY = "SELECT `id` FROM `foobar`"; @@ -284,7 +286,7 @@ public abstract class BaseUnitTest { .created(IDENTIFIER_1_CREATED) .lastModified(IDENTIFIER_1_MODIFIED) .execution(IDENTIFIER_1_EXECUTION) - .publication(IDENTIFIER_1_PUBLICATION_YEAR) + .publicationYear(IDENTIFIER_1_PUBLICATION_YEAR) .queryHash(IDENTIFIER_1_QUERY_HASH) .resultHash(IDENTIFIER_1_RESULT_HASH) .query(IDENTIFIER_1_QUERY) @@ -305,7 +307,9 @@ public abstract class BaseUnitTest { .created(IDENTIFIER_2_CREATED) .lastModified(IDENTIFIER_2_MODIFIED) .execution(IDENTIFIER_2_EXECUTION) - .publication(IDENTIFIER_2_PUBLICATION_YEAR) + .publicationDay(IDENTIFIER_2_PUBLICATION_DAY) + .publicationMonth(IDENTIFIER_2_PUBLICATION_MONTH) + .publicationYear(IDENTIFIER_2_PUBLICATION_YEAR) .queryHash(IDENTIFIER_2_QUERY_HASH) .resultHash(IDENTIFIER_2_RESULT_HASH) .query(IDENTIFIER_2_QUERY) @@ -404,7 +408,7 @@ public abstract class BaseUnitTest { .title(IDENTIFIER_1_TITLE) .doi(IDENTIFIER_1_DOI) .visibility(IDENTIFIER_1_VISIBILITY_DTO) - .publication(IDENTIFIER_1_PUBLICATION_YEAR) + .publicationYear(IDENTIFIER_1_PUBLICATION_YEAR) .creators(List.of(CREATOR_1_CREATE_DTO, CREATOR_2_CREATE_DTO)) .build(); @@ -425,7 +429,9 @@ public abstract class BaseUnitTest { .doi(IDENTIFIER_2_DOI) .visibility(IDENTIFIER_2_VISIBILITY_DTO) .relatedIdentifiers(List.of(RELATED_IDENTIFIER_1_CREATE_DTO)) - .publication(IDENTIFIER_2_PUBLICATION_YEAR) + .publicationDay(IDENTIFIER_2_PUBLICATION_DAY) + .publicationMonth(IDENTIFIER_2_PUBLICATION_MONTH) + .publicationYear(IDENTIFIER_2_PUBLICATION_YEAR) .creators(List.of(CREATOR_1_CREATE_DTO, CREATOR_2_CREATE_DTO)) .build(); diff --git a/fda-identifier-service/services/src/main/java/at/tuwien/mapper/DocumentMapper.java b/fda-identifier-service/services/src/main/java/at/tuwien/mapper/DocumentMapper.java index 51097b6f43de84751dc25cce31b0a7ed4805599d..152d2e4feb030da0c211947233ed4c4e9db4fc76 100644 --- a/fda-identifier-service/services/src/main/java/at/tuwien/mapper/DocumentMapper.java +++ b/fda-identifier-service/services/src/main/java/at/tuwien/mapper/DocumentMapper.java @@ -34,7 +34,7 @@ public interface DocumentMapper { builder.append("<identifier identifierType=\"DOI\">") .append(data.getDoi()) .append("</identifier>"); - if (data.getCreators().size() == 0) { + if (data.getCreators().size() > 0) { builder.append("<creators>"); data.getCreators() .forEach(creator -> { @@ -57,7 +57,7 @@ public interface DocumentMapper { .append("<publisher xml:lang=\"en\">") .append(database.getPublisher()) .append("</publisher><publicationYear>") - .append(database.getPublication()) + .append(data.getPublicationYear()) .append("</publicationYear>"); if (database.getSubjects().size() > 0) { builder.append("<subjects>"); @@ -107,6 +107,11 @@ public interface DocumentMapper { .append(database.getLicense().getUri()) .append("\"/></rightsList>"); } + if (data.getDescription() != null) { + builder.append("<descriptions><description descriptionType=\"Abstract\">") + .append(data.getDescription()) + .append("</description></descriptions>"); + } builder.append("<version>1.0</version><descriptions>") .append("<description xml:lang=\"en\" descriptionType=\"Abstract\">") .append(data.getDescription()) diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseDto.java index 7a3b8c47c00e1237b880e6815559a9648776f88e..a9c1223a3f87133252c16f6d52e0e5af46033ef3 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseDto.java @@ -64,9 +64,9 @@ public class DatabaseDto { @Parameter(name = "database contact person") private UserDto contact; - @JsonProperty("publication") - @Parameter(name = "database publication") - private String publication; + @JsonProperty("publication_year") + @Parameter(name = "database publication year") + private Short publicationYear; @Parameter(name = "tables") private List<TableBriefDto> tables; diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseModifyDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseModifyDto.java index abfd5dbf3684b069478c48e81a7e43897bfeefa8..ba5804fa7213d955af9ccaa36150a5c919645f2c 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseModifyDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/database/DatabaseModifyDto.java @@ -32,9 +32,9 @@ public class DatabaseModifyDto { private String publisher; @NotBlank - @JsonProperty("publication") - @Parameter(name = "database publication") - private String publication; + @JsonProperty("publication_year") + @Parameter(name = "database publication year") + private Short publicationYear; @Parameter(name = "database license") private LicenseDto license; diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java index 22588651878c5d22cfb4410818756d85d5fa674d..90b176d4db1c589c92e0dded17766f0de85c15dc 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierCreateDto.java @@ -39,10 +39,18 @@ public class IdentifierCreateDto { @Parameter(name = "doi", example = "Digital Object Identifier") private String doi; - @NotBlank - @JsonProperty("publication") - @Parameter(name = "publication") - private String publication; + @JsonProperty("publication_day") + @Parameter(name = "publication day") + private Short publicationDay; + + @JsonProperty("publication_month") + @Parameter(name = "publication month") + private Short publicationMonth; + + @NotNull + @JsonProperty("publication_year") + @Parameter(name = "publication year") + private Short publicationYear; @NotNull @Parameter(name = "creators") diff --git a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java index d54a9f80e692625bb4aee34a42b3e3436505773e..e5e3d33c55fc270e9568efc5af11c516b6432c3f 100644 --- a/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java +++ b/fda-metadata-db/api/src/main/java/at/tuwien/api/identifier/IdentifierDto.java @@ -86,10 +86,18 @@ public class IdentifierDto { @Parameter(name = "database creator") private UserDto creator; - @NotBlank - @JsonProperty("publication") - @Parameter(name = "publication") - private String publication; + @JsonProperty("publication_day") + @Parameter(name = "publication day") + private Short publicationDay; + + @JsonProperty("publication_month") + @Parameter(name = "publication month") + private Short publicationMonth; + + @NotNull + @JsonProperty("publication_year") + @Parameter(name = "publication year") + private Short publicationYear; @NotNull @Parameter(name = "creators") diff --git a/fda-metadata-db/entities/src/main/java/at/tuwien/entities/database/Database.java b/fda-metadata-db/entities/src/main/java/at/tuwien/entities/database/Database.java index e14ed74682e8cd73824ee343d5970ce2e8c096b9..68e952263dedb4c5152013df3cd3b7e85cfd2d8c 100644 --- a/fda-metadata-db/entities/src/main/java/at/tuwien/entities/database/Database.java +++ b/fda-metadata-db/entities/src/main/java/at/tuwien/entities/database/Database.java @@ -76,7 +76,7 @@ public class Database { private String publisher; @Column - private String publication; + private Short publicationYear; @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE) @JoinColumns({ diff --git a/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java b/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java index e4bf5809d205876afa0ee20c7e22f7a93bff0f79..a6ec125f5dece091fa881f3374b3e0c029f35588 100644 --- a/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java +++ b/fda-metadata-db/entities/src/main/java/at/tuwien/entities/identifier/Identifier.java @@ -78,6 +78,15 @@ public class Identifier { @Column(nullable = false) private Long resultNumber; + @Column(nullable = false) + private Short publicationYear; + + @Column + private Short publicationMonth; + + @Column + private Short publicationDay; + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumns({ @JoinColumn(name = "dbid", referencedColumnName = "id", insertable = false, updatable = false) @@ -97,9 +106,6 @@ public class Identifier { @Column private String doi; - @Column(nullable = false) - private String publication; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "identifier") private List<Creator> creators; diff --git a/fda-metadata-db/setup-schema.sql b/fda-metadata-db/setup-schema.sql index ee7d2e43dc9daf782811bdfa8632ed79d08d5320..d6f20c96bb009030800352b5c9d9cf2e1f8e87bf 100644 --- a/fda-metadata-db/setup-schema.sql +++ b/fda-metadata-db/setup-schema.sql @@ -273,25 +273,25 @@ CREATE TABLE IF NOT EXISTS mdb_licenses CREATE TABLE IF NOT EXISTS mdb_databases ( - id bigint NOT NULL DEFAULT nextval('mdb_databases_seq'), - name character varying(255) NOT NULL, - internal_name character varying(255) NOT NULL, - exchange character varying(255) NOT NULL, - subject character varying(255), - publication character varying(255), - ResourceType TEXT, - Description TEXT, - Engine VARCHAR(20) DEFAULT 'Postgres', - Publisher VARCHAR(255), - Year DATE DEFAULT CURRENT_DATE, - License character varying(255), - language character varying(2), - is_public BOOLEAN NOT NULL DEFAULT TRUE, - Creator BIGINT REFERENCES mdb_USERS (UserID), - Contactperson BIGINT REFERENCES mdb_USERS (UserID), - created timestamp without time zone NOT NULL DEFAULT NOW(), - last_modified timestamp without time zone, - deleted timestamp without time zone NULL, + id bigint NOT NULL DEFAULT nextval('mdb_databases_seq'), + name character varying(255) NOT NULL, + internal_name character varying(255) NOT NULL, + exchange character varying(255) NOT NULL, + subject character varying(255), + publication_year smallint, + ResourceType TEXT, + Description TEXT, + Engine VARCHAR(20) DEFAULT 'Postgres', + Publisher VARCHAR(255), + Year DATE DEFAULT CURRENT_DATE, + License character varying(255), + language character varying(2), + is_public BOOLEAN NOT NULL DEFAULT TRUE, + Creator BIGINT REFERENCES mdb_USERS (UserID), + Contactperson BIGINT REFERENCES mdb_USERS (UserID), + created timestamp without time zone NOT NULL DEFAULT NOW(), + last_modified timestamp without time zone, + deleted timestamp without time zone NULL, PRIMARY KEY (id), FOREIGN KEY (Creator) REFERENCES mdb_USERS (UserID), FOREIGN KEY (Contactperson) REFERENCES mdb_USERS (UserID), @@ -451,25 +451,27 @@ CREATE TABLE IF NOT EXISTS mdb_VIEW CREATE TABLE IF NOT EXISTS mdb_identifiers ( - id bigint DEFAULT nextval('mdb_identifiers_seq'), - cid bigint NOT NULL, - dbid bigint NOT NULL, - qid bigint NOT NULL, - title VARCHAR(255) NOT NULL, - description TEXT NOT NULL, - visibility VARCHAR(10) NOT NULL DEFAULT 'SELF', - publication varchar(255) NOT NULL, - query TEXT NOT NULL, - query_normalized TEXT NOT NULL, - query_hash VARCHAR(255) NOT NULL, - execution timestamp NOT NULL, - result_hash VARCHAR(255) NOT NULL, - result_number bigint NOT NULL, - doi VARCHAR(255), - created timestamp without time zone NOT NULL DEFAULT NOW(), - created_by bigint NOT NULL, - last_modified timestamp without time zone, - deleted timestamp without time zone, + id bigint DEFAULT nextval('mdb_identifiers_seq'), + cid bigint NOT NULL, + dbid bigint NOT NULL, + qid bigint NOT NULL, + title VARCHAR(255) NOT NULL, + description TEXT NOT NULL, + visibility VARCHAR(10) NOT NULL DEFAULT 'SELF', + publication_year smallint NOT NULL, + publication_month smallint, + publication_day smallint, + query TEXT NOT NULL, + query_normalized TEXT NOT NULL, + query_hash VARCHAR(255) NOT NULL, + execution timestamp NOT NULL, + result_hash VARCHAR(255) NOT NULL, + result_number bigint NOT NULL, + doi VARCHAR(255), + created timestamp without time zone NOT NULL DEFAULT NOW(), + created_by bigint NOT NULL, + last_modified timestamp without time zone, + deleted timestamp without time zone, PRIMARY KEY (id), /* must be a single id from persistent identifier concept */ FOREIGN KEY (cid) REFERENCES mdb_containers (id), FOREIGN KEY (dbid) REFERENCES mdb_databases (id), diff --git a/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/AbstractEndpoint.java b/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/AbstractEndpoint.java index fc367c723ed3d77bd49745ad86b87691f194bddc..56125529d8d94da58eb35125aebc18f8b0edd2c1 100644 --- a/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/AbstractEndpoint.java +++ b/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/AbstractEndpoint.java @@ -37,7 +37,7 @@ public abstract class AbstractEndpoint { return false; } /* view-only operations are allowed on public databases */ - if (database.getIsPublic() && List.of("DATA_EXPORT", "DATA_VIEW", "DATA_HISTORY", "QUERY_VIEW_ALL").contains(permissionCode)) { + if (database.getIsPublic() && List.of("TABLE_EXPORT", "DATA_VIEW", "DATA_HISTORY", "QUERY_VIEW_ALL").contains(permissionCode)) { log.debug("grant permission {} because database is public", permissionCode); return true; } diff --git a/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java b/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java index 0f0fa58575c3337f602a542c99eab09eac60ffcd..b30444af566d1e7ddd8d75ab741e51f89664ccba 100644 --- a/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java +++ b/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java @@ -41,11 +41,11 @@ public class ExportEndpoint extends AbstractEndpoint { @NotNull @PathVariable("databaseId") Long databaseId, @NotNull @PathVariable("tableId") Long tableId, @RequestParam(required = false) Instant timestamp, - @NotNull Principal principal) + Principal principal) throws TableNotFoundException, DatabaseConnectionException, TableMalformedException, DatabaseNotFoundException, ImageNotSupportedException, PaginationException, ContainerNotFoundException, FileStorageException, NotAllowedException, QueryMalformedException { - if (!hasDatabasePermission(id, databaseId, "DATA_EXPORT", principal)) { + if (!hasDatabasePermission(id, databaseId, "TABLE_EXPORT", principal)) { log.error("Missing data export permission"); throw new NotAllowedException("Missing data export permission"); } diff --git a/fda-ui/components/DBToolbar.vue b/fda-ui/components/DBToolbar.vue index 6b72889c176f9e2ef42a3097e74727175e5d6417..e20d3034dcea84c74c9edd2965604ea028acac44 100644 --- a/fda-ui/components/DBToolbar.vue +++ b/fda-ui/components/DBToolbar.vue @@ -3,24 +3,24 @@ <v-toolbar v-if="cached_database" flat> <v-toolbar-title> <span>{{ cached_database.name }}</span> - <v-icon v-if="!cached_database.is_public" color="primary" class="mb-1" right>mdi-lock-outline</v-icon> - <v-icon v-if="cached_database.is_public" class="mb-1" right>mdi-lock-open-outline</v-icon> + <v-icon v-if="!cached_database.is_public" color="primary" class="mb-1" title="Private" right>mdi-lock-outline</v-icon> + <v-icon v-if="cached_database.is_public" class="mb-1" title="Public" right>mdi-lock-open-outline</v-icon> </v-toolbar-title> <v-spacer /> <v-toolbar-title> - <v-btn class="mr-2 mb-1" :disabled="!token" :to="`/container/${$route.params.container_id}/database/${databaseId}/table/import`"> + <v-btn v-if="token" class="mr-2 mb-1" :to="`/container/${$route.params.container_id}/database/${databaseId}/table/import`"> <v-icon left>mdi-cloud-upload</v-icon> Import CSV </v-btn> - <v-btn color="secondary" class="mr-2 mb-1 white--text" :disabled="!token" :to="`/container/${$route.params.container_id}/database/${databaseId}/query/create`"> + <v-btn v-if="token" color="secondary" class="mr-2 mb-1 white--text" :to="`/container/${$route.params.container_id}/database/${databaseId}/query/create`"> <v-icon left>mdi-wrench</v-icon> Create Subset </v-btn> - <v-btn color="primary" class="mb-1" :disabled="!token" :to="`/container/${$route.params.container_id}/database/${databaseId}/table/create`"> + <v-btn v-if="token" color="primary" class="mb-1" :to="`/container/${$route.params.container_id}/database/${databaseId}/table/create`"> <v-icon left>mdi-table-large-plus</v-icon> Create Table </v-btn> </v-toolbar-title> <template v-slot:extension> <v-tabs v-model="tab" color="primary"> - <v-tab :to="`/container/${$route.params.container_id}/database/${databaseId}/info`"> + <v-tab :to="`/container/${$route.params.container_id}/database/${databaseId}`"> Info </v-tab> <v-tab :to="`/container/${$route.params.container_id}/database/${databaseId}/table`"> diff --git a/fda-ui/components/dialogs/PersistQuery.vue b/fda-ui/components/dialogs/PersistQuery.vue index b6d7e2524f29a9cc267f7bda55636690e5c7bcac..3562ce7b47daafdf1b2bbc989dc82f7b2bc33109 100644 --- a/fda-ui/components/dialogs/PersistQuery.vue +++ b/fda-ui/components/dialogs/PersistQuery.vue @@ -32,11 +32,26 @@ </v-col> </v-row> <v-row> - <v-col> + <v-col cols="2"> + <v-text-field + id="publication-day" + v-model.number="identifier.publication_day" + type="number" + label="Publication Day" /> + </v-col> + <v-col cols="2"> + <v-text-field + id="publication-month" + v-model.number="identifier.publication_month" + type="number" + label="Publication Month" /> + </v-col> + <v-col cols="3"> <v-text-field - id="publication" - v-model="identifier.publication" - label="Publication Time *" + id="publication-year" + v-model.number="identifier.publication_year" + type="number" + label="Publication Year *" :rules="[v => !!v || $t('Required')]" required /> </v-col> @@ -75,7 +90,6 @@ <v-col cols="3"> <v-text-field v-model="creator.orcid" - :rules="[v => validateOrcid(v) || $t('Invalid ORCID')]" name="orcid" label="ORCID" /> </v-col> @@ -153,7 +167,7 @@ </template> <script> -import { formatDateUTC, isValidOrcid } from '@/utils' +import { formatYearUTC, formatMonthUTC, formatDayUTC } from '@/utils' export default { data () { return { @@ -240,7 +254,9 @@ export default { qid: parseInt(this.$route.params.query_id), title: null, description: null, - publication: formatDateUTC(Date.now()), + publication_year: formatYearUTC(Date.now()), + publication_month: formatMonthUTC(Date.now()), + publication_day: formatDayUTC(Date.now()), visibility: 'everyone', doi: null, creators: [], @@ -272,12 +288,6 @@ export default { this.$parent.$parent.$parent.persistQueryDialog = false this.$emit('close', { action: 'closed' }) }, - validateOrcid (orcid) { - if (!orcid || orcid.length === 0) { - return true - } - return isValidOrcid(orcid) - }, addCreatorSelf () { if (!this.user.firstname || !this.user.lastname) { this.addCreator() @@ -344,6 +354,9 @@ export default { this.loading = false }, async loadUser () { + if (!this.token) { + return + } this.loading = true let res try { diff --git a/fda-ui/layouts/default.vue b/fda-ui/layouts/default.vue index 9f186cbe423dd59ab2c484ec05938ce3463060c9..1a6cfad60f865d9f1d880b35977720c283e58a42 100644 --- a/fda-ui/layouts/default.vue +++ b/fda-ui/layouts/default.vue @@ -201,6 +201,7 @@ export default { this.$store.commit('SET_TOKEN', null) this.$store.commit('SET_USER', null) this.$toast.success('Logged out') + this.$vuetify.theme.dark = false this.$router.push('/container') }, async loadDB () { diff --git a/fda-ui/pages/container/_container_id/database/_database_id/info.vue b/fda-ui/pages/container/_container_id/database/_database_id/index.vue similarity index 100% rename from fda-ui/pages/container/_container_id/database/_database_id/info.vue rename to fda-ui/pages/container/_container_id/database/_database_id/index.vue diff --git a/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue b/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue index 5d55f4df5fe2738f666673557336657acaf82d22..7623073dbdca02119ad8e8f5a4cd310ed55fad23 100644 --- a/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue +++ b/fda-ui/pages/container/_container_id/database/_database_id/query/_query_id/index.vue @@ -8,7 +8,7 @@ </v-toolbar-title> <v-spacer /> <v-toolbar-title> - <v-btn v-if="!identifier.id && !loadingIdentifier" color="secondary" class="mr-2" :disabled="error || erroneous || !executionUTC || !token" @click.stop="openDialog()"> + <v-btn v-if="token && !identifier.id && !loadingIdentifier" color="secondary" class="mr-2" :disabled="error || erroneous || !executionUTC" @click.stop="openDialog()"> <v-icon left>mdi-content-save-outline</v-icon> Save </v-btn> <v-btn v-if="result_visibility" :disabled="error" color="primary" :loading="downloadLoading" @click.stop="download"> diff --git a/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue b/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue index 4ea69814bb271e55f6df987bce6e150813a6e5a3..269887ef5277bbf3b4ffd5ce062badc352e78420 100644 --- a/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue +++ b/fda-ui/pages/container/_container_id/database/_database_id/table/_table_id/index.vue @@ -21,13 +21,13 @@ <v-btn v-if="is_owner && canDelete" color="error" class="mr-2 mb-1" @click="deleteItems"> <v-icon left>mdi-delete</v-icon> Delete<span v-if="selection.length > 1"> {{ selection.length }}</span> </v-btn> - <v-btn :disabled="!token" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/query/create?tid=${$route.params.table_id}`" color="secondary" class="mr-2 mb-1" @click="deleteItems"> + <v-btn v-if="token" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/query/create?tid=${$route.params.table_id}`" color="secondary" class="mr-2 mb-1" @click="deleteItems"> <v-icon left>mdi-wrench</v-icon> Create Subset </v-btn> - <v-btn :disabled="!token" class="mb-1" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/import`"> + <v-btn v-if="token" class="mb-1" :to="`/container/${$route.params.container_id}/database/${$route.params.database_id}/table/${$route.params.table_id}/import`"> <v-icon left>mdi-cloud-upload</v-icon> Import csv </v-btn> - <v-btn :disabled="error" class="ml-2 mb-1" :loading="downloadLoading" @click.stop="download"> + <v-btn class="ml-2 mb-1" :loading="downloadLoading" @click.stop="download"> <v-icon left>mdi-download</v-icon> Download csv </v-btn> <v-btn @@ -314,6 +314,9 @@ export default { this.loadingData = false }, async loadUser () { + if (!this.token) { + return + } try { const res = await this.$axios.put('/api/auth', {}, this.config) this.user = res.data diff --git a/fda-ui/pages/container/index.vue b/fda-ui/pages/container/index.vue index 7ef5bd92806eab9ac7c0a83adf60070aac201d03..fa2ea800564da5321c379c6b169cb4179b8a3c29 100644 --- a/fda-ui/pages/container/index.vue +++ b/fda-ui/pages/container/index.vue @@ -157,7 +157,7 @@ export default { return formatTimestampUTCLabel(str) }, loadDatabase (database) { - this.$router.push(`/container/${database.container_id}/database/${database.id}/info`) + this.$router.push(`/container/${database.container_id}/database/${database.id}`) } } } diff --git a/fda-ui/pages/user/index.vue b/fda-ui/pages/user/index.vue index b6222f1bf74cf28538e4c13abfbf338be915f513..f85a9a9c4448f2db6bdb89c7ae7eb26029a84881 100644 --- a/fda-ui/pages/user/index.vue +++ b/fda-ui/pages/user/index.vue @@ -248,6 +248,9 @@ export default { submit () { }, async loadUser () { + if (!this.token) { + return + } try { this.loading = true const res = await this.$axios.put('/api/auth/', {}, this.config) diff --git a/fda-ui/utils/index.js b/fda-ui/utils/index.js index 44d82b1ef560064c37cef242a7cc4140ee8ab5aa..619ebbdbae08796810bc0d7cf3ef929009fa13eb 100644 --- a/fda-ui/utils/index.js +++ b/fda-ui/utils/index.js @@ -77,6 +77,30 @@ function formatDateUTC (str) { return format(new Date(date), 'yyyy-MM-dd') } +function formatYearUTC (str) { + if (str === null) { + return null + } + const date = new Date(str).toISOString().slice(0, -1) + return format(new Date(date), 'yyyy') +} + +function formatMonthUTC (str) { + if (str === null) { + return null + } + const date = new Date(str).toISOString().slice(0, -1) + return format(new Date(date), 'MM') +} + +function formatDayUTC (str) { + if (str === null) { + return null + } + const date = new Date(str).toISOString().slice(0, -1) + return format(new Date(date), 'dd') +} + function formatTimestamp (str) { if (str === null) { return null @@ -108,5 +132,8 @@ module.exports = { formatDateUTC, isNonNegativeInteger, isValidOrcid, - formatUser + formatUser, + formatYearUTC, + formatMonthUTC, + formatDayUTC }