Closed jmgasper closed 4 years ago
Contest https://www.topcoder.com/challenges/30121991 has been created for this ticket.This is an automated message for ghostar via Topcoder X
Contest https://www.topcoder.com/challenges/30121991 has been updated - it has been assigned to obog.This is an automated message for ghostar via Topcoder X
@jmgasper I think it's better to write a Javascript script and use the vanilla API to remove all existing categories and create default categories.
Add npm run removeAllCategories
and npm run setupCategories
to package.json.
Perhaps this is useful for further testing of the forum. If you are ok with this solution to the problem, I will start working on it.
@atelomycterus - Yep, that makes sense, thanks.
@jmgasper a couple of questions: 1) All challenge categories are created as categories with type='heading'. To implement the requrement 'add new challenge categories underneath the respective parent category, like "Challenges Forum --> Development Forums"', we need to find categoryId of 'Challenges Forum' but the endpoint '/categories/search' doesn't search by categories with type='heading'.
The source code '/vanilla-src/package/applications/vanilla/models/class.categorymodel.php'
/**
* Search for categories by name.
*
* @param string $name The whole or partial category name to search for.
* @param bool $expandParent Expand the parent category record.
* @param int|null $limit Limit the total number of results.
* @param int|null $offset Offset the results.
* @param array $expand List of data need to be expanded/joined.
* @return array
*/
public function searchByName($name, $expandParent = false, $limit = null, $offset = null, array $expand = []) {
if ($limit !== null && filter_var($limit, FILTER_VALIDATE_INT) === false) {
$limit = null;
}
if ($offset !== null && filter_var($offset, FILTER_VALIDATE_INT) === false) {
$offset = null;
}
$query = $this->SQL
->from('Category c')
->where('CategoryID >', 0)
->where('DisplayAs <>', 'Heading')
->like('Name', $name)
->orderBy('Name');
....
}
So should we fix Vanilla source code or use another type (e.g. 'nested categories') for 'Challenges Forum'? What category type should be used for other default categories? Headings?
2) As you know, the challenge-forum-processor creates a new role for a new category automatically. In this task should we implement cleanup a role list? If yes, which approach to use: a.) remove all roles except default vanilla roles (Guest, Applicant, Memeber, Moderator, Administrator, Unconfirmed)? b.) use category-role relation(a role name is equals to challengeId) and remove the role created with the category.
3) Vanilla 3.3 has been deployed on http://vanilla.topcoder-dev.com/ . The version of Vanilla is displayed in the footer of a web page.
The docker uses Vanilla 3.0 (released 10 June, 2019 ). The latest release is Vanilla 3.3 (released Oct 29, 2019 ). So I updated a docker file.
Important notes:
The root folder of Vanilla shouldn't be named '/app'. It throws "Fatal Error in Twig\Loader\FilesystemLoader.findTemplate();
Unable to find template "lications/vanilla/views/vanillasettings/editcategory.twig" (looked into: /app)." from the version 3.2+.
The function "renderTwig(string $path, array $data)" ('vanilla-src/package/library/Vanilla/Web/TwigRenderTrait.php) build a wrong path.
if ROOT_PATH='/app' then it tries to find a twig file in 'lications/vanilla/views/
Let's just use nested categories. I want to try to limit what we do to Vanilla so that we can upgrade it easily.
Let's just remove all the roles except the default ones for now
Ok, thanks.
@jmgasper Fixed. Need to apply PR.
If you testing with a docker locally, you need to rebuild it. The docker uses Vanilla 3.3.
Steps:
Delete categories and roles. If a category has discussions or comments then they are deleted automatically.
npm run cleanData
Create topcoder categories
npm run setupData
npm run start
Found a bug in Vanilla 3.3: The endpoint '/categories/{id}' deletes a category with discussions and comments but records are not deleted from the table 'GDN_UserDisscussion'. The wrong count of 'My Discussions' is displayed. If click on 'My discussions' then 'No discussions were found' because all discussion records were deleted.
So DB is in an inconsistent state:
I have checked the tables 'GDN_UserComment' and 'GDN_Comment'. all records were deleted. The issues only with count of discussions.
Perhaps need to create separate tickets with the 'known issue' status that can be fixed if Vanill is used in the future.
@atelomycterus - This looks good, thanks. One tweak needed still:
I'm not seeing Design Forums
and Development Forums
as a sub category to Challenges Forum
@jmgasper I see, I missed the second level categories. The forum processor added new challenge category underneath 'Challenges Forum'. I thought they would be created with payloads.
TODO: So 'Development Forums' and 'Design Forums' are default categories as well.
Should we analyze the track of a challenge to match the Topcoder layout (https://apps.topcoder.com/forums)?
For example,
The forum processor should add a new challenge category underneath 'Development Forums' for a challenge with the track 'DEVELOP'.
The forum processor should add a new challenge category underneath 'Design Forums' for a challenge with the track 'DESIGN'.
What about DATA_SCIENCE and COPILOT?
Correct, Development Forums
and Design Forums
are defaults. Let's add Data Science Forums
for the DATA_SCIENCE
category as well.
Yes, we should add the challenges to the correct sub-category.
We can ignore COPILOT challenges from creating forums - they won't need forums
I'll bump the payment here for the additional work.
@jmgasper Thanks for the additional payment. Sorry for a delay with this task. I am stuck with #12, I have been trying to fix the link color for alerts and notifications. Please apply PR.
Verification:
npm run cleanData
npm run setupData
You should see subcategories:
'npm run start' and send a message to the topic. The challenge should be created underneath the appropriate forum:
Payment failed: [500]: Failed to get billing detail for the project.This is an automated message for ghostar via Topcoder X
Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30121991This is an automated message for ghostar via Topcoder X
In dev (http://vanilla.topcoder-dev.com), we have a lot of "junk" left over from previous challenges.
We need to: