Completed
Pull Request — master (#391)
by Jonas
03:12
created

Progressꞌ).initComponent   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
1
//{namespace name=backend/connect/view/main}
2
3
//{block name="backend/connect/view/main/progress"}
4
Ext.define('Shopware.apps.Connect.view.main.Progress', {
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
5
6
    extend:'Enlight.app.Window',
7
    cls: Ext.baseCSSPrefix + 'connect',
8
9
    alias: 'widget.connect-main-migration-progress-window',
10
    border: false,
11
    autoShow: true,
12
    layout: 'anchor',
13
    width: 420,
14
    height: 80,
15
    maximizable: false,
16
    minimizable: false,
17
    closable: false,
18
    footerButton: true,
19
    stateful: true,
20
    modal: true,
21
    inProcess: false,
22
23
    /**
24
     * Contains all snippets for the component
25
     * @object
26
     */
27
    snippets: {
28
        title: 'Migration',
29
        process: '{s name=connect/import/dataMigrations/progress/process}[0] of [1] imported product(s) migrated...{/s}',
30
    },
31
32
    bodyPadding: 10,
33
34
    initComponent:function () {
35
        var me = this;
36
37
        me.items = me.createItems();
38
        me.title = me.snippets.title;
39
        me.callParent(arguments);
40
    },
41
42
    /**
43
     * Creates the items for the progress window.
44
     */
45
    createItems: function() {
46
        var me = this;
47
48
        me.progressField = Ext.create('Ext.ProgressBar', {
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
49
            name: 'CategoryRecreationBar',
50
            text: Ext.String.format(me.snippets.process, 0, 0),
51
            margin: '0 0 15',
52
            border: 1,
53
            style: 'border-width: 1px !important;',
54
            cls: 'left-align',
55
            value: 0
56
        });
57
58
        return [ me.progressField ];
59
    },
60
61
    closeWindow: function() {
62
        var me = this;
63
64
        if (me.progressField.getActiveAnimation()) {
65
            Ext.defer(me.closeWindow, 200, me);
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
66
            return;
67
        }
68
69
        // Wait a little before destroy the window for a better use feeling
70
        Ext.defer(me.destroy, 500, me);
71
    }
72
});
73
//{/block}
74