Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 81526ca

Browse files
committed
refine the badges UI, avoiding the use of small-caps
Fixes #803
1 parent 605b5be commit 81526ca

File tree

9 files changed

+36
-24
lines changed

9 files changed

+36
-24
lines changed

app/content/css/ui.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ body/*:not(.sidecar-full-screen)*/ repl.sidecar-visible .repl-context, body/*:no
456456
}
457457
.repl-result-prefix, badge {
458458
font-weight: 400;
459-
font-variant: small-caps;
460459
transition: all 150ms ease-in-out;
461460
font-size: 0.75rem;
462461
border-radius: 0.9375rem;
@@ -732,7 +731,6 @@ sidecar .sidecar-header .badges {
732731
margin-left: 1rem;
733732
display: flex;
734733
flex-wrap: wrap;
735-
flex-direction: column;
736734
align-items: flex-end;
737735
}
738736
sidecar .sidecar-header badge {

app/plugins/modules/composer/lib/badges.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
module.exports = {
18-
app: 'app',
19-
fsm: 'fsm',
20-
composerLib: 'compiled with composer',
21-
sequence: 'sequence'
18+
app: 'App',
19+
fsm: 'FSM',
20+
composerLib: 'Composer',
21+
sequence: 'Sequence'
2222
}

tests/tests/passes/07/composer-delete.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const common = require('../../../lib/common'),
2121
keys = ui.keys,
2222
cli = ui.cli,
2323
sidecar = ui.sidecar,
24+
path = require('path'),
2425
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
26+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2527
actionName1 = 'foo1',
2628
actionName2 = 'foo2',
2729
seqName1 = 'seq1'
@@ -67,23 +69,23 @@ describe('Use the app delete command to delete an invokeable composition', funct
6769
.then(cli.expectOK)
6870
.then(sidecar.expectOpen)
6971
.then(sidecar.expectShowing(seqName1))
70-
.then(sidecar.expectBadge('sequence'))
72+
.then(sidecar.expectBadge(badges.sequence))
7173
.catch(common.oops(this)))
7274
invoke(seqName1, 'x', 3)
7375

7476
it('should get ${seqName1} via app get', () => cli.do(`app get ${seqName1}`, this.app)
7577
.then(cli.expectOK)
7678
.then(sidecar.expectOpen)
7779
.then(sidecar.expectShowing(seqName1)) // and sidecar should be showing it, too
78-
.then(sidecar.expectBadge('sequence'))
80+
.then(sidecar.expectBadge(badges.sequence))
7981
.catch(common.oops(this)))
8082

8183
// show up in the list prior to deletion
8284
it('should list ${seqName1} via app ls', () => cli.do(`app ls`, this.app)
8385
.then(cli.expectOKWithOnly(seqName1)) // seqName1 had better still be in the list
8486
.then(sidecar.expectOpen)
8587
.then(sidecar.expectShowing(seqName1)) // and sidecar should be showing it, too
86-
.then(sidecar.expectBadge('sequence'))
88+
.then(sidecar.expectBadge(badges.sequence))
8789
.catch(common.oops(this)))
8890

8991
it('should delete a composer sequence', () => cli.do(`app delete ${seqName1}`, this.app)

tests/tests/passes/07/composer-kill.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const common = require('../../../lib/common'),
2424
actionName1 = 'foo1',
2525
actionName2 = 'foo2',
2626
seqName1 = 'seq1',
27+
path = require('path'),
2728
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
29+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2830
killFailure404 = 'Cannot find live session',
2931
purgeFailure404 = 'Cannot find session',
3032
genericFailureMessage = 'The requested session no longer, or has never, existed'
@@ -171,7 +173,7 @@ describe('killing and purging composer invocations', function() {
171173
.then(cli.expectOK)
172174
.then(sidecar.expectOpen)
173175
.then(sidecar.expectShowing(seqName1))
174-
.then(sidecar.expectBadge('sequence'))
176+
.then(sidecar.expectBadge(badges.sequence))
175177
.catch(common.oops(this)))
176178
177179
asyncThenAppInitCleanse(seqName1, 'x', 3, { aa: 11 })

tests/tests/passes/07/composer-list.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const common = require('../../../lib/common'),
2121
keys = ui.keys,
2222
cli = ui.cli,
2323
sidecar = ui.sidecar,
24+
path = require('path'),
2425
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
26+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2527
actionName1 = 'foo1',
2628
actionName2 = 'foo2',
2729
seqName1 = 'seq1',
@@ -45,54 +47,54 @@ describe('Use the app list command to list the invokeable compositions', functio
4547
.then(cli.expectOK)
4648
.then(sidecar.expectOpen)
4749
.then(sidecar.expectShowing(seqName1))
48-
.then(sidecar.expectBadge('fsm'))
50+
.then(sidecar.expectBadge(badges.fsm))
4951
.catch(common.oops(this)))
5052

5153
// list it
5254
it(`should list ${seqName1} via app ls`, () => cli.do(`app ls`, this.app)
5355
.then(cli.expectOKWithOnly(seqName1))
5456
.then(sidecar.expectOpen)
5557
.then(sidecar.expectShowing(seqName1))
56-
.then(sidecar.expectBadge('fsm'))
58+
.then(sidecar.expectBadge(badges.fsm))
5759
.catch(common.oops(this)))
5860

5961
// make a second app
6062
it('should create a second composer sequence', () => cli.do(`app create ${seqName2} ./data/fsm.json`, this.app)
6163
.then(cli.expectOK)
6264
.then(sidecar.expectOpen)
6365
.then(sidecar.expectShowing(seqName2))
64-
.then(sidecar.expectBadge('fsm'))
66+
.then(sidecar.expectBadge(badges.fsm))
6567
.catch(common.oops(this)))
6668

6769
// list it
6870
it(`should list ${seqName1} via app list`, () => cli.do(`app list`, this.app)
6971
.then(cli.expectOKWith(seqName1)) // seqName1 had better still be in the list
7072
.then(sidecar.expectOpen)
7173
.then(sidecar.expectShowing(seqName2)) // but the sidecar should be showing seqName2
72-
.then(sidecar.expectBadge('fsm'))
74+
.then(sidecar.expectBadge(badges.fsm))
7375
.catch(common.oops(this)))
7476

7577
it(`should list ${seqName1} via wsk app list`, () => cli.do(`wsk app list`, this.app)
7678
.then(cli.expectOKWith(seqName2)) // seqName2 had better also be in the list
7779
.then(sidecar.expectOpen)
7880
.then(sidecar.expectShowing(seqName2))
79-
.then(sidecar.expectBadge('fsm'))
81+
.then(sidecar.expectBadge(badges.fsm))
8082
.catch(common.oops(this)))
8183

8284
// make a packaged app
8385
it('should create a second composer sequence', () => cli.do(`app create ppp/${seqName2} ./data/fsm.json`, this.app)
8486
.then(cli.expectOK)
8587
.then(sidecar.expectOpen)
8688
.then(sidecar.expectShowing(seqName2, undefined, undefined, 'ppp'))
87-
.then(sidecar.expectBadge('fsm'))
89+
.then(sidecar.expectBadge(badges.fsm))
8890
.catch(common.oops(this)))
8991

9092
// get the first app, so that the sidecar shows it (so we can test switching back to the packaged app)
9193
it(`should get ${seqName1}`, () => cli.do(`app get ${seqName1}`, this.app)
9294
.then(cli.expectOK)
9395
.then(sidecar.expectOpen)
9496
.then(sidecar.expectShowing(seqName1))
95-
.then(sidecar.expectBadge('fsm'))
97+
.then(sidecar.expectBadge(badges.fsm))
9698
.catch(common.oops(this)))
9799

98100
it(`should list ppp/${seqName2} via wsk app list`, () => cli.do(`app ls`, this.app)

tests/tests/passes/07/composer-result.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const common = require('../../../lib/common'),
2121
keys = ui.keys,
2222
cli = ui.cli,
2323
sidecar = ui.sidecar,
24+
path = require('path'),
2425
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
26+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2527
actionName1 = 'foo1',
2628
actionName2 = 'foo2',
2729
seqName1 = 'seq1'
@@ -79,7 +81,7 @@ describe('kill composer invocation', function() {
7981
.then(cli.expectOK)
8082
.then(sidecar.expectOpen)
8183
.then(sidecar.expectShowing(seqName1))
82-
.then(sidecar.expectBadge('sequence'))
84+
.then(sidecar.expectBadge(badges.sequence))
8385
.catch(common.oops(this)))
8486

8587
invokeThenResult(seqName1, 'x', 3) // async, then use `app result` to fetch the rsult

tests/tests/passes/07/composer-sequence.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const common = require('../../../lib/common'),
2121
keys = ui.keys,
2222
cli = ui.cli,
2323
sidecar = ui.sidecar,
24+
path = require('path'),
2425
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
26+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2527
actionName1 = 'foo1',
2628
actionName2 = 'foo2',
2729
actionName3 = 'foo3',
@@ -94,7 +96,7 @@ describe('Create a composer sequence', function() {
9496
.then(cli.expectOK)
9597
.then(sidecar.expectOpen)
9698
.then(sidecar.expectShowing(seqName1))
97-
.then(sidecar.expectBadge('sequence'))
99+
.then(sidecar.expectBadge(badges.sequence))
98100
.catch(common.oops(this)))
99101
checkAnnotation(seqName1, { m: 4 })
100102
invoke(seqName1, 'n', 3)
@@ -104,7 +106,7 @@ describe('Create a composer sequence', function() {
104106
.then(cli.expectOK)
105107
.then(sidecar.expectOpen)
106108
.then(sidecar.expectShowing(seqName2))
107-
.then(sidecar.expectBadge('sequence'))
109+
.then(sidecar.expectBadge(badges.sequence))
108110
.catch(common.oops(this)))
109111
checkAnnotation(seqName2, { mm: 44 })
110112
invoke(seqName2, 'nn', 33)
@@ -116,7 +118,7 @@ describe('Create a composer sequence', function() {
116118
.then(cli.expectOK)
117119
.then(sidecar.expectOpen)
118120
.then(sidecar.expectShowing(seqName3))
119-
.then(sidecar.expectBadge('sequence'))
121+
.then(sidecar.expectBadge(badges.sequence))
120122
.catch(common.oops(this)))
121123
checkAnnotation(seqName3, { mmm: 444 })
122124
invoke(seqName3, 'nnn', 333, {aa:11, bb:22})
@@ -127,7 +129,7 @@ describe('Create a composer sequence', function() {
127129
.then(cli.expectOK)
128130
.then(sidecar.expectOpen)
129131
.then(sidecar.expectShowing(seqName4))
130-
.then(sidecar.expectBadge('sequence'))
132+
.then(sidecar.expectBadge(badges.sequence))
131133
.catch(common.oops(this)))
132134
checkAnnotation(seqName4, { mmmm: 4444 })
133135
invoke(seqName4, 'nnnn', 3333, {aa:11, bb:22, cc:33})

tests/tests/passes/07/composer-try.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const common = require('../../../lib/common'),
2121
keys = ui.keys,
2222
cli = ui.cli,
2323
sidecar = ui.sidecar,
24+
path = require('path'),
2425
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
26+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2527
actionName1 = 'foo1',
2628
actionName2 = 'foo2',
2729
actionName3 = 'foo3',
@@ -110,7 +112,7 @@ describe('Create a composer try-catch', function() {
110112
.then(cli.expectOK)
111113
.then(sidecar.expectOpen)
112114
.then(sidecar.expectShowing(seqName1))
113-
.then(sidecar.expectBadge('sequence'))
115+
.then(sidecar.expectBadge(badges.sequence))
114116
.catch(common.oops(this)))
115117
invoke(seqName1, 'x', 3, { aa: 11 })
116118

tests/tests/passes/07/composer-while.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const common = require('../../../lib/common'),
2121
keys = ui.keys,
2222
cli = ui.cli,
2323
sidecar = ui.sidecar,
24+
path = require('path'),
2425
//sharedURL = process.env.REDIS_URL || 'redis://127.0.0.1:6379',
26+
badges = require(path.join(__dirname, '../../../../app/plugins/modules/composer/lib/badges.js')),
2527
condition1 = 'cond1',
2628
condition2 = 'cond2',
2729
condition3 = 'cond3',
@@ -131,7 +133,7 @@ describe('Create a composer while', function() {
131133
.then(cli.expectOK)
132134
.then(sidecar.expectOpen)
133135
.then(sidecar.expectShowing(seqName1))
134-
.then(sidecar.expectBadge('sequence'))
136+
.then(sidecar.expectBadge(badges.sequence))
135137
.catch(common.oops(this)))
136138
invoke(seqName1, 'x', 3, { $i: 1 }, true) // true means we expect just $i:1 back
137139

0 commit comments

Comments
 (0)