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

Welcome Tour: Update the user model #5171

Closed
ErisDS opened this issue Apr 21, 2015 · 2 comments
Closed

Welcome Tour: Update the user model #5171

ErisDS opened this issue Apr 21, 2015 · 2 comments
Labels
good first issue [triage] Start here if you've never contributed before. server / core Issues relating to the server or core of Ghost

Comments

@ErisDS
Copy link
Member

ErisDS commented Apr 21, 2015

This issue is part of the welcome tour feature and should be implemented behind a config flag (not labs) to start with. An example of how to do this exists in this PR.


Description:

On the server side, the user model should get a single additional field which stores a JSON object containing each tour item and whether or not it is seen. This data will be passed via the User API as per usual, such that Ember always knows the state of the currently logged in user's tour.

Spec:

The user model needs a new field added to it. Recommended name is tour, and it should have the same type and maxlength as value in the settings table. The tour field should be nullable and not have a default value, tour items will appear there when they have some data to persist (see #).

Adding new columns to our database schema in schema.js means we need to ensure that a migration is triggered. This means we also need to bump our database version in default-settings.json and update the hashes in the tests that check this doesn't change.

It will also be necessary to update several API tests and other locations to ensure that the API knows about and properly handles the new tour field.

Note: it would be ideal to bundle the additional post field needed for the preview feature into this database migration.

The result of this issue should be the new tour field being provided via the User API.

@ErisDS ErisDS added data good first issue [triage] Start here if you've never contributed before. server / core Issues relating to the server or core of Ghost labels Apr 21, 2015
@letsjustfixit
Copy link
Contributor

@ErisDS

[..] we'll need to add a new preview field to the posts table which defaults to private. This field would
be used when handling the /p/ route [..]

Could you please clarify the max size of the preview field mentioned above? The only specific there was sebgie's 20 chars i could find.

For now its:
preview: {type: 'string', maxlength: 20, nullable: true, defaultTo: 'private'},

@ErisDS
Copy link
Member Author

ErisDS commented Apr 28, 2015

It no longer makes sense to bundle the changes together. As explained in the preview issue, we aren't going to be adding the part of the feature that needs it for a while.

@ErisDS ErisDS mentioned this issue Jun 30, 2015
31 tasks
sebgie pushed a commit to sebgie/Ghost that referenced this issue Aug 31, 2015
closes TryGhost#5171

- adds tour field to user model
- Bump Schema version
- Update tests
ErisDS pushed a commit to ErisDS/Ghost that referenced this issue Sep 1, 2015
closes TryGhost#5171

- adds tour field to user model
- Bump Schema version
- Update tests
@ErisDS ErisDS closed this as completed in 6938216 Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue [triage] Start here if you've never contributed before. server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

2 participants