Skip to content

Commit

Permalink
feat: Remove warnings for LimeSurvey 6.0 features (#803)
Browse files Browse the repository at this point in the history
* feat: Remove warnings for LimeSurvey 6.0 features

* Document when each client feature was added or changed

* Restore XFAIL markers

* Add change file
  • Loading branch information
edgarrmondragon authored Apr 5, 2023
1 parent f18a2bb commit b2c1cef
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Changed-20230404-205306.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Changed
body: Remove warnings for LimeSurvey 6.0 features
time: 2023-04-04T20:53:06.537221-06:00
custom:
Issue: "803"
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ and is generated by [Changie](https://github.com/miniscruff/changie).
* [#207](https://github.com/edgarrmondragon/citric/pull/207) Implement `add_language` in client
* [#210](https://github.com/edgarrmondragon/citric/pull/210) Implement `add_survey` in client
* [#231](https://github.com/edgarrmondragon/citric/pull/231) Implement `get_`*_properties in client
* [#240](https://github.com/edgarrmondragon/citric/pull/237) Implement `export_statistics`, `save_statistics` and `save_responses` in client
* [#241](https://github.com/edgarrmondragon/citric/pull/241) Implement `get_summary` in client
* [#240](https://github.com/edgarrmondragon/citric/pull/240) Implement `export_timeline` in client

Expand Down Expand Up @@ -137,8 +138,7 @@ and is generated by [Changie](https://github.com/miniscruff/changie).
## 0.0.5 - 2021-12-20
### Changed

* [#117](https://github.com/edgarrmondragon/citric/pull/117) Removed `read_file` and `write_file` methods in favor of support for arbitrary binary file-like objects

* [#117](https://github.com/edgarrmondragon/citric/pull/117) Removed `read_file` and `write_file` methods in favor of support for arbitrary binary file-like objects. Implemented `get_uploaded_files` in client.

## 0.0.4 - 2021-12-17

Expand Down Expand Up @@ -177,16 +177,16 @@ and is generated by [Changie](https://github.com/miniscruff/changie).
- `activate_survey`
- `activate_tokens`
- `add_participants`
- `delete_participants`
- `add_response`
- `delete_participants`
- `delete_survey`
- `download_files`
- `export_responses`
- `export_responses_by_token`
- `get_participant_properties`
- `get_response_ids`
- `get_site_settings`
- `get_survey_properties`
- `get_uploaded_files`
- `import_survey`
- `list_participants`
- `list_questions`
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
limesurvey:
image: edgarrmondragon/limesurvey
build:
context: ${LS_DOCKERFILE_CONTEXT:-https://github.com/martialblog/docker-limesurvey.git#master:5.0/apache}
context: ${LS_DOCKERFILE_CONTEXT:-https://github.com/martialblog/docker-limesurvey.git#master:6.0/apache}
dockerfile: ${LS_DOCKERFILE:-Dockerfile}
args:
version: ${LS_VERSION}
Expand Down
30 changes: 20 additions & 10 deletions docs/_ext/limesurvey_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
if TYPE_CHECKING:
from sphinx.application import Sphinx

__all__ = ["ReleasedFeature", "UnreleasedFeature", "setup"]


class UnreleasedFeature(Directive):
"""A directive for development-only features.
Expand All @@ -19,23 +21,31 @@ class UnreleasedFeature(Directive):
"""

required_arguments = 1
message = (
"This method is only supported in LimeSurvey >= {next_version} "
"(currently in development)."
)
admonition_type = nodes.warning

def run(self) -> list[nodes.Node]:
next_version = self.arguments[0]
admonition_node = nodes.warning(
"",
nodes.paragraph(
text=(
f"This method is only available in LimeSurvey >= {next_version} "
"(currently in development)."
),
),
)
return [admonition_node]
text = self.message.format(next_version=next_version)
return [self.admonition_type("", nodes.paragraph(text=text))]


class ReleasedFeature(UnreleasedFeature):
"""A directive for released features.
Adds a note to features only available after some release of LimeSurvey.
"""

message = "This method is only supported in LimeSurvey >= {next_version}."
admonition_type = nodes.note


def setup(app: Sphinx) -> dict[str, Any]:
app.add_directive("future", UnreleasedFeature)
app.add_directive("minlimesurvey", ReleasedFeature)

return {
"version": "0.1",
Expand Down
Loading

0 comments on commit b2c1cef

Please sign in to comment.