Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 39 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 |