TheRosettaFoundation / SOLAS-Match

Self-managed translation project interface
www.TheRosettaFoundation.org
GNU Lesser General Public License v3.0
12 stars 8 forks source link

Automatically track Projects for (some?) Site Administrators when Project Created #1245

Closed alanbarrett closed 8 years ago

alanbarrett commented 8 years ago

When a Project is created, automatically (for some admins) Track the Project. @Paulina-Rosetta requested this.

Alan.
aquilax commented 8 years ago

@alanbarrett Is this the right method to get the site administrators?

alanbarrett commented 8 years ago

@aquilax,

Yes when called with no parameters. This function is at the API (api/) level. Although we only want "some" admins to track.

I thought you were thinking of doing this at the database level.

At the database it is... call getAdmin(NULL, NULL); or SELECT * from Admins WHERE organisation_id IS NULL;

The database procedure userTrackProject() tracks a project for a user.

Alan.
aquilax commented 8 years ago

@alanbarrett yes database will save the round-trips, but on the other side deploying changes in the schema is quite inconvenient.

How do you prefer to identify the admins, which will follow the project: separate table in the database, separate field in Admins, list of id-s in the config, or any other angle, I'm missing ?

alanbarrett commented 8 years ago

@aquilax ,

I had thought a separate table in the database. It could just be one row for each person that should track. They might not even be admins. I would have been happy to hand deploy to the Live server and test servers.

However I think you have convinced me that we could avoid any database changes by adding a new config setting (list of user ids) and some code at API level to track the project for those user ids. If the config setting is not present, it should be assumed to be empty.

Alan.
aquilax commented 8 years ago

Changes in database would be fine if we had proper migrations, but since that is not the case, there is always the doubt if the update was applied or not.

Will place it in the config. :+1:

alanbarrett commented 8 years ago

@Paulina-Rosetta who do you want to automatically follow all new projects? You and ???

@aquilax (Evgeniy) has done code for that, which we will be deploying soon.

Alan.
Paulina-Rosetta commented 8 years ago

Just me for now. Thanks!

alanbarrett commented 8 years ago

@Paulina-Rosetta I have now tested and deployed @aquilax 's code for this issue to the live server. So from now you should automatically be tracking new Projects (and their related tasks).

Alan.
Paulina-Rosetta commented 8 years ago

Seems to work perfectly - thank you both