Merge lp:~stephen-stewart/snapweb/hide-installer-for-oem into lp:~snappy-dev/snapweb/trunk

Proposed by Stephen Stewart on 2015-05-07
Status: Merged
Approved by: Sergio Schvezov on 2015-05-07
Approved revision: 131
Merged at revision: 132
Proposed branch: lp:~stephen-stewart/snapweb/hide-installer-for-oem
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 109 lines (+22/-1)
5 files modified
www/src/css/snaplist.css (+5/-0)
www/src/js/config.js (+3/-0)
www/src/js/models/snap.js (+10/-1)
www/src/js/templates/snap-layout.hbs (+2/-0)
www/src/js/templates/snaplist-item.hbs (+2/-0)
To merge this branch: bzr merge lp:~stephen-stewart/snapweb/hide-installer-for-oem
Reviewer Review Type Date Requested Status
Sergio Schvezov 2015-05-07 Approve on 2015-05-07
Review via email: mp+258553@code.launchpad.net

Commit Message

hide install buttons on oem snaps

To post a comment you must log in.
Sergio Schvezov (sergiusens) wrote :

\o/
full of awesome

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'www/src/css/snaplist.css'
2--- www/src/css/snaplist.css 2015-05-06 18:57:26 +0000
3+++ www/src/css/snaplist.css 2015-05-07 20:01:28 +0000
4@@ -63,6 +63,7 @@
5 }
6
7 .b-snaplist--row .b-snaplist__name,
8+.b-snaplist--row .b-snaplist__version,
9 .b-snaplist--row .b-snaplist__type,
10 .b-snaplist--row .b-snaplist__origin {
11 flex:1 1;
12@@ -81,6 +82,10 @@
13 text-align:center;
14 }
15
16+.b-snaplist--row .b-snaplist__actions {
17+ flex: 1;
18+}
19+
20 .b-snaplist--row .b-installer__message {
21 /** XXX hmm **/
22 display:none;
23
24=== modified file 'www/src/js/config.js'
25--- www/src/js/config.js 2015-04-30 10:07:40 +0000
26+++ www/src/js/config.js 2015-05-07 20:01:28 +0000
27@@ -5,6 +5,9 @@
28 'webdm',
29 'ubuntu-core'
30 ],
31+ NON_INSTALLABLE_TYPES: [
32+ 'oem'
33+ ],
34 INSTALL_STATE: {
35 INSTALLED: 'installed',
36 INSTALLING: 'installing',
37
38=== modified file 'www/src/js/models/snap.js'
39--- www/src/js/models/snap.js 2015-05-07 17:18:56 +0000
40+++ www/src/js/models/snap.js 2015-05-07 20:01:28 +0000
41@@ -120,6 +120,8 @@
42
43 parse: function(response) {
44
45+ var type = response.type;
46+
47 if (response.hasOwnProperty('icon') && !response.icon.length) {
48 response.icon = this.defaults.icon;
49 }
50@@ -128,13 +130,20 @@
51 response.origin = this.defaults.origin;
52 }
53
54+ if (type) {
55+ if (_.contains(CONF.NON_INSTALLABLE_TYPES, type)) {
56+ response.isInstallable = false;
57+ }
58+ }
59+
60 return response;
61 },
62
63 defaults: {
64 icon: '/public/images/default-package-icon.svg',
65 installActionString: false,
66- origin: '-'
67+ origin: '-',
68+ isInstallable: true
69 }
70
71 });
72
73=== modified file 'www/src/js/templates/snap-layout.hbs'
74--- www/src/js/templates/snap-layout.hbs 2015-05-06 18:57:26 +0000
75+++ www/src/js/templates/snap-layout.hbs 2015-05-07 20:01:28 +0000
76@@ -7,6 +7,7 @@
77 </p>
78 </div>
79 <div class="b-snap__actions">
80+ {{#if isInstallable}}
81 <div class="b-installer {{ installHTMLClass }}">
82 {{#if installActionString}}
83 <div class="b-installer__button">{{ installActionString }}</div>
84@@ -16,6 +17,7 @@
85 {{/if}}
86 <div class="b-installer__message"></div>
87 </div>
88+ {{/if}}
89 </div>
90 </div>
91 <div class="region-menu"></div>
92
93=== modified file 'www/src/js/templates/snaplist-item.hbs'
94--- www/src/js/templates/snaplist-item.hbs 2015-05-07 14:37:47 +0000
95+++ www/src/js/templates/snaplist-item.hbs 2015-05-07 20:01:28 +0000
96@@ -7,6 +7,7 @@
97 <div class="b-snaplist__origin">{{ origin }}</div>
98 <div class="b-snaplist__type">{{ type }}</div>
99 <div class="b-snaplist__actions">
100+ {{#if isInstallable}}
101 <div class="b-installer b-installer__small {{ installHTMLClass }}">
102 {{#if installActionString}}
103 <div class="b-installer__button">{{ installActionString }}</div>
104@@ -16,4 +17,5 @@
105 {{/if}}
106 <div class="b-installer__message"></div>
107 </div>
108+ {{/if}}
109 </div>

Subscribers

People subscribed via source and target branches