Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheet Migration for Pricing PAhe #6107

Merged
merged 16 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 20 additions & 46 deletions .github/workflows/feature-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
env:
FEATURES_FILE: 'src/sections/Pricing/feature_data.json'
SPREADSHEET_URL: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=829069645&single=true&output=csv'
SPREADSHEET_URL: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=1153419764&single=true&output=csv'

steps:
- name: Checkout current repository
Expand All @@ -40,74 +40,48 @@ jobs:
const csv = require('csvtojson');

const headers = [
'Theme (also: Keychain Name)',
'Theme',
'Category',
'Function',
'Feature',
'Primary Persona',
'Entitlement',
'Subscription Tier',
'Free Comparison Tier',
'TeamDesigner Comparison Tier',
'TeamOperator Comparison Tier',
'Enterprise Comparison Tier',
'Tech',
'Version',
'Engineer',
'Free Tier',
'TeamDesigner Tier',
'TeamOperator Tier',
'Enterprise Tier',
'Pricing Page?',
'Video?',
'Documented?',
'Anonymous',
'Authorization',
'Team Admin',
'Workspace Admin',
'Org Billing Manager',
'Org Admin',
'Provider Admin',
'Curator',
'MeshMap',
'Keychain ID',
'SQL',
'Key ID',
'Inserted',
'Local Provider',
'Update SQL',
'E2E Test',
];

csv({
noheader: true, // Ignore the first row as headers
headers: headers, // Use our custom headers
output: 'json', // Output as JSON
noheader: true,
headers: headers,
output: 'json',
})
.fromFile('spreadsheet.csv')
.then(rows => {

// Filter data
const filteredData = rows
.map(row => {
const pricingPage = row['Pricing Page?']?.toLowerCase() || '';
const documented = row['Documented?']?.trim() || '';

const includeRow =
(pricingPage && ['x', 'X', 'true'].includes(pricingPage)) ||
(documented.startsWith('https://docs.meshery.io/') ||
documented.startsWith('https://docs.layer5.io/'));
if (!includeRow) return null;

return {
theme: row['Theme (also: Keychain Name)'],
const pricingPage = row['Pricing Page?']?.toLowerCase() || '';
const hasXTier = ['Free Tier', 'TeamDesigner Tier', 'TeamOperator Tier', 'Enterprise Tier'].some(tier => row[tier]?.trim().toLowerCase() === 'x');
const includRow = hasXTier || (pricingPage && ['x', 'X'].includes(pricingPage));
leecalcote marked this conversation as resolved.
Show resolved Hide resolved
if (!includeRow) return null;
return {
theme: row['Theme'],
category: row['Category'],
function: row['Function'],
feature: row['Feature'],
subscription_tier: row['Subscription Tier'],
comparison_tiers: {
free: row['Free Comparison Tier'],
teamDesigner: row['TeamDesigner Comparison Tier'],
teamOperator: row['TeamOperator Comparison Tier'],
enterprise: row['Enterprise Comparison Tier'],
free: row['Free Tier'],
teamDesigner: row['TeamDesigner Tier'],
teamOperator: row['TeamOperator Tier'],
enterprise: row['Enterprise Tier'],
},
};
};
})
.filter(Boolean);

Expand Down
Loading
Loading