-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: SocialMediaConfig models, admin form, serializer & frontend in…
…tegration (#1166) * feat: Add SocialMediaConfigForm for managing social media sharing settings * feat: Add serializer for SocialMediaConfig for ExperimentCollection serializer * feat: Add SocialMediaConfig interface to ExperimentCollection * feat: Update ExperimentCollectionDashboard and Header component to include social media sharing settings * refactor: Alter SocialMediaConfig model to include all the social media / share options supported by the frontend * refactor: Convert Social component to TypeScript * chore: Re-create migration after applying the migrations from #1164 * test: Add Social component unit tests * refactor: Use consistent test id naming * test: Add test for experiment collection with social media config, thereby also testing the social media config serializer
- Loading branch information
1 parent
79282db
commit 865dd72
Showing
12 changed files
with
300 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 4.2.11 on 2024-07-02 08:46 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('experiment', '0040_alter_phase_options_remove_phase_order_phase_index_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='SocialMediaConfig', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), blank=True, default=list, help_text='List of tags for social media sharing', size=None)), | ||
('url', models.URLField(blank=True, help_text='URL to be shared on social media. If empty, the experiment URL will be used.')), | ||
('content', models.TextField(blank=True, default='I scored {points} points in {experiment_name}!', help_text='Content for social media sharing. Use {points} and {experiment_name} as placeholders.')), | ||
('channels', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(choices=[('facebook', 'Facebook'), ('whatsapp', 'WhatsApp'), ('twitter', 'Twitter'), ('weibo', 'Weibo'), ('share', 'Share'), ('clipboard', 'Clipboard')], max_length=20), blank=True, default=list, help_text='Selected social media channels for sharing', size=None)), | ||
('experiment_collection', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='social_media_config', to='experiment.experimentcollection')), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.