-
Notifications
You must be signed in to change notification settings - Fork 450
feat (engine, ui, cli): broadcast #2574
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
Conversation
|
I'll add it on it. |
cli/cdsctl/admin_infos.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no plural form of info:
https://www.linguee.com/english-french/translation/info.html
btw i don't think it's the right word, what's the goal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be broadcast in next commit
engine/api/info/gorp_model.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless blank line
engine/api/info/info.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad comment I think
engine/api/info/info.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need of fmt.Sprintf
engine/api/info/info.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless sprintf
sdk/info.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not on cli ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use .pipe(finalize(() => this.loading = false)) please and delete duplicate this.loading = false;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to sui-select
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use .pipe(finalize... instead please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.pipe(finalize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.pipe(finalize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to sui-select
b967077 to
2f6ede4
Compare
cli/cdsctl/admin_broadcasts.go
Outdated
| Args: []cli.Arg{ | ||
| {Name: "level"}, | ||
| {Name: "title"}, | ||
| {Name: "content"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could be nice to be able to user sdtin for the content
like cdsctl admin broadcast create info "Title" < changelog.md
cli/cdsctl/admin_broadcasts.go
Outdated
| Name: "create", | ||
| Short: "Create a CDS broadcast", | ||
| Args: []cli.Arg{ | ||
| {Name: "level"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think level should be a flag with info as default value
engine/api/broadcast.go
Outdated
| defer tx.Rollback() | ||
|
|
||
| // update broadcast in db | ||
| if err := broadcast.UpdateBroadcast(tx, bc); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should check the ID
engine/api/broadcast.go
Outdated
|
|
||
| func (api *API) getBroadcastsHandler() Handler { | ||
| return func(ctx context.Context, w http.ResponseWriter, r *http.Request) error { | ||
| if err := r.ParseForm(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it usefull ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no filter about level, date etc... ?
engine/api/broadcast/broadcast.go
Outdated
| } | ||
|
|
||
| // UpdateBroadcast update a broadcast | ||
| func UpdateBroadcast(db gorp.SqlExecutor, bc sdk.Broadcast) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for coherence with Insert, use a pointer
engine/api/broadcast/gorp_model.go
Outdated
| ) | ||
|
|
||
| // Broadcast is a gorp wrapper around sdk.Broadcast | ||
| type Broadcast sdk.Broadcast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this type should be private
engine/sql/090_broadcast.sql
Outdated
| -- +migrate Up | ||
| CREATE TABLE broadcast ( | ||
| id BIGSERIAL PRIMARY KEY, | ||
| title TEXT NOT NULL default '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VARCHAR 256
engine/sql/090_broadcast.sql
Outdated
| id BIGSERIAL PRIMARY KEY, | ||
| title TEXT NOT NULL default '', | ||
| content TEXT NOT NULL default '', | ||
| level TEXT NOT NULL default '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an enum, no need to have a TEXT field
sdk/broadcast.go
Outdated
| Title string `json:"title" db:"title" cli:"title"` | ||
| Content string `json:"content" db:"content" cli:"content"` | ||
| Level string `json:"level" db:"level" cli:"level"` | ||
| Created time.Time `json:"created" db:"created" cli:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it interesting in the CLI ?
|
|
||
| // BroadcastClient expose all function for CDS Broadcasts | ||
| type BroadcastClient interface { | ||
| Broadcasts() ([]sdk.Broadcast, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadcasts and BroadcastByLevel could be one function:
Broadcasts(filteredLevels ...string)
engine/api/broadcast/broadcast.go
Outdated
| func LoadBroadcastByID(db gorp.SqlExecutor, id int64) (*sdk.Broadcast, error) { | ||
| dbBroadcast := broadcast{} | ||
| query := `select * from broadcast where id=$1` | ||
| args := []interface{}{id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless
ui/src/assets/i18n/en.json
Outdated
| "broadcast_content": "Content", | ||
| "broadcast_archived": "Archived", | ||
| "broadcast_archived_help": "Check to archive this broadcast", | ||
| "broadcast_help_line_1": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it empty for two languages ?
ui/src/assets/i18n/fr.json
Outdated
| "broadcast_saved": "Information sauvegardée", | ||
| "broadcast_level": "Type", | ||
| "broadcast_none": "Aucune information", | ||
| "broadcast_load_broadcasts": "Loading broadcasts...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chargements des informations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something that clean old broadcasts should be nice
engine/api/broadcast/broadcast.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's not too late:
InsertBroadcast should be Insert because broadcast.InsertBroadcast is annoying. broadcast.Insert is better
engine/api/broadcast/broadcast.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update
engine/api/broadcast/broadcast.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoadByID
engine/api/broadcast/broadcast.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoadAll
engine/api/broadcast/broadcast.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete
|
clean old broadcasts: #2609 (to be discussed on how to clean) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why subscribing to route params ?
- move to constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be equal to add , because you said that /add = AddComponent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer absolute to directly see where i am going
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to [disabled] on the button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is it possible, there is a add-broadcast component above
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
Signed-off-by: Yvonnick Esnault <[email protected]>
| styleUrls: ['./broadcast.add.scss'] | ||
| }) | ||
| export class BroadcastAddComponent implements OnInit { | ||
| export class BroadcastAddComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AutoUnsubscribe
@ovh/cds
Signed-off-by: Yvonnick Esnault [email protected]