Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
81571c3
Added column for TDAMM tags
dhanur-sharma Jan 2, 2025
3f1eb6b
Added get_tag_source method in delta_url model
dhanur-sharma Jan 31, 2025
ab90a0e
Added get_tag_source to delta and curated serializers
dhanur-sharma Jan 31, 2025
58db367
Added CSS background-color for manual tdamm tag
dhanur-sharma Jan 31, 2025
520fdaf
TDAMM tags is dynamically visible based on presence of the tag
dhanur-sharma Feb 3, 2025
1755178
Deletion logic in place and functional
dhanur-sharma Feb 4, 2025
04793d7
Passing tdamm choice fields to the front end through views
dhanur-sharma Feb 4, 2025
1b38642
Add TDAMM tag functionality functional in Delta URLs
dhanur-sharma Feb 5, 2025
fe795a0
Removed unused CSS
dhanur-sharma Feb 6, 2025
d63db8e
Updated source based background CSS
dhanur-sharma Feb 6, 2025
a92223c
Dynamic tag background based on source
dhanur-sharma Feb 6, 2025
4097b17
Added hover activated tooltips
dhanur-sharma Feb 6, 2025
cd9dbb2
Standardized the modal to confirm delete tags
dhanur-sharma Feb 6, 2025
6dd39ed
Moved the add_tag and remove_tag to delta_url
dhanur-sharma Feb 6, 2025
555c97c
Can add or remove tags from Curated URLs tab
dhanur-sharma Feb 7, 2025
c2de692
Added tests
dhanur-sharma Feb 7, 2025
d2b9685
Added HTML for tdamm tag filter
dhanur-sharma Feb 7, 2025
26f6308
Potential fix for code scanning alert no. 51: Information exposure th…
dhanur-sharma Feb 7, 2025
b8f1865
Potential fix for code scanning alert no. 52: Information exposure th…
dhanur-sharma Feb 7, 2025
8127fc7
Merge branch 'dev' of https://github.com/NASA-IMPACT/COSMOS into 1058…
dhanur-sharma Feb 7, 2025
fb7d964
Cleanup views
dhanur-sharma Feb 7, 2025
d3b1d17
Cleanup delta_url model
dhanur-sharma Feb 7, 2025
3094214
Cleanup JS
dhanur-sharma Feb 7, 2025
aec3bfd
Added additional tests
dhanur-sharma Feb 7, 2025
1b24c0d
Added TDAMM patterns and update views
dhanur-sharma Feb 15, 2025
d1e18b1
Updated patterns, views, serializers, urls
dhanur-sharma Feb 24, 2025
31a24a5
Merge branch 'dev' of https://github.com/NASA-IMPACT/COSMOS into 1058…
dhanur-sharma Feb 24, 2025
853c13b
Added migration file
dhanur-sharma Feb 25, 2025
4cb16b0
Patterns work with delta URL page
dhanur-sharma Feb 25, 2025
3fb2940
Tag addition and removal functional through patterns
dhanur-sharma Feb 27, 2025
1d2848b
TDAMM tag patterns functional
dhanur-sharma Mar 6, 2025
c6b982c
Updated pattern model for multiple tags
dhanur-sharma Mar 10, 2025
6274acb
Updating logic for tags list - wip
dhanur-sharma Mar 11, 2025
68c1e40
Merge branch 'dev' of https://github.com/NASA-IMPACT/COSMOS into 1058…
dhanur-sharma Mar 28, 2025
26a44e7
Merged migrations
dhanur-sharma Apr 2, 2025
8205c24
Updated add and remove tag in views
dhanur-sharma Apr 2, 2025
10eba72
Updated unapply and _apply_tag_operation
dhanur-sharma Apr 2, 2025
0d2df05
add_tag functional
dhanur-sharma Apr 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions sde_collections/migrations/0076_deltatdammtagpattern.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Generated by Django 4.2.9 on 2025-02-14 23:33

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0075_alter_collection_reindexing_status_and_more"),
]

operations = [
migrations.CreateModel(
name="DeltaTdammTagPattern",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"match_pattern",
models.CharField(
help_text="This pattern is compared against the URL of all documents in the collection",
verbose_name="Pattern",
),
),
(
"match_pattern_type",
models.IntegerField(choices=[(1, "Individual URL Pattern"), (2, "Multi-URL Pattern")], default=1),
),
(
"tag",
models.CharField(
choices=[
("Not TDAMM", "Not TDAMM"),
("MMA_M_EM", "Messenger - EM Radiation"),
("MMA_M_EM_G", "Messenger - EM Radiation - Gamma rays"),
("MMA_M_EM_X", "Messenger - EM Radiation - X-rays"),
("MMA_M_EM_U", "Messenger - EM Radiation - Ultraviolet"),
("MMA_M_EM_O", "Messenger - EM Radiation - Optical"),
("MMA_M_EM_I", "Messenger - EM Radiation - Infrared"),
("MMA_M_EM_M", "Messenger - EM Radiation - Microwave"),
("MMA_M_EM_R", "Messenger - EM Radiation - Radio"),
("MMA_M_G", "Messenger - Gravitational Waves"),
("MMA_M_G_CBI", "Messenger - Gravitational Waves - Compact Binary Inspiral"),
("MMA_M_G_S", "Messenger - Gravitational Waves - Stochastic"),
("MMA_M_G_CON", "Messenger - Gravitational Waves - Continuous"),
("MMA_M_G_B", "Messenger - Gravitational Waves - Burst"),
("MMA_M_C", "Messenger - Cosmic Rays"),
("MMA_M_N", "Messenger - Neutrinos"),
("MMA_O_BI", "Objects - Binaries"),
("MMA_O_BI_BBH", "Objects - Binaries - Binary Black Holes"),
("MMA_O_BI_BNS", "Objects - Binaries - Binary Neutron Stars"),
("MMA_O_BI_C", "Objects - Binaries - Cataclysmic Variables"),
("MMA_O_BI_N", "Objects - Binaries - Neutron Star-Black Hole"),
("MMA_O_BI_B", "Objects - Binaries - Binary Pulsars"),
("MMA_O_BI_W", "Objects - Binaries - White Dwarf Binaries"),
("MMA_O_BH", "Objects - Black Holes"),
("MMA_O_BH_AGN", "Objects - Black Holes - Active Galactic Nuclei"),
("MMA_O_BH_IM", "Objects - Black Holes - Intermediate mass"),
("MMA_O_BH_STM", "Objects - Black Holes - Stellar mass"),
("MMA_O_BH_SUM", "Objects - Black Holes - Supermassive"),
("MMA_O_E", "Objects - Exoplanets"),
("MMA_O_N", "Objects - Neutron Stars"),
("MMA_O_N_M", "Objects - Neutron Stars - Magnetars"),
("MMA_O_N_P", "Objects - Neutron Stars - Pulsars"),
("MMA_O_N_PWN", "Objects - Neutron Stars - Pulsar Wind Nebula"),
("MMA_O_S", "Objects - Supernova Remnants"),
("MMA_S_F", "Signals - Fast Radio Bursts"),
("MMA_S_G", "Signals - Gamma-ray Bursts"),
("MMA_S_K", "Signals - Kilonovae"),
("MMA_S_N", "Signals - Novae"),
("MMA_S_P", "Signals - Pevatrons"),
("MMA_S_ST", "Signals - Stellar flares"),
("MMA_S_SU", "Signals - Supernovae"),
],
help_text="TDAMM tag to apply",
max_length=255,
),
),
(
"source",
models.CharField(
choices=[("manual", "Manual"), ("ml", "Machine Learning")], default="manual", max_length=10
),
),
(
"collection",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)ss",
related_query_name="%(class)ss",
to="sde_collections.collection",
),
),
("curated_urls", models.ManyToManyField(related_name="%(class)ss", to="sde_collections.curatedurl")),
("delta_urls", models.ManyToManyField(related_name="%(class)ss", to="sde_collections.deltaurl")),
],
options={
"verbose_name": "Delta TDAMM Tag Pattern",
"verbose_name_plural": "Delta TDAMM Tag Patterns",
"ordering": ["match_pattern"],
"abstract": False,
"unique_together": {("collection", "match_pattern")},
},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Generated by Django 4.2.9 on 2025-02-25 00:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0076_deltatdammtagpattern"),
]

operations = [
migrations.RemoveField(
model_name="deltatdammtagpattern",
name="source",
),
migrations.AddField(
model_name="deltatdammtagpattern",
name="operation",
field=models.IntegerField(choices=[(1, "Add Tag"), (2, "Remove Tag")], default=1),
),
migrations.AlterField(
model_name="deltatdammtagpattern",
name="tag",
field=models.CharField(
choices=[
("Not TDAMM", "Not TDAMM"),
("MMA_M_EM", "Messenger - EM Radiation"),
("MMA_M_EM_G", "Messenger - EM Radiation - Gamma rays"),
("MMA_M_EM_X", "Messenger - EM Radiation - X-rays"),
("MMA_M_EM_U", "Messenger - EM Radiation - Ultraviolet"),
("MMA_M_EM_O", "Messenger - EM Radiation - Optical"),
("MMA_M_EM_I", "Messenger - EM Radiation - Infrared"),
("MMA_M_EM_M", "Messenger - EM Radiation - Microwave"),
("MMA_M_EM_R", "Messenger - EM Radiation - Radio"),
("MMA_M_G", "Messenger - Gravitational Waves"),
("MMA_M_G_CBI", "Messenger - Gravitational Waves - Compact Binary Inspiral"),
("MMA_M_G_S", "Messenger - Gravitational Waves - Stochastic"),
("MMA_M_G_CON", "Messenger - Gravitational Waves - Continuous"),
("MMA_M_G_B", "Messenger - Gravitational Waves - Burst"),
("MMA_M_C", "Messenger - Cosmic Rays"),
("MMA_M_N", "Messenger - Neutrinos"),
("MMA_O_BI", "Objects - Binaries"),
("MMA_O_BI_BBH", "Objects - Binaries - Binary Black Holes"),
("MMA_O_BI_BNS", "Objects - Binaries - Binary Neutron Stars"),
("MMA_O_BI_C", "Objects - Binaries - Cataclysmic Variables"),
("MMA_O_BI_N", "Objects - Binaries - Neutron Star-Black Hole"),
("MMA_O_BI_B", "Objects - Binaries - Binary Pulsars"),
("MMA_O_BI_W", "Objects - Binaries - White Dwarf Binaries"),
("MMA_O_BH", "Objects - Black Holes"),
("MMA_O_BH_AGN", "Objects - Black Holes - Active Galactic Nuclei"),
("MMA_O_BH_IM", "Objects - Black Holes - Intermediate mass"),
("MMA_O_BH_STM", "Objects - Black Holes - Stellar mass"),
("MMA_O_BH_SUM", "Objects - Black Holes - Supermassive"),
("MMA_O_E", "Objects - Exoplanets"),
("MMA_O_N", "Objects - Neutron Stars"),
("MMA_O_N_M", "Objects - Neutron Stars - Magnetars"),
("MMA_O_N_P", "Objects - Neutron Stars - Pulsars"),
("MMA_O_N_PWN", "Objects - Neutron Stars - Pulsar Wind Nebula"),
("MMA_O_S", "Objects - Supernova Remnants"),
("MMA_S_F", "Signals - Fast Radio Bursts"),
("MMA_S_G", "Signals - Gamma-ray Bursts"),
("MMA_S_K", "Signals - Kilonovae"),
("MMA_S_N", "Signals - Novae"),
("MMA_S_P", "Signals - Pevatrons"),
("MMA_S_ST", "Signals - Stellar flares"),
("MMA_S_SU", "Signals - Supernovae"),
],
max_length=255,
),
),
]
18 changes: 18 additions & 0 deletions sde_collections/migrations/0078_deltatdammtagpattern_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.9 on 2025-02-25 02:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0077_remove_deltatdammtagpattern_source_and_more"),
]

operations = [
migrations.AddField(
model_name="deltatdammtagpattern",
name="source",
field=models.CharField(default="manual", max_length=10),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.9 on 2025-02-27 02:38

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0078_deltatdammtagpattern_source"),
]

operations = [
migrations.AlterUniqueTogether(
name="deltatdammtagpattern",
unique_together={("collection", "match_pattern", "tag", "operation", "source")},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Generated by Django 4.2.9 on 2025-03-10 21:59

import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0079_alter_deltatdammtagpattern_unique_together"),
]

operations = [
migrations.AlterUniqueTogether(
name="deltatdammtagpattern",
unique_together={("collection", "match_pattern", "operation", "source")},
),
migrations.AddField(
model_name="deltatdammtagpattern",
name="tags",
field=django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(
choices=[
("Not TDAMM", "Not TDAMM"),
("MMA_M_EM", "Messenger - EM Radiation"),
("MMA_M_EM_G", "Messenger - EM Radiation - Gamma rays"),
("MMA_M_EM_X", "Messenger - EM Radiation - X-rays"),
("MMA_M_EM_U", "Messenger - EM Radiation - Ultraviolet"),
("MMA_M_EM_O", "Messenger - EM Radiation - Optical"),
("MMA_M_EM_I", "Messenger - EM Radiation - Infrared"),
("MMA_M_EM_M", "Messenger - EM Radiation - Microwave"),
("MMA_M_EM_R", "Messenger - EM Radiation - Radio"),
("MMA_M_G", "Messenger - Gravitational Waves"),
("MMA_M_G_CBI", "Messenger - Gravitational Waves - Compact Binary Inspiral"),
("MMA_M_G_S", "Messenger - Gravitational Waves - Stochastic"),
("MMA_M_G_CON", "Messenger - Gravitational Waves - Continuous"),
("MMA_M_G_B", "Messenger - Gravitational Waves - Burst"),
("MMA_M_C", "Messenger - Cosmic Rays"),
("MMA_M_N", "Messenger - Neutrinos"),
("MMA_O_BI", "Objects - Binaries"),
("MMA_O_BI_BBH", "Objects - Binaries - Binary Black Holes"),
("MMA_O_BI_BNS", "Objects - Binaries - Binary Neutron Stars"),
("MMA_O_BI_C", "Objects - Binaries - Cataclysmic Variables"),
("MMA_O_BI_N", "Objects - Binaries - Neutron Star-Black Hole"),
("MMA_O_BI_B", "Objects - Binaries - Binary Pulsars"),
("MMA_O_BI_W", "Objects - Binaries - White Dwarf Binaries"),
("MMA_O_BH", "Objects - Black Holes"),
("MMA_O_BH_AGN", "Objects - Black Holes - Active Galactic Nuclei"),
("MMA_O_BH_IM", "Objects - Black Holes - Intermediate mass"),
("MMA_O_BH_STM", "Objects - Black Holes - Stellar mass"),
("MMA_O_BH_SUM", "Objects - Black Holes - Supermassive"),
("MMA_O_E", "Objects - Exoplanets"),
("MMA_O_N", "Objects - Neutron Stars"),
("MMA_O_N_M", "Objects - Neutron Stars - Magnetars"),
("MMA_O_N_P", "Objects - Neutron Stars - Pulsars"),
("MMA_O_N_PWN", "Objects - Neutron Stars - Pulsar Wind Nebula"),
("MMA_O_S", "Objects - Supernova Remnants"),
("MMA_S_F", "Signals - Fast Radio Bursts"),
("MMA_S_G", "Signals - Gamma-ray Bursts"),
("MMA_S_K", "Signals - Kilonovae"),
("MMA_S_N", "Signals - Novae"),
("MMA_S_P", "Signals - Pevatrons"),
("MMA_S_ST", "Signals - Stellar flares"),
("MMA_S_SU", "Signals - Supernovae"),
],
max_length=255,
),
blank=True,
help_text="List of tags to add or remove",
null=True,
size=None,
),
),
migrations.RemoveField(
model_name="deltatdammtagpattern",
name="tag",
),
]
71 changes: 71 additions & 0 deletions sde_collections/migrations/0081_alter_deltatdammtagpattern_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Generated by Django 4.2.9 on 2025-03-10 23:56

import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0080_alter_deltatdammtagpattern_unique_together_and_more"),
]

operations = [
migrations.AlterField(
model_name="deltatdammtagpattern",
name="tags",
field=django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(
choices=[
("Not TDAMM", "Not TDAMM"),
("MMA_M_EM", "Messenger - EM Radiation"),
("MMA_M_EM_G", "Messenger - EM Radiation - Gamma rays"),
("MMA_M_EM_X", "Messenger - EM Radiation - X-rays"),
("MMA_M_EM_U", "Messenger - EM Radiation - Ultraviolet"),
("MMA_M_EM_O", "Messenger - EM Radiation - Optical"),
("MMA_M_EM_I", "Messenger - EM Radiation - Infrared"),
("MMA_M_EM_M", "Messenger - EM Radiation - Microwave"),
("MMA_M_EM_R", "Messenger - EM Radiation - Radio"),
("MMA_M_G", "Messenger - Gravitational Waves"),
("MMA_M_G_CBI", "Messenger - Gravitational Waves - Compact Binary Inspiral"),
("MMA_M_G_S", "Messenger - Gravitational Waves - Stochastic"),
("MMA_M_G_CON", "Messenger - Gravitational Waves - Continuous"),
("MMA_M_G_B", "Messenger - Gravitational Waves - Burst"),
("MMA_M_C", "Messenger - Cosmic Rays"),
("MMA_M_N", "Messenger - Neutrinos"),
("MMA_O_BI", "Objects - Binaries"),
("MMA_O_BI_BBH", "Objects - Binaries - Binary Black Holes"),
("MMA_O_BI_BNS", "Objects - Binaries - Binary Neutron Stars"),
("MMA_O_BI_C", "Objects - Binaries - Cataclysmic Variables"),
("MMA_O_BI_N", "Objects - Binaries - Neutron Star-Black Hole"),
("MMA_O_BI_B", "Objects - Binaries - Binary Pulsars"),
("MMA_O_BI_W", "Objects - Binaries - White Dwarf Binaries"),
("MMA_O_BH", "Objects - Black Holes"),
("MMA_O_BH_AGN", "Objects - Black Holes - Active Galactic Nuclei"),
("MMA_O_BH_IM", "Objects - Black Holes - Intermediate mass"),
("MMA_O_BH_STM", "Objects - Black Holes - Stellar mass"),
("MMA_O_BH_SUM", "Objects - Black Holes - Supermassive"),
("MMA_O_E", "Objects - Exoplanets"),
("MMA_O_N", "Objects - Neutron Stars"),
("MMA_O_N_M", "Objects - Neutron Stars - Magnetars"),
("MMA_O_N_P", "Objects - Neutron Stars - Pulsars"),
("MMA_O_N_PWN", "Objects - Neutron Stars - Pulsar Wind Nebula"),
("MMA_O_S", "Objects - Supernova Remnants"),
("MMA_S_F", "Signals - Fast Radio Bursts"),
("MMA_S_G", "Signals - Gamma-ray Bursts"),
("MMA_S_K", "Signals - Kilonovae"),
("MMA_S_N", "Signals - Novae"),
("MMA_S_P", "Signals - Pevatrons"),
("MMA_S_ST", "Signals - Stellar flares"),
("MMA_S_SU", "Signals - Supernovae"),
],
max_length=255,
),
blank=True,
default=list,
help_text="List of tags to add or remove",
null=True,
size=None,
),
),
]
13 changes: 13 additions & 0 deletions sde_collections/migrations/0082_merge_20250402_1127.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by Django 4.2.9 on 2025-04-02 16:27

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0077_alter_candidateurl_tdamm_tag_manual_and_more"),
("sde_collections", "0081_alter_deltatdammtagpattern_tags"),
]

operations = []
Loading
Loading