@featurevisor/site 0.57.0 → 0.58.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featurevisor/site",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
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.57.0"
66
+ "@featurevisor/types": "^0.58.0"
67
67
  },
68
- "gitHead": "62bd5cfb1b6f2f40747ad3abb3aa2562b3ec8aa7"
68
+ "gitHead": "0a7f0f889fb6353a70304d0e14ec12a50240e7f2"
69
69
  }
@@ -208,51 +208,62 @@ export function DisplayFeatureRulesTable() {
208
208
  }
209
209
 
210
210
  return (
211
- <table className="mt-3 min-w-full divide-y divide-gray-300 border border-gray-200">
212
- <thead className="bg-gray-50">
213
- <tr>
214
- <th className="py-4 pl-4 pr-3 text-left text-sm font-semibold text-gray-500">
215
- Percentage
216
- </th>
217
- <th className="py-4 pl-4 pr-3 text-left text-sm font-semibold text-gray-500">Segments</th>
218
- <th className="py-4 pl-4 pr-3 text-left text-sm font-semibold text-gray-500">
219
- Variables
220
- </th>
221
- </tr>
222
- </thead>
223
-
224
- <tbody>
225
- {feature.environments[environmentKey].rules.map((rule, index) => {
226
- return (
227
- <tr key={index} className={index % 2 === 0 ? undefined : "bg-gray-50"}>
228
- <td className="py-4 pl-4 pr-3 text-sm text-gray-900">{rule.percentage}%</td>
229
- <td className="py-4 pl-4 pr-3 text-sm text-gray-900">
230
- <ExpandRuleSegments segments={rule.segments} />
231
- </td>
232
- <td className="py-4 pl-4 pr-3 text-sm text-gray-900">
233
- {rule.variables && (
234
- <ul className="list-inside list-disc">
235
- {Object.keys(rule.variables).map((k) => {
236
- return (
237
- <li key={k}>
238
- <span className="font-semibold">{k}</span>:{" "}
239
- {typeof rule.variables[k] === "string" && rule.variables[k]}
240
- {typeof rule.variables[k] !== "string" && (
241
- <code className="rounded bg-gray-100 px-2 py-1 text-red-400">
242
- {rule.variables[k]}
243
- </code>
244
- )}
245
- </li>
246
- );
247
- })}
248
- </ul>
249
- )}
250
- </td>
251
- </tr>
252
- );
253
- })}
254
- </tbody>
255
- </table>
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
 
@@ -67,7 +67,7 @@ export function isEnabledInEnvironment(feature: any, environment: string) {
67
67
  return false;
68
68
  }
69
69
 
70
- if (feature.environments[environment].exposed === false) {
70
+ if (feature.environments[environment].expose === false) {
71
71
  return false;
72
72
  }
73
73