Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: announcements #47

Merged
merged 3 commits into from
Dec 16, 2024
Merged

feat: announcements #47

merged 3 commits into from
Dec 16, 2024

Conversation

alfetopito
Copy link
Contributor

Summary

Add Announcement model

image
image

Testing

Local testing via postman/curl, querying the entries with: http://localhost:1337/api/announcements?populate[networks][fields][0]=chainId&populate[environments][fields][0]=name&fields[0]=text&fields[1]=isCritical

Response:

{
    "data": [
        {
            "id": 1,
            "attributes": {
                "text": "Test _announcement_ announcement with an [internal link](#/swap/1/usdc)",
                "isCritical": false,
                "networks": {
                    "data": [
                        {
                            "id": 2,
                            "attributes": {
                                "chainId": 100
                            }
                        },
                        {
                            "id": 1,
                            "attributes": {
                                "chainId": 1
                            }
                        }
                    ]
                },
                "environments": {
                    "data": [
                        {
                            "id": 1,
                            "attributes": {
                                "name": "barn"
                            }
                        },
                        {
                            "id": 2,
                            "attributes": {
                                "name": "prod"
                            }
                        }
                    ]
                }
            }
        },
        {
            "id": 2,
            "attributes": {
                "text": "**Critical** announcement!!!",
                "isCritical": true,
                "networks": {
                    "data": [
                        {
                            "id": 2,
                            "attributes": {
                                "chainId": 100
                            }
                        },
                        {
                            "id": 1,
                            "attributes": {
                                "chainId": 1
                            }
                        }
                    ]
                },
                "environments": {
                    "data": [
                        {
                            "id": 1,
                            "attributes": {
                                "name": "barn"
                            }
                        },
                        {
                            "id": 2,
                            "attributes": {
                                "name": "prod"
                            }
                        }
                    ]
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "page": 1,
            "pageSize": 25,
            "pageCount": 1,
            "total": 2
        }
    }
}

@alfetopito alfetopito self-assigned this Dec 16, 2024
@alfetopito alfetopito requested a review from a team December 16, 2024 13:39
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/[email protected] None 0 11.9 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 69.2 kB nicolo-ribaudo
npm/@fastify/[email protected] None 0 80.2 kB gurgunday
npm/@hapi/[email protected] None 0 51.5 kB devinivy
npm/@hapi/[email protected] None 0 10.7 kB devinivy
npm/@isaacs/[email protected] None +6 171 kB isaacs
npm/@jridgewell/[email protected] None +1 125 kB jridgewell
npm/@jridgewell/[email protected] None 0 55.2 kB jridgewell
npm/@jridgewell/[email protected] None 0 15.5 kB jridgewell
npm/@jridgewell/[email protected] None 0 232 kB jridgewell
npm/@leichtgewicht/[email protected] None 0 17.7 kB leichtgewicht
npm/@monaco-editor/[email protected] None 0 85.9 kB surenat
npm/@monaco-editor/[email protected] None 0 1.06 MB surenat
npm/@nodelib/[email protected] filesystem 0 22.2 kB mrmlnc
npm/@nodelib/[email protected] filesystem 0 11.8 kB mrmlnc
npm/@nodelib/[email protected] None 0 26.4 kB mrmlnc
npm/@pkgjs/[email protected] None 0 74.2 kB oss-bot
npm/@sideway/[email protected] None 0 55.9 kB marsup
npm/@sideway/[email protected] None 0 16.9 kB marsup
npm/@sideway/[email protected] None 0 3.64 kB hueniverse
npm/@types/[email protected] None 0 6.21 kB types
npm/@types/[email protected] None 0 9.55 kB types
npm/@types/[email protected] None 0 6.12 kB types
npm/@types/[email protected] None 0 12.5 kB types
npm/@types/[email protected] None 0 5.05 kB types
npm/@types/[email protected] None +1 14.2 kB types
npm/@webassemblyjs/[email protected] None 0 5.14 kB xtuc
npm/@xtuc/[email protected] None 0 8.57 kB xtuc
npm/@xtuc/[email protected] None 0 190 kB xtuc
npm/@yarnpkg/[email protected] environment, eval, filesystem 0 280 kB arcanis
npm/[email protected] None 0 11.7 kB andris
npm/[email protected] environment 0 26.1 kB jonschlinkert
npm/[email protected] None 0 7.9 kB jonschlinkert
npm/[email protected] None 0 6.88 kB jonschlinkert
npm/[email protected] None 0 6.66 kB jonschlinkert
npm/[email protected] None 0 6.17 kB jonschlinkert
npm/[email protected] None 0 6.26 kB jonschlinkert
npm/[email protected] None 0 7.16 kB jonschlinkert
npm/[email protected] None 0 5.85 kB phated
npm/[email protected] None 0 2.63 kB ryanzim
npm/[email protected] None 0 36.2 kB coolaj86
npm/[email protected] None 0 32.7 kB jonschlinkert
npm/[email protected] filesystem 0 9.62 MB joshuawise
npm/[email protected] environment, filesystem 0 11.2 kB tootallnate
npm/[email protected] environment, eval, unsafe 0 632 kB esailija
npm/[email protected] None 0 5.05 kB linusu
npm/[email protected] None 0 13.7 kB brianc
npm/[email protected] filesystem, network 0 108 kB andris
npm/[email protected] None 0 16.4 kB jonschlinkert
npm/[email protected] None 0 19 kB jonschlinkert
npm/[email protected] None +1 8.11 kB sindresorhus
npm/[email protected] None 0 11.1 kB pvorb
npm/[email protected] None 0 6.85 kB jonschlinkert
npm/[email protected] None 0 8 kB nami-doc
npm/[email protected] None 0 4.15 kB jonschlinkert
npm/[email protected] None 0 17.5 kB mathias
npm/[email protected] filesystem, shell 0 8.69 MB keyang
npm/[email protected] None 0 6.09 kB samverschueren
npm/[email protected] None 0 9.19 kB unclechu
npm/[email protected] None 0 5.44 kB szmarczak
npm/[email protected] None 0 30.9 kB ljharb
npm/[email protected] None 0 12.5 kB ljharb
npm/[email protected] None 0 10.7 kB doowb
npm/[email protected] filesystem 0 8.63 kB doowb
npm/[email protected] None 0 61 kB silverwind
npm/[email protected] None 0 7.9 kB ariaminaei
npm/[email protected] None 0 13.6 kB komagata
npm/[email protected] None 0 11.8 kB ljharb
npm/[email protected] None 0 12.3 kB ljharb
npm/[email protected] None 0 38 kB lpinca
npm/[email protected] None 0 26 kB jonschlinkert
npm/[email protected] None +1 47.9 kB jonschlinkert
npm/[email protected] None 0 17 kB esp
npm/[email protected] None 0 38.9 kB matteo.collina
npm/[email protected] None 0 8.07 kB tootallnate
npm/[email protected] filesystem 0 16.7 kB bmishkin
npm/[email protected] None 0 6.28 kB jonschlinkert
npm/[email protected] None 0 6.47 kB jonschlinkert
npm/[email protected] shell +1 137 kB isaacs
npm/[email protected] None 0 5.88 kB dougwilson
npm/[email protected] None +1 17.5 kB jonschlinkert
npm/[email protected] None 0 3.71 kB jonschlinkert
npm/[email protected] None +1 14.5 kB jonschlinkert
npm/[email protected] environment, filesystem +1 18 kB phated
npm/[email protected] None 0 7.7 kB ljharb
npm/[email protected] None 0 9.31 kB ljharb
npm/[email protected] None 0 7.62 kB jonschlinkert
npm/[email protected] None +1 21.4 kB jonschlinkert
npm/[email protected] None 0 8.77 kB ljharb
npm/[email protected] environment, filesystem 0 8.05 kB doowb
npm/[email protected] Transitive: environment +3 215 kB indutny
npm/[email protected] None 0 35.9 kB kornel
npm/[email protected] None 0 25.8 kB jimbly
npm/[email protected] None 0 9.3 kB isaacs
npm/[email protected] None 0 8.55 kB jonschlinkert
npm/[email protected] None 0 9.37 kB jonschlinkert
npm/[email protected] None 0 5.58 kB feross
npm/[email protected] None 0 8.82 kB jonschlinkert
npm/[email protected] None 0 9.01 kB jonschlinkert
npm/[email protected] None 0 6.94 kB doowb
npm/[email protected] None 0 9.62 kB jonschlinkert
npm/[email protected] None 0 6.59 kB jonschlinkert
npm/[email protected] None 0 6.51 kB jonschlinkert
npm/[email protected] None 0 4.34 kB wayfind
npm/[email protected] None 0 6.82 kB juliangruber
npm/[email protected] environment 0 253 kB isaacs
npm/[email protected] None 0 519 kB hueniverse
npm/[email protected] None 0 405 kB vitaly
npm/[email protected] None 0 32 kB mathias
npm/[email protected] None 0 5.4 kB dominictarr
npm/[email protected] None 0 19.6 kB esp
npm/[email protected] Transitive: eval +4 126 kB ljharb
npm/[email protected] None 0 19.4 kB ljharb
npm/[email protected] None 0 27.8 kB jaredwray
npm/[email protected] None 0 22.8 kB doowb
npm/[email protected] None 0 10.4 kB manidlou
npm/[email protected] None 0 8.78 kB andris
npm/[email protected] None +1 471 kB andris
npm/[email protected] None 0 12.9 kB andris
npm/[email protected] None 0 8.7 kB jonschlinkert
npm/[email protected] None 0 8.47 kB jonschlinkert
npm/[email protected] environment, filesystem 0 51.7 kB broofa
npm/[email protected] None 0 6 kB sindresorhus
npm/[email protected] None 0 7.22 kB doowb
npm/[email protected] filesystem 0 23.8 kB alexandrudima
npm/[email protected] environment 0 77.3 MB alexandrudima
npm/[email protected] None 0 86.3 kB jonschlinkert
npm/[email protected] network 0 50.5 kB andris
npm/[email protected] filesystem, network 0 22.6 kB andris
npm/[email protected] None 0 21.2 kB sindresorhus
npm/[email protected] None 0 5.47 kB jonschlinkert
npm/[email protected] None 0 26.5 kB ljharb
npm/[email protected] None 0 6.7 kB jonschlinkert
npm/[email protected] None 0 6.53 kB phated
npm/[email protected] network 0 107 kB drewpowers
npm/[email protected] None 0 17.5 kB drewpowers
npm/[email protected] Transitive: environment, filesystem +3 655 kB drewpowers
npm/[email protected] None 0 7.75 kB sindresorhus
npm/[email protected] None 0 7.24 kB sindresorhus
npm/[email protected] None 0 4.37 kB sindresorhus
npm/[email protected] None 0 10 kB brianc
npm/[email protected] None 0 7.92 kB phated
npm/[email protected] None 0 5.96 kB doowb
npm/[email protected] None 0 4.46 kB jonschlinkert
npm/[email protected] environment, filesystem Transitive: shell +2 582 kB ds300

🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

"networks": {
"type": "relation",
"relation": "oneToMany",
"target": "api::network.network"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should be required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if not specified then it will be displayed in any network?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! (actually I forgot to mark required 🙈, but I liked the idea)

Will update the notion page with instructions once it's ready.

@alfetopito alfetopito merged commit 4bc424e into main Dec 16, 2024
3 checks passed
@alfetopito alfetopito deleted the feat/announcements branch December 16, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants