Skip to content

Commit

Permalink
Merge pull request #424 from SAHU-01/master
Browse files Browse the repository at this point in the history
[UI] Subscription tier position relocated
  • Loading branch information
SAHU-01 authored Dec 20, 2024
2 parents 2337405 + e05c4cd commit ee8f3f0
Show file tree
Hide file tree
Showing 13 changed files with 961 additions and 1,459 deletions.
87 changes: 87 additions & 0 deletions .github/build/features-to-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env node
const fs = require("fs").promises;
const csv = require("csvtojson");

const headers = [
"Theme",
"Category Order",
"Category",
"Function Order",
"Function",
"Feature",
"Subscription Tier",
"Free",
"Team Designer",
"Team Operator",
"Enterprise",
"Exclude",
"Docs",
];

async function processCSV() {
try {
// Default paths, can be overridden by command line arguments
const csvFilePath = process.argv[2] || ".github/build/spreadsheet.csv";
const featuresFile = process.argv[3] || "data/feature_data.json";

// Log file paths if custom paths are provided
if (process.argv[2]) {
console.log("Reading features from: " + process.argv[2]);
}
if (process.argv[3]) {
console.log("Outputting JSON to: " + process.argv[3]);
}

// Read CSV and parse
const rows = await csv({
noheader: true,
headers: headers,
output: "json",
}).fromFile(csvFilePath);

// Filter and transform rows
const filteredData = rows
.filter(row => {
// Only include rows with a non-empty docs column
const docsValue = row["Docs"]?.trim();
return docsValue && docsValue !== "";
})
.map(row => {
// Transform row to desired structure
return {
theme: row["Theme"]?.trim(),
categoryOrder: row["Category Order"]?.trim(),
category: row["Category"]?.trim(),
functionOrder: row["Function Order"]?.trim(),
function: row["Function"]?.trim(),
feature: row["Feature"]?.trim(),
subscriptionTier: row["Subscription Tier"]?.trim(),
comparisonTiers: {
free: row["Free"]?.trim().toLowerCase() === 'x',
teamDesigner: row["Team Designer"]?.trim().toLowerCase() === 'x',
teamOperator: row["Team Operator"]?.trim().toLowerCase() === 'x',
enterprise: row["Enterprise"]?.trim().toLowerCase() === 'x'
},
docs: row["Docs"]?.trim()
};
});

// Write filtered data to JSON file
try {
await fs.writeFile(
featuresFile,
JSON.stringify(filteredData, null, 2)
);
console.log(`Successfully wrote ${filteredData.length} features to ${featuresFile}`);
} catch (error) {
console.error("Error writing to features JSON file:", error);
process.exit(1);
}

} catch (error) {
console.error("Error processing CSV:", error);
process.exit(1);
}
}

processCSV();
82 changes: 24 additions & 58 deletions .github/workflows/feature-list.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,51 @@
name: Feature List Update
name: Feature List

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run every night at midnight UTC
workflow_dispatch:
- cron: '0 0 * * *'

permissions:
contents: write
actions: read

jobs:
check-and-update-features:
trigger-feature-list:
runs-on: ubuntu-latest
env:
FEATURES_FILE: 'data/features.json'
FEATURES_FILE: 'data/feature_data.json'
SPREADSHEET_URL: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=1153419764&single=true&output=csv'

steps:
- name: Checkout current repository
uses: actions/checkout@v4

- name: Restore cache
id: cache-sha
uses: actions/cache@v3
- name: Install Node.js
uses: actions/setup-node@v4
with:
path: .sha-cache
key: feature-data-sha
restore-keys: |
feature-data-sha
node-version: 18

- name: Check for updates in source repository
id: check-updates
uses: actions/github-script@v7
with:
script: |
const { data: sourceFile } = await github.rest.repos.getContent({
owner: 'layer5labs',
repo: 'meshery-extensions-packages',
path: 'feature_data.json',
ref: 'master'
});
// Store the latest commit SHA
const latestSHA = sourceFile.sha;
const fs = require('fs');
// Check if we have a previous SHA
let hasUpdates = true;
const shaCachePath = '.sha-cache/latest-sha';
if (fs.existsSync(shaCachePath)) {
const lastSHA = fs.readFileSync(shaCachePath, 'utf8');
hasUpdates = lastSHA !== latestSHA;
}
if (hasUpdates) {
// Save the new SHA
fs.mkdirSync('.sha-cache', { recursive: true });
fs.writeFileSync(shaCachePath, latestSHA);
// Decode and save the content
const content = Buffer.from(sourceFile.content, 'base64').toString('utf8');
// Create data directory if it doesn't exist
fs.mkdirSync('data', { recursive: true });
// Write the new content
fs.writeFileSync(process.env.FEATURES_FILE, content);
core.setOutput('has-updates', 'true');
} else {
core.setOutput('has-updates', 'false');
}
- name: Install dependencies
run: |
npm install csvtojson --legacy-peer-deps
- name: Fetch spreadsheet and process updates
run: |
# Download the spreadsheet
curl -L $SPREADSHEET_URL -o .github/build/spreadsheet.csv
ls -al
# Process the CSV, filter data, and append to feature_data.json
node .github/build/features-to-json.js
- name: Commit changes
if: steps.check-updates.outputs.has-updates == 'true'
id: commit-changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Updated feature data from source repository"
commit_message: "Updated feature data from spreadsheet"
file_pattern: ${{ env.FEATURES_FILE }}
branch: master
commit_options: "--signoff"
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_author: 'l5io <l5io@users.noreply.github.com>'
42 changes: 42 additions & 0 deletions .github/workflows/generate-pricing-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Pricing List
on:
workflow_dispatch:
inputs:
spreadsheet_uri:
description: Link of the spreadsheet containing subscription details.
type: string
default: https://docs.google.com/spreadsheets/d/1Ck_5q7U_vLSIDTtplugG3pCVC5zugXgTHtO7T7-yL8g/pub?output=csv
schedule:
- cron: "0 0 * * *"
jobs:
fetch-pricing-list:
name: Fetch Pricing List
if: github.repository == 'layer5io/docs'
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 1
- name: Set spreadsheet_uri as environment variable
run: echo "spreadsheet_uri=https://docs.google.com/spreadsheets/d/1Ck_5q7U_vLSIDTtplugG3pCVC5zugXgTHtO7T7-yL8g/pub?output=csv" >> $GITHUB_ENV
if: inputs.spreadsheet_uri != ''
echo "spreadsheet_uri=${{ inputs.spreadsheet_uri }}" >> $GITHUB_ENV

- name: Dump pricing list from the spreadsheet
run: |
curl -L $spreadsheet_uri -o "./pricing-list.csv";
- name: Create data folder
run: |
[ ! -d "./static/data/csv" ] && mkdir -p "./static/data/csv";
mv pricing-list.csv static/data/csv/pricing-list.csv;
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Updated pricing-list data.
branch: master
commit_options: "--signoff"
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>author of the commit that triggered the run
2 changes: 1 addition & 1 deletion assets/scss/_pageinfo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
margin-top: map-get($spacers, 5) !important;
padding-top: map-get($spacers, 3) !important;
}
}
}
1 change: 0 additions & 1 deletion assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ a:not([href]):not([class]):hover {
font-weight: $font-weight-medium;
background: $black;
font-family: "Qanelas Soft";
border-style: solid;
margin: 2rem auto;
padding: 1rem;
border-color: #00b39f;
Expand Down
1 change: 1 addition & 0 deletions content/en/cloud/self-hosted/planning/identity-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ categories: [Self-Hosted]
tags: [identity]
weight: 3
---

Layer5 Cloud offers a built-in identity provider (IDP), supporting OIDC for normal users and token-based authentication (access, ID, refresh tokens) for API clients with JSON Web Signature (JWS) for token signing. Layer5 Cloud users can sign-up via email and password in addition to social identity providers (Google and GitHub) via OAuth2. See [Getting Started with a Layer5 Account](../../getting-started/getting-started-with-layer5-account.md) for details.

Layer5 Cloud identity services include features such as account recovery, email verification, automatica social sign-in account linking, and multi-factor authentication (coming soon).
Expand Down
39 changes: 19 additions & 20 deletions content/en/cloud/tutorials/gitops-snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ category: GitOps
weight: 4
---


Kanvas Snapshots offer visual insights in every pull request. Verify your workload designs and Kubernetes cluster configurations prior to accepting and merging pull requests.

## Meshery GitHub App
Expand Down Expand Up @@ -78,11 +77,11 @@ Next level leggings before they sold out, PBR&B church-key shaman echo park. Kal
###### Header 6
| What | Follows |
|-----------|-----------------|
| A table | A header |
| A table | A header |
| A table | A header |
| What | Follows |
| ------- | -------- |
| A table | A header |
| A table | A header |
| A table | A header |
----------------
Expand Down Expand Up @@ -147,19 +146,19 @@ Color
Tables should have bold headings and alternating shaded rows.
| Artist | Album | Year |
|-------------------|-----------------|------|
| Michael Jackson | Thriller | 1982 |
| Prince | Purple Rain | 1984 |
| Beastie Boys | License to Ill | 1986 |
| Artist | Album | Year |
| --------------- | -------------- | ---- |
| Michael Jackson | Thriller | 1982 |
| Prince | Purple Rain | 1984 |
| Beastie Boys | License to Ill | 1986 |
If a table is too wide, it should scroll horizontally.
| Artist | Album | Year | Label | Awards | Songs |
|-------------------|-----------------|------|-------------|----------|-----------|
| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life |
| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain |
| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill |
| Artist | Album | Year | Label | Awards | Songs |
| --------------- | -------------- | ---- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life |
| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain |
| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill |
----------------
Expand Down Expand Up @@ -198,10 +197,10 @@ Long, single-line code blocks should not wrap. They should horizontally scroll i
Inline code inside table cells should still be distinguishable.
| Language | Code |
|-------------|--------------------|
| Javascript | `var foo = "bar";` |
| Ruby | `foo = "bar"{` |
| Language | Code |
| ---------- | ------------------ |
| Javascript | `var foo = "bar";` |
| Ruby | `foo = "bar"{` |
----------------
Expand Down
Loading

0 comments on commit ee8f3f0

Please sign in to comment.