@featurevisor/site 0.56.0 → 0.57.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.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +22 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/lib/components/Tabs.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/App.tsx +4 -18
- package/src/components/ShowFeature.tsx +57 -45
- package/src/components/Tabs.tsx +2 -1
- package/src/utils/index.ts +1 -1
package/lib/components/Tabs.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featurevisor/site",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.1",
|
|
4
4
|
"description": "Static site for Featurevisor",
|
|
5
5
|
"main": "dist",
|
|
6
6
|
"scripts": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"webpack-merge": "^5.10.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@featurevisor/types": "^0.
|
|
66
|
+
"@featurevisor/types": "^0.57.0"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "7cc477b7ab7eef3d6db88249d0806db56b16fd2f"
|
|
69
69
|
}
|
package/src/components/App.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import { Routes, Route,
|
|
3
|
+
import { Routes, Route, Navigate } from "react-router-dom";
|
|
4
4
|
|
|
5
5
|
import { Header } from "./Header";
|
|
6
6
|
import { Footer } from "./Footer";
|
|
@@ -63,9 +63,6 @@ export function App() {
|
|
|
63
63
|
{fetchedSearchIndex && (
|
|
64
64
|
<SearchIndexContext.Provider value={{ isLoaded: true, data: fetchedSearchIndex }}>
|
|
65
65
|
<Routes>
|
|
66
|
-
{/* @TODO: try redirecting to /features */}
|
|
67
|
-
<Route path="/" element={<ListFeatures />} />
|
|
68
|
-
|
|
69
66
|
<Route path="features">
|
|
70
67
|
<Route index element={<ListFeatures />} />
|
|
71
68
|
|
|
@@ -75,23 +72,11 @@ export function App() {
|
|
|
75
72
|
<Route path="variables" element={<DisplayFeatureVariablesSchema />} />
|
|
76
73
|
<Route path="rules" element={<DisplayFeatureRules />}>
|
|
77
74
|
<Route path=":environmentKey" element={<DisplayFeatureRulesTable />} />
|
|
78
|
-
<Route
|
|
79
|
-
path="*"
|
|
80
|
-
loader={({ params }) =>
|
|
81
|
-
/* @TODO: fix redirection */
|
|
82
|
-
redirect(`/features/${params.featureKey}/rules/${environmentKeys[0]}`)
|
|
83
|
-
}
|
|
84
|
-
/>
|
|
75
|
+
<Route index element={<Navigate to={environmentKeys[0]} replace />} />
|
|
85
76
|
</Route>
|
|
86
77
|
<Route path="force" element={<DisplayFeatureForce />}>
|
|
87
78
|
<Route path=":environmentKey" element={<DisplayFeatureForceTable />} />
|
|
88
|
-
<Route
|
|
89
|
-
path="*"
|
|
90
|
-
loader={({ params }) =>
|
|
91
|
-
/* @TODO: fix redirection */
|
|
92
|
-
redirect(`/features/${params.featureKey}/force/${environmentKeys[0]}`)
|
|
93
|
-
}
|
|
94
|
-
/>
|
|
79
|
+
<Route index element={<Navigate to={environmentKeys[0]} replace />} />
|
|
95
80
|
</Route>
|
|
96
81
|
<Route path="history" element={<DisplayFeatureHistory />} />
|
|
97
82
|
</Route>
|
|
@@ -118,6 +103,7 @@ export function App() {
|
|
|
118
103
|
</Route>
|
|
119
104
|
|
|
120
105
|
<Route path="history" element={<ListHistory />} />
|
|
106
|
+
<Route index element={<Navigate to="features" replace />} />
|
|
121
107
|
</Routes>
|
|
122
108
|
</SearchIndexContext.Provider>
|
|
123
109
|
)}
|
|
@@ -208,51 +208,62 @@ export function DisplayFeatureRulesTable() {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
return (
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
<
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
211
|
+
<div>
|
|
212
|
+
{feature.environments[environmentKey].expose === false && (
|
|
213
|
+
<p className="mt-2 block rounded border-2 border-orange-300 bg-orange-200 p-3 text-sm text-gray-600">
|
|
214
|
+
Rules are not <a href="https://featurevisor.com/docs/features/#expose">exposed</a> in this
|
|
215
|
+
environment.
|
|
216
|
+
</p>
|
|
217
|
+
)}
|
|
218
|
+
|
|
219
|
+
<table className="mt-3 min-w-full divide-y divide-gray-300 border border-gray-200">
|
|
220
|
+
<thead className="bg-gray-50">
|
|
221
|
+
<tr>
|
|
222
|
+
<th className="py-4 pl-4 pr-3 text-left text-sm font-semibold text-gray-500">
|
|
223
|
+
Percentage
|
|
224
|
+
</th>
|
|
225
|
+
<th className="py-4 pl-4 pr-3 text-left text-sm font-semibold text-gray-500">
|
|
226
|
+
Segments
|
|
227
|
+
</th>
|
|
228
|
+
<th className="py-4 pl-4 pr-3 text-left text-sm font-semibold text-gray-500">
|
|
229
|
+
Variables
|
|
230
|
+
</th>
|
|
231
|
+
</tr>
|
|
232
|
+
</thead>
|
|
233
|
+
|
|
234
|
+
<tbody>
|
|
235
|
+
{feature.environments[environmentKey].rules.map((rule, index) => {
|
|
236
|
+
return (
|
|
237
|
+
<tr key={index} className={index % 2 === 0 ? undefined : "bg-gray-50"}>
|
|
238
|
+
<td className="py-4 pl-4 pr-3 text-sm text-gray-900">{rule.percentage}%</td>
|
|
239
|
+
<td className="py-4 pl-4 pr-3 text-sm text-gray-900">
|
|
240
|
+
<ExpandRuleSegments segments={rule.segments} />
|
|
241
|
+
</td>
|
|
242
|
+
<td className="py-4 pl-4 pr-3 text-sm text-gray-900">
|
|
243
|
+
{rule.variables && (
|
|
244
|
+
<ul className="list-inside list-disc">
|
|
245
|
+
{Object.keys(rule.variables).map((k) => {
|
|
246
|
+
return (
|
|
247
|
+
<li key={k}>
|
|
248
|
+
<span className="font-semibold">{k}</span>:{" "}
|
|
249
|
+
{typeof rule.variables[k] === "string" && rule.variables[k]}
|
|
250
|
+
{typeof rule.variables[k] !== "string" && (
|
|
251
|
+
<code className="rounded bg-gray-100 px-2 py-1 text-red-400">
|
|
252
|
+
{rule.variables[k]}
|
|
253
|
+
</code>
|
|
254
|
+
)}
|
|
255
|
+
</li>
|
|
256
|
+
);
|
|
257
|
+
})}
|
|
258
|
+
</ul>
|
|
259
|
+
)}
|
|
260
|
+
</td>
|
|
261
|
+
</tr>
|
|
262
|
+
);
|
|
263
|
+
})}
|
|
264
|
+
</tbody>
|
|
265
|
+
</table>
|
|
266
|
+
</div>
|
|
256
267
|
);
|
|
257
268
|
}
|
|
258
269
|
|
|
@@ -439,6 +450,7 @@ export function ShowFeature() {
|
|
|
439
450
|
{
|
|
440
451
|
title: "Overview",
|
|
441
452
|
to: `/features/${featureKey}`,
|
|
453
|
+
end: true,
|
|
442
454
|
},
|
|
443
455
|
{
|
|
444
456
|
title: "Variations",
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { NavLink } from "react-router-dom";
|
|
|
4
4
|
interface Tab {
|
|
5
5
|
title: string;
|
|
6
6
|
to: string;
|
|
7
|
+
end?: boolean;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
interface TabsProps {
|
|
@@ -20,7 +21,7 @@ export function Tabs(props: TabsProps) {
|
|
|
20
21
|
<NavLink
|
|
21
22
|
key={tab.title}
|
|
22
23
|
to={tab.to}
|
|
23
|
-
end
|
|
24
|
+
end={Boolean(tab.end)}
|
|
24
25
|
className={({ isActive }) =>
|
|
25
26
|
[
|
|
26
27
|
"w-1/4",
|
package/src/utils/index.ts
CHANGED