artq99 / artushima Goto Github PK
View Code? Open in Web Editor NEWThe web-app for the Neuroshima RPG.
The web-app for the Neuroshima RPG.
Specification for a new functionality.
User story
As a game master I want to be able to start a new campaign. I want to specify its title and in-game start date.
To do:
role_start_campaign
The administrators should have an option to manage users. The implementation should be refactored and extended version of the code provided by the POC.
This issue is a part of the issue #5.
Use case 1
The user should be able to receive an authentication token, by using the web-api endpoint api\auth\login
.
Use case 2
The user should be able to logout, by using the web-api endpoint api\auth\logout
. The authentication token provided in the request header should be then blacklisted.
Use case 3
The user should be able to be authorised by providing the authentication header in the request. To fulfil the authorisation requirements, the token has to be valid (not expired and not blacklisted), and the user must have the permission specified for the called endpoint.
This issue is a part of the issue #5.
This issue should be implemented along with the issue #7.
To do:
auth_service
with methods log_in
and log_out
Remediation
Upgrade acorn to version 6.4.1 or later. For example:
"dependencies": {
"acorn": ">=6.4.1"
}
or…
"devDependencies": {
"acorn": ">=6.4.1"
}
Right now, the arguments passed through execution chains are validated in various layers. This is inconsistent and very chaotic.
Key points of the refactoring
This decision should be also documented in the project wiki.
To do:
user_dao
create
method and its testsuser_history_dao
create
method and its testsauth_internal_service
generate_token
method and its tests - here handling a missing property can be made better.user_internal_service
check_if_user_exists
method and its testscreate_user
and its testsuser_history_internal_service
create_user_history_entry
method and its testsauth_service
authenticate
method - checking user roles should be moved to a separate method, possibly in the auth_internal_service
class (?)startup_service
check_if_superuser_exists
method and its testscreate_superuser
method and its tests; handling missing propertyauth_endpoint.log_in
auth_endpoint.log_out
User story
As an administrator I want to be able to delete a user.
On the application startup the program should check, if the superuser exists - if not, it should be created. This functionality has been already implemented in the POC. The new implementation should be based on the old one, but refactored to match the new architecture principles.
This issue is a part of the issue #5.
The method user_dao.read_by_user_name
Reads the user from the database.
The method user_dao.create
Persists a new user in the database.
The method user_history_dao.create
Persists a new user history entry in the database.
The method user_internal_service.check_if_user_exists
Calls the method user_dao.read_by_user_name
. If the returned value is not None
, returns True
, False
otherwise.
The method user_internal_service.create_user
Calls the method user_dao.create
.
The method user_history_internal_service.create_user_history_entry
Calls the method user_history_dao.create
.
The method startup_service.check_if_superuser_exists
Calls the method user_internal_service.check_if_user_exists
with the superuser as a user name, handling all the exceptions that can occur. Returns a standard service response.
The method create_superuser
Retrieves the superuser's password from the properties, creates the password hash string (using Werkzeug), creates the superuser input data and calls user_internal_service.create_user
. Then, it creates the input data and calls user_history_internal_service.create_user_history_entry
. It should handle all the exceptions that can occur and return a standard service response.
The functionalities provided by the POC should be implemented in the app.
The functionalities to migrate:
Upgrade handlebars to version 4.3.0 or later. For example:
"dependencies": {
"handlebars": ">=4.3.0"
}
or…
"devDependencies": {
"handlebars": ">=4.3.0"
}
On login, when an incorrect user name is given and the password input is empty, the following message is shown: Niepoprawny login lub hasło.
. This is the desired behavior, but when the user name is correct and the password input is empty, the message is: Brakujące dane: Hasło.
. This can be used by a malevolent person to get access to existing user names.
To do:
Niepoprawny login lub hasło.
When a user does not log out from the application, the token remains in the local storage. This way it is possible to access the dashboard with an expired token.
On the web-application startup, if a token is present in the local storage, it should be validated.
To do:
The web-application is missing a component that would display messages sent by the application.
To do:
Specified in #23
Right now, when an administrator creates a new user, s/he must provide a password.
The password should be generated and displayed only once after creation. The same should happen after password reset, a feature described in #29.
User story
As a user I want to be able to view a page with all the details of a campaign I participate in/run.
The following data should be shown on the details page:
The children components to implement:
TODO
Since more subtypes of BusinessError
will be implemented and raised during the validation processes, a handler for these exceptions should be implemented to be used in services.
The handler should return a corresponding message in Polish basing on the type of error passed as an argument.
To do:
error_handler
Integration of the ngx-translate in the GUI app.
TODO
User story
As an administrator I want to be able to reset user's password.
User story
As a player I want to be able to view all campaigns I participate in and navigate to the page of a selected one.
User story
As an admin I want to be able to see details of every campaign, whether I am its game master or a player participating in it, or not.
This issue describes a feature that allows game masters to create session summaries - short descriptions of what happened during each session. The summaries can be seen on the details page of a campaign.
User story
As a game master I want to be able to add a session summary to my campaign. I should be able to specify the date when the session took place, add a session title and a text describing what happened during the session.
First step in implementing the editor is to add a toolbar on the campaign page. It should only appear when the page is opened by the game master of a particular campaign. The toolbar should be placed just under the header. The design prototype is shown in the image below:
The button on the toolbar should lead to the page with the editor, illustrated by the prototype below:
When the submit button is clicked, the editor should check if the fields with title and the date are filled, and show an appropriate warning if not (the description can be left empty). If everything is correct, a POST request should be sent towards the backend.
The creation of a new session summary should be able through the endpoint: \my_campaigns\<int:campaign_id>\timeline\entry
(method: POST
). On the endpoint call, the application should make the following checks:
ROLE_CREATE_SESSION_SUMMARY
CAMPAIGN_TIMELINE
Session summaries should be stored in the database in the new table: CAMPAIGN_TIMELINE
:
name | type | nullable |
---|---|---|
id | INT UNSIGNED | no |
created_on | DATETIME | no |
modified_on | DATETIME | no |
opt_lock | INT UNSIGNED | no |
title | TINYTEXT | no |
session_date | DATE | no |
summary_text | TEXT | yes |
User story
As a user I want to be able to see the summaries of all sessions of a campaign. The summaries should be displayed on the campaign page.
The stub implementation of the GUI component showing session summaries has been already added to the details page of a campaign. In this issue a working solution should be implemented, as shown by the image below:
The data shown by the component should be retrieved by the GUI through the endpoint: \my_campaigns\<int:campaign_id>\timeline
(method: GET
).
The endpoint should return all session summaries of the campaign. On the call it should check if the user is related to the campaign and has a role ROLE_VIEW_CAMPAIGN_TIMELINE
.
Basic flask-app should be implemented.
User story 1
As a game master I want to be able to invite other players to my campaigns by giving their user name.
User story 2
As a player I want to be able to receive and view the invitations. I want to be able to respond to them and give an information with which character I want to participate in.
User story 3
As a game master I want to be able to accept or decline the character proposals. When I decline a character, the invitation should return to the player, who can respond with the same (corrected) character or a new one.
User story
As a player I want to be able to create a character.
In the first phase the creator should be implemented only as a stub: Users should be able to specify only the name of a character.
Specified in #23
To unify the format of the dates across the application, the UTC date should be used everywhere.
It should be up to the client to transform the date to the correct time zone.
The method auth_service.log_in
does not handle errors that can be raised by the auth_internal_service
on generating the authentication token.
To do:
In the POC displaying the list of campaigns run by the currently logged in game master has been implemented. This implementation should be migrated into the application.
This issue is a part of the issue #5.
Use case
As a game master I want to be able to see a list of all campaigns that I run. I want to have access to this list from my dashboard.
To do:
campaign
and campaign_history
campaign
campaign_repository
with the method get_by_gm_id
retrieving the GM's campaigns from the databasecampaign_service
with the method get_campaigns_by_gm_id
validating the existence of the given user and calling the repositoryrole_show_owned_campaigns
allowing a user to view the campaigns belonging to himauth_service
-- get_user_id
. The method should return the ID of the currently logged in userapi/my_campaigns
and the web-method /list
In #22 the page showing the details of a selected campaign has been implemented, but it shows stub-data. In this issue we add a new API endpoint that should deliver the data from the database and modify the GUI to integrate it with the endpoint.
The endpoint should be available under the URL: /api/my_campaigns/details/<campaignId>
The web method: GET
Only the users who are the game masters of a given campaign should be able to get the data. In the future this functionality will be made available also to the participating players.
The object returned by the endpoint should have the following structure:
{
"status": "success",
"message": "",
"campaignDetails": {
"id": 99,
"title": "<campaign title>",
"creationDate": "<date in the ISO format>",
"startDate": "<date in the ISO format>",
"passedDays": 99,
"currentDate": "<date in the ISO format>",
"gameMasterId": 99,
"gameMasterName": "<user name>"
}
}
On any error, the endpoint should return the following response:
{
"status": "failure",
"message": "<error description>"
}
The GUI application should send the request in the MyCampaignsAdapterService
class.
The component CampaignDetailsComponent
(and its subcomponents) should call the service, get the data and display it correctly.
currentDate
- this field is in fact the result of the following equation: startDate + passedDays
gameMasterId
- we do not want to show it on the page. It is sent with the response for future use (navigating to the details of a user)
In order to extend the abilities of the application, a new frontend should be introduced - a web-app created in Angular.
This task is about providing a prototype of such application and adjusting the existing code to the requirements.
To do:
The issue will be implemented on the separate branch dev_webapp_prototype
.
When all the to-dos in this issue are implemented, the branch will be able to be merged into the main development branch.
For one of the dependencies of the web-app a security risk has been reported.
Dependency name: serialize-javascript
Current version: 1.9.1
Safe version: 2.1.1
User story
As a user I want to be able to change my password.
The basic layout of the project structure should be created.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.