@featurevisor/site 1.5.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "links": {
3
- "attribute": "https://github.com/fahad19/featurevisor/blob/site-variable-show/examples/example-1/attributes/{{key}}.yml",
4
- "segment": "https://github.com/fahad19/featurevisor/blob/site-variable-show/examples/example-1/segments/{{key}}.yml",
5
- "feature": "https://github.com/fahad19/featurevisor/blob/site-variable-show/examples/example-1/features/{{key}}.yml",
6
- "commit": "https://github.com/fahad19/featurevisor/commit/{{hash}}"
3
+ "attribute": "https://github.com/featurevisor/featurevisor/blob/main/examples/example-1/attributes/{{key}}.yml",
4
+ "segment": "https://github.com/featurevisor/featurevisor/blob/main/examples/example-1/segments/{{key}}.yml",
5
+ "feature": "https://github.com/featurevisor/featurevisor/blob/main/examples/example-1/features/{{key}}.yml",
6
+ "commit": "https://github.com/featurevisor/featurevisor/commit/{{hash}}"
7
7
  },
8
8
  "entities": {
9
9
  "attributes": [
@@ -70,7 +70,7 @@
70
70
  "timestamp": "2023-03-05T18:38:34+01:00",
71
71
  "author": "Fahad Heylaal"
72
72
  },
73
- "usedInFeatures": ["foo", "showPopup"],
73
+ "usedInFeatures": ["foo", "showBanner", "showPopup"],
74
74
  "usedInSegments": ["qa"]
75
75
  },
76
76
  {
@@ -151,7 +151,7 @@
151
151
  "timestamp": "2023-11-21T17:50:37+01:00",
152
152
  "author": "Fahad Heylaal"
153
153
  },
154
- "usedInFeatures": ["showPopup"]
154
+ "usedInFeatures": ["showBanner", "showPopup"]
155
155
  },
156
156
  {
157
157
  "archived": false,
@@ -407,8 +407,8 @@
407
407
  },
408
408
  "key": "foo",
409
409
  "lastModified": {
410
- "commit": "986fc2f",
411
- "timestamp": "2024-01-04T19:17:05+01:00",
410
+ "commit": "9daf95b",
411
+ "timestamp": "2024-01-11T20:17:34+01:00",
412
412
  "author": "Fahad Heylaal"
413
413
  }
414
414
  },
@@ -494,6 +494,31 @@
494
494
  "author": "Fahad Heylaal"
495
495
  }
496
496
  },
497
+ {
498
+ "description": "for testing expose property with tags",
499
+ "tags": ["all", "checkout"],
500
+ "bucketBy": "userId",
501
+ "environments": {
502
+ "staging": {
503
+ "expose": ["checkout"],
504
+ "force": [
505
+ { "segments": "qa", "enabled": true },
506
+ {
507
+ "conditions": [{ "attribute": "userId", "operator": "equals", "value": "user-3" }],
508
+ "enabled": true
509
+ }
510
+ ],
511
+ "rules": [{ "key": "1", "segments": "*", "percentage": 0 }]
512
+ },
513
+ "production": { "rules": [{ "key": "1", "segments": "*", "percentage": 0 }] }
514
+ },
515
+ "key": "showBanner",
516
+ "lastModified": {
517
+ "commit": "1ae08e7",
518
+ "timestamp": "2024-01-23T22:36:30+01:00",
519
+ "author": "Fahad Heylaal"
520
+ }
521
+ },
497
522
  {
498
523
  "description": "for testing force API in features",
499
524
  "tags": ["all"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featurevisor/site",
3
- "version": "1.5.0",
3
+ "version": "1.7.1",
4
4
  "description": "Static site for Featurevisor",
5
5
  "main": "dist",
6
6
  "scripts": {
@@ -65,5 +65,5 @@
65
65
  "dependencies": {
66
66
  "@featurevisor/types": "^1.3.0"
67
67
  },
68
- "gitHead": "522f5c631801a198ecb676ce7ee719b45fbf4cf4"
68
+ "gitHead": "331b2cb8a034eb27a7d395d0b6d14eb5ae8ebadf"
69
69
  }
@@ -18,6 +18,35 @@ export function DisplayFeatureOverview() {
18
18
 
19
19
  const environmentKeys = Object.keys(feature.environments).sort();
20
20
 
21
+ const renderBucketBy = (bucketBy) => {
22
+ if (typeof bucketBy === "string") {
23
+ return <span>{bucketBy}</span>;
24
+ }
25
+
26
+ if (bucketBy.or) {
27
+ return (
28
+ <ul>
29
+ <li>
30
+ <span className="rounded-full px-2 py-1 text-sm font-bold bg-yellow-300 text-yellow-700">
31
+ or:
32
+ </span>
33
+ {renderBucketBy(bucketBy.or)}
34
+ </li>
35
+ </ul>
36
+ );
37
+ }
38
+
39
+ return (
40
+ <ul className="list-inside list-disc pl-5">
41
+ {bucketBy.map((b) => (
42
+ <li key={b} className="py-1">
43
+ {b}
44
+ </li>
45
+ ))}
46
+ </ul>
47
+ );
48
+ };
49
+
21
50
  return (
22
51
  <div className="border-gray-200">
23
52
  <dl className="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
@@ -33,17 +62,7 @@ export function DisplayFeatureOverview() {
33
62
  </div>
34
63
  <div>
35
64
  <dt className="text-sm font-medium text-gray-500">Bucket by</dt>
36
- <dd className="mt-1 text-sm text-gray-900">
37
- {typeof feature.bucketBy === "string" ? (
38
- <span>{feature.bucketBy}</span>
39
- ) : (
40
- <ul>
41
- {feature.bucketBy.map((b) => (
42
- <li key={b}>{b}</li>
43
- ))}
44
- </ul>
45
- )}
46
- </dd>
65
+ <dd className="mt-1 text-sm text-gray-900">{renderBucketBy(feature.bucketBy)}</dd>
47
66
  </div>
48
67
  <div>
49
68
  <dt className="text-sm font-medium text-gray-500">Status</dt>
@@ -216,6 +235,13 @@ export function DisplayFeatureRulesTable() {
216
235
  </p>
217
236
  )}
218
237
 
238
+ {Array.isArray(feature.environments[environmentKey].expose) && (
239
+ <p className="mt-2 block rounded border-2 border-orange-300 bg-orange-200 p-3 text-sm text-gray-600">
240
+ Rules are <a href="https://featurevisor.com/docs/features/#expose">exposed</a> for these
241
+ tags only: {feature.environments[environmentKey].expose.join(", ")}.
242
+ </p>
243
+ )}
244
+
219
245
  <table className="mt-3 min-w-full divide-y divide-gray-300 border border-gray-200">
220
246
  <thead className="bg-gray-50">
221
247
  <tr>