Skip to content

Conversation

@yesnault
Copy link
Member

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds

Signed-off-by: Yvonnick Esnault [email protected]

@yesnault yesnault requested review from bnjjj, fsamin and sguiheux April 16, 2018 09:15
@yesnault
Copy link
Member Author

I'll add it on it.

Copy link
Member

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 ?

Copy link
Member Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

useless blank line

Copy link
Contributor

Choose a reason for hiding this comment

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

bad comment I think

Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

why not on cli ?

Copy link
Contributor

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;

Copy link
Contributor

Choose a reason for hiding this comment

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

switch to sui-select

Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

.pipe(finalize

Copy link
Contributor

Choose a reason for hiding this comment

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

.pipe(finalize

Copy link
Contributor

Choose a reason for hiding this comment

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

switch to sui-select

@yesnault yesnault changed the title feat (engine, ui, cli): info feat (engine, ui, cli): broadcast Apr 21, 2018
Args: []cli.Arg{
{Name: "level"},
{Name: "title"},
{Name: "content"},
Copy link
Member

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

Name: "create",
Short: "Create a CDS broadcast",
Args: []cli.Arg{
{Name: "level"},
Copy link
Member

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

defer tx.Rollback()

// update broadcast in db
if err := broadcast.UpdateBroadcast(tx, bc); err != nil {
Copy link
Member

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


func (api *API) getBroadcastsHandler() Handler {
return func(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
if err := r.ParseForm(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

is it usefull ?

Copy link
Member

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... ?

}

// UpdateBroadcast update a broadcast
func UpdateBroadcast(db gorp.SqlExecutor, bc sdk.Broadcast) error {
Copy link
Member

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

)

// Broadcast is a gorp wrapper around sdk.Broadcast
type Broadcast sdk.Broadcast
Copy link
Member

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

-- +migrate Up
CREATE TABLE broadcast (
id BIGSERIAL PRIMARY KEY,
title TEXT NOT NULL default '',
Copy link
Member

Choose a reason for hiding this comment

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

VARCHAR 256

id BIGSERIAL PRIMARY KEY,
title TEXT NOT NULL default '',
content TEXT NOT NULL default '',
level TEXT NOT NULL default '',
Copy link
Member

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:"-"`
Copy link
Member

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)
Copy link
Member

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)

@yesnault yesnault removed the ready label Apr 23, 2018
func LoadBroadcastByID(db gorp.SqlExecutor, id int64) (*sdk.Broadcast, error) {
dbBroadcast := broadcast{}
query := `select * from broadcast where id=$1`
args := []interface{}{id}
Copy link
Contributor

Choose a reason for hiding this comment

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

useless

"broadcast_content": "Content",
"broadcast_archived": "Archived",
"broadcast_archived_help": "Check to archive this broadcast",
"broadcast_help_line_1": "",
Copy link
Contributor

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 ?

"broadcast_saved": "Information sauvegardée",
"broadcast_level": "Type",
"broadcast_none": "Aucune information",
"broadcast_load_broadcasts": "Loading broadcasts...",
Copy link
Contributor

Choose a reason for hiding this comment

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

Chargements des informations

@yesnault yesnault added the ready label Apr 24, 2018
fsamin
fsamin previously requested changes Apr 25, 2018
Copy link
Member

@fsamin fsamin left a 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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

Update

Copy link
Member

Choose a reason for hiding this comment

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

LoadByID

Copy link
Member

Choose a reason for hiding this comment

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

LoadAll

Copy link
Member

Choose a reason for hiding this comment

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

Delete

@yesnault
Copy link
Member Author

clean old broadcasts: #2609 (to be discussed on how to clean)

Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

move to constructor?

Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Collaborator

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

@yesnault yesnault added ready and removed ready labels May 1, 2018
@yesnault
Copy link
Member Author

yesnault commented May 1, 2018

@sguiheux / @bnjjj check sql file number before merging (it's 90 in this PR)

yesnault added 6 commits May 7, 2018 13:53
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]>
yesnault added 9 commits May 7, 2018 13:53
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]>
yesnault added 2 commits May 7, 2018 14:04
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 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

AutoUnsubscribe

@yesnault yesnault merged commit 1e15368 into master May 7, 2018
@yesnault yesnault deleted the ye-global-info branch May 10, 2018 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants