[PAID GIG] Requirements for Discourse Plugin for Topic View Serializer

What would you like done?

RE: https://community.unix.com/

We have just completed migration to Discourse but are leaving our old forums accessible until 2021 because we have two decades of legacy code, which each of our members are proud of (and put a lot of work into).

For our staff who would like to check the integrity of migrated code from time-to-time, we would like a small plugin to split the value from the topic_custom_fields and add only the integer (which is the legacy forum thread id) to the TopicViewSerializer, so the JSON serializer with have the additional key, value pair:

"import_id" : <thread_id_of_legacy_forum>

See query below as an example, so the value added to the TopicViewSerializer (for this Discourse topic_id) will be:

"import_id": 284071
postgres=# \c discourse
You are now connected to database "discourse" as user "postgres".
discourse=# select * from topic_custom_fields where name like '%import_id%' and topic_id = 377947;
   id   | topic_id |   name    |     value     |         created_at         |         updated_at         
--------+----------+-----------+---------------+----------------------------+----------------------------
 239520 |   377947 | import_id | thread-284071 | 2020-04-22 03:20:03.968513 | 2020-04-22 03:20:03.968513
(1 row)

We want to use this property in a template component as follows:

{{import_id}}

Because we would like a small <span> template component for the topic-category plugin-outlet , which will look like this (and visible to only our specified trust level):

<span class='import-id'>Legacy Forum Thread <a class='import-id-link' href='https://www.unix.com/showthread.php?t={{import_id}}'>{{import_id}}</a></span>

When do you need it done?

Anytime in the next few weeks is fine. No big rush.

What is your budget, in $ USD that you can offer for this task?

All reasonable quotes for this small plugin are welcome.

Additional Info

We plan to make this code freely available to all who have done a similar migration. However, it is very possible that other legacy forums many not have such a high data integrity concern for legacy code, and so it’s possible our forum will be the only forum who uses this plugin.

I did a “overly complex” and so maybe an “inaccurate” write up on this requirement yesterday; so I think the description above is simpler and easier to understand (hopefully):

Footnote

Worked on this small plugin myself for a number of days, my first attempt at a Discourse plugin, and kept getting a null value for import_id in the TopicViewSerializer.

Update

Thanks to a bit of kindness and tutoring, I have the serializer part of this task working now.

3 Likes

Update:

The work on this plugin is progressing thanks to some gentle coaching, encouragement, and hand-holding by @spirobel.

Still working on the code, step-by-step, and will polish it up and make it available for any migrators who might have a similar requirement in the future.

@spirobel has been really great to work with, letting me do most of the work and debugging myself, but providing me tips, code, draft PRs, and clues when I hit a brick wall.

Thanks @spirobel !

6 Likes

Update:

Just completed (alpha version) and have started live testing my first plugin.

Status:

  • Live testing

TODO

  • This is my first Discourse plugin. The link to the legacy forum is hard coded into the component. Need to make this a configurable setting.
  • Improve plugin over time to bring the coding up to “Discourse standard”, because it is far from that now.
  • Post in the plugin category when the testing is done.

Acknowledgement

A special thank you to @spirobel for coaching me yesterday and helping me get the serializer working and the basic component structure working.

Caveat

All “non-standard or bad coding” practices are all mine.

Notes

This legacy forum info is only visible (configurable) to trust level 4 members on our forums;

7 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.