Completed
Push — master ( 8e01eb...25ec60 )
by Muhammad Dyas
17s queued 12s
created

ClosePollFormCard.buildHeader   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
1
import BaseCard from './BaseCard';
2
import {chat_v1 as chatV1} from 'googleapis/build/src/apis/chat/v1';
3
4
export default class ClosePollFormCard extends BaseCard {
5
  create(): chatV1.Schema$GoogleAppsCardV1Card {
6
    this.buildHeader();
7
    this.buildSections();
8
    this.buildFooter();
9
    return this.card;
10
  }
11
12
  buildHeader() {
13
    this.card.header = {
14
      'title': 'Are you sure to close the poll?',
15
      'subtitle': 'No one will have the ability to vote.',
16
      'imageUrl': '',
17
      'imageType': 'CIRCLE',
18
    };
19
  }
20
21
  buildSections() {
22
    this.card.sections = [];
23
  }
24
25
  buildFooter() {
26
    this.card.fixedFooter = {
27
      'primaryButton': {
28
        'text': 'Close Poll',
29
        'onClick': {
30
          'action': {
31
            'function': 'close_poll',
32
            'parameters': [],
33
          },
34
        },
35
      },
36
    };
37
  }
38
}
39