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

refactor(ui): get notification data (types, default values) from API #3534

Closed
fsamin opened this issue Oct 31, 2018 · 0 comments · Fixed by #3546
Closed

refactor(ui): get notification data (types, default values) from API #3534

fsamin opened this issue Oct 31, 2018 · 0 comments · Fixed by #3546
Labels

Comments

@fsamin
Copy link
Member

fsamin commented Oct 31, 2018

WorkflowNotificationFormComponent
relies on

export const notificationTypes = ['jabber', 'email'];
export const notificationOnSuccess = ['always', 'change', 'never'];
export const notificationOnFailure = ['always', 'change', 'never'];

API provides those data from /notification/type and /notification/state

also i would like to handle this:

export class UserNotificationTemplate {
    subject: string;
    body: string;

    constructor() {
        this.subject = '{{.cds.project}}/{{.cds.application}} {{.cds.pipeline}} {{.cds.environment}}#{{.cds.version}} {{.cds.status}}';
        this.body = 'Project : {{.cds.project}}\n' +
                'Application : {{.cds.application}}\n' +
                'Pipeline : {{.cds.pipeline}}/{{.cds.environment}}#{{.cds.version}}\n' +
                'Status : {{.cds.status}}\n' +
                'Details : {{.cds.buildURL}}\n' +
                'Triggered by : {{.cds.triggered_by.username}}\n' +
                'Branch : {{.git.branch}}';
    }
}

on API Side, returned by /notification/type

The goal are:

  • to know on API side if notification in the as-code format the the default ones or not
  • having different default values for notification type

related to #3519

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 a pull request may close this issue.

1 participant