Skip to content

Commit f392cd3

Browse files
authored
Merge pull request Expensify#45526 from rushatgabhane/helpdot
[HelpDot] Restructure Integrations Category on Exfy Classic
2 parents 28b4915 + ba1050f commit f392cd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+170
-55
lines changed

.github/scripts/createDocsRoutes.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {ValueOf} from 'type-fest';
55
type Article = {
66
href: string;
77
title: string;
8+
order?: number;
89
};
910

1011
type Section = {
@@ -60,11 +61,12 @@ function toTitleCase(str: string): string {
6061
/**
6162
* @param filename - The name of the file
6263
*/
63-
function getArticleObj(filename: string): Article {
64+
function getArticleObj(filename: string, order?: number): Article {
6465
const href = filename.replace('.md', '');
6566
return {
6667
href,
6768
title: toTitleCase(href.replaceAll('-', ' ')),
69+
order,
6870
};
6971
}
7072

@@ -90,6 +92,12 @@ function pushOrCreateEntry<TKey extends HubEntriesKey>(hubs: Hub[], hub: string,
9092
}
9193
}
9294

95+
function getOrderFromArticleFrontMatter(path: string): number | undefined {
96+
const frontmatter = fs.readFileSync(path, 'utf8').split('---')[1];
97+
const frontmatterObject = yaml.load(frontmatter) as Record<string, unknown>;
98+
return frontmatterObject.order as number | undefined;
99+
}
100+
93101
/**
94102
* Add articles and sections to hubs
95103
* @param hubs - The hubs inside docs/articles/ for a platform
@@ -113,7 +121,8 @@ function createHubsWithArticles(hubs: string[], platformName: ValueOf<typeof pla
113121

114122
// Each subfolder will be a section containing articles
115123
fs.readdirSync(`${docsDir}/articles/${platformName}/${hub}/${section}`).forEach((subArticle) => {
116-
articles.push(getArticleObj(subArticle));
124+
const order = getOrderFromArticleFrontMatter(`${docsDir}/articles/${platformName}/${hub}/${section}/${subArticle}`);
125+
articles.push(getArticleObj(subArticle, order));
117126
});
118127

119128
pushOrCreateEntry(routeHubs, hub, 'sections', {

docs/_data/_routes.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ platforms:
6969
icon: /assets/images/handshake.svg
7070
description: Discover the benefits of becoming an Expensify Partner.
7171

72-
- href: integrations
73-
title: Integrations
72+
- href: connections
73+
title: Connections
7474
icon: /assets/images/simple-illustration__monitor-remotesync.svg
7575
description: Integrate with accounting or HR software to streamline expense approvals.
7676

docs/_includes/hub.html

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ <h1 class="title">
1212
{{ hub.description }}
1313
</p>
1414

15+
{% assign sortedSectionsAndArticles = hub.sections | concat: hub.articles | sort: 'title' %}
16+
1517
<section>
1618
<div class="cards-group">
17-
{% for section in hub.sections %}
18-
{% include section-card.html platform=activePlatform hub=hub.href section=section.href title=section.title %}
19-
{% endfor %}
20-
{% for article in hub.articles %}
21-
{% include article-card.html hub=hub.href href=article.href title=article.title platform=activePlatform %}
19+
{% for item in sortedSectionsAndArticles %}
20+
<!-- The item is a section if it has articles inside it -->
21+
{% if item.articles %}
22+
{% include section-card.html platform=activePlatform hub=hub.href section=item.href title=item.title %}
23+
{% else %}
24+
{% include article-card.html hub=hub.href href=item.href title=item.title platform=activePlatform %}
25+
{% endif %}
2226
{% endfor %}
2327
</div>
2428
</section>

docs/_includes/lhn-template.html

+25-25
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,31 @@
3333
<span>{{ hub.title }}</span>
3434
</div>
3535
<ul class="nested-treeview">
36-
{% for section in hub.sections %}
37-
<li>
38-
{% if section.href == activeSection %}
39-
<div class="icon-with-link selected">
40-
<a href="/{{ activePlatform }}/hubs/{{ hub.href }}"><img src="/assets/images/down.svg" class="base-icon"></img></a>
41-
<span>{{ section.title }}</span>
42-
</div>
43-
<ul>
44-
{% for article in section.articles %}
45-
{% assign article_href = section.href | append: '/' | append: article.href %}
46-
{% include lhn-article-link.html platform=activePlatform hub=hub.href href=article_href title=article.title %}
47-
{% endfor %}
48-
</ul>
49-
{% else %}
50-
<a href="{{ section.href }}" class="icon-with-link link">
51-
<img src="/assets/images/arrow-right.svg" class="base-icon"></img>
52-
{{ section.title }}
53-
</a>
54-
{% endif %}
55-
56-
</li>
57-
{% endfor %}
58-
59-
{% for article in hub.articles %}
60-
{% include lhn-article-link.html platform=activePlatform hub=hub.href href=article.href title=article.title %}
36+
{% assign sortedSectionsAndArticles = hub.sections | concat: hub.articles | sort: 'title' %}
37+
{% for item in sortedSectionsAndArticles %}
38+
{% if item.articles %}
39+
<li>
40+
{% if item.href == activeSection %}
41+
<div class="icon-with-link selected">
42+
<a href="/{{ activePlatform }}/hubs/{{ hub.href }}"><img src="/assets/images/down.svg" class="base-icon"></img></a>
43+
<span>{{ item.title }}</span>
44+
</div>
45+
<ul>
46+
{% for article in item.articles %}
47+
{% assign article_href = item.href | append: '/' | append: article.href %}
48+
{% include lhn-article-link.html platform=activePlatform hub=hub.href href=article_href title=article.title %}
49+
{% endfor %}
50+
</ul>
51+
{% else %}
52+
<a href="{{ item.href }}" class="icon-with-link link">
53+
<img src="/assets/images/arrow-right.svg" class="base-icon"></img>
54+
{{ item.title }}
55+
</a>
56+
{% endif %}
57+
</li>
58+
{% else %}
59+
{% include lhn-article-link.html platform=activePlatform hub=hub.href href=item.href title=item.title %}
60+
{% endif %}
6161
{% endfor %}
6262
</ul>
6363
{% else %}

docs/_includes/section.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ <h1 class="title">
1515

1616
<section>
1717
<div class="cards-group">
18-
{% for article in section.articles %}
18+
{% assign sortedArticles = section.articles | sort: 'order', 'last' | default: 999 %}
19+
{% for article in sortedArticles %}
1920
{% assign article_href = section.href | append: '/' | append: article.href %}
2021
{% include article-card.html hub=hub.href href=article_href title=article.title platform=activePlatform %}
2122
{% endfor %}

docs/articles/expensify-classic/integrations/accounting-integrations/Accelo.md docs/articles/expensify-classic/connections/accelo/Connect-To-Accelo.md

+1

docs/articles/expensify-classic/integrations/accounting-integrations/Certinia.md docs/articles/expensify-classic/connections/certinia/Connect-To-Certinia.md

+1

docs/articles/expensify-classic/integrations/accounting-integrations/NetSuite.md docs/articles/expensify-classic/connections/netsuite/Connect-To-NetSuite.md

+1

docs/articles/expensify-classic/integrations/accounting-integrations/QuickBooks-Desktop.md docs/articles/expensify-classic/connections/quickbooks-desktop/Connect-To-QuickBooks-Desktop.md

+1

docs/articles/expensify-classic/integrations/accounting-integrations/QuickBooks-Online.md docs/articles/expensify-classic/connections/quickbooks-online/Connect-To-QuickBooks-Online.md

+1

docs/articles/expensify-classic/integrations/accounting-integrations/Sage-Intacct.md docs/articles/expensify-classic/connections/sage-intacct/Connect-To-Sage-Intacct.md

+1

docs/articles/expensify-classic/integrations/accounting-integrations/Xero.md docs/articles/expensify-classic/connections/xero/Connect-To-Xero.md

+1

docs/expensify-classic/hubs/integrations/accounting-integrations.html

-5
This file was deleted.

docs/expensify-classic/hubs/integrations/other-integrations.html

-5
This file was deleted.

docs/expensify-classic/hubs/integrations/travel-integrations.html

-5
This file was deleted.

docs/expensify-classic/hubs/workspaces/reports.html

-5
This file was deleted.

docs/redirects.csv

+27
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,33 @@ https://help.expensify.com/articles/new-expensify/expenses/Set-up-your-wallet,ht
217217
https://help.expensify.com/articles/new-expensify/expenses/Split-an-expense,https://help.expensify.com/articles/new-expensify/expenses-&-payments/Split-an-expense
218218
https://help.expensify.com/articles/new-expensify/expenses/Track-expenses,https://help.expensify.com/articles/new-expensify/expenses-&-payments/Track-expenses
219219
https://help.expensify.com/articles/new-expensify/expenses/Unlock-a-Business-Bank-Account,https://help.expensify.com/articles/new-expensify/expenses-&-payments/Unlock-a-Business-Bank-Account
220+
https://help.expensify.com/expensify-classic/hubs/integrations/HR-integrations,https://help.expensify.com/expensify-classic/hubs/connections
221+
https://help.expensify.com/expensify-classic/hubs/integrations/accounting-integrations,https://help.expensify.com/expensify-classic/hubs/connections
222+
https://help.expensify.com/expensify-classic/hubs/integrations/other-integrations,https://help.expensify.com/expensify-classic/hubs/connections
223+
https://help.expensify.com/expensify-classic/hubs/integrations/travel-integrations,https://help.expensify.com/expensify-classic/hubs/connections
224+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/ADP,https://help.expensify.com/articles/expensify-classic/connections/ADP
225+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Accelo,https://help.expensify.com/expensify-classic/hubs/connections/accelo
226+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/Additional-Travel-Integrations,https://help.expensify.com/articles/expensify-classic/connections/Additional-Travel-Integrations
227+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Certinia,https://help.expensify.com/expensify-classic/hubs/connections/certinia
228+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/Egencia,https://help.expensify.com/articles/expensify-classic/connections/Egencia
229+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/Global-VaTax,https://help.expensify.com/articles/expensify-classic/connections/Global-VaTax
230+
https://help.expensify.com/articles/expensify-classic/integrations/other-integrations/Google-Apps-SSO,https://help.expensify.com/articles/expensify-classic/connections/Google-Apps-SSO
231+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/Greenhouse,https://help.expensify.com/articles/expensify-classic/connections/Greenhouse
232+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/Gusto,https://help.expensify.com/articles/expensify-classic/connections/Gusto
233+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Indirect-Accounting-Integrations,https://help.expensify.com/articles/expensify-classic/connections/Indirect-Accounting-Integrations
234+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/Lyft,https://help.expensify.com/articles/expensify-classic/connections/Lyft
235+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/Navan,https://help.expensify.com/articles/expensify-classic/connections/Navan
236+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/NetSuite,https://help.expensify.com/expensify-classic/hubs/connections/netsuite
237+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/QuickBooks-Time,https://help.expensify.com/articles/expensify-classic/connections/QuickBooks-Time
238+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/QuickBooks-Desktop,https://help.expensify.com/expensify-classic/hubs/connections/quickbooks-desktop
239+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/QuickBooks-Online,https://help.expensify.com/expensify-classic/hubs/connections/quickbooks-online
240+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/Rippling,https://help.expensify.com/articles/expensify-classic/connections/Rippling
241+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Sage-Intacct,https://help.expensify.com/expensify-classic/hubs/connections/sage-intacct
242+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/TravelPerk,https://help.expensify.com/articles/expensify-classic/connections/TravelPerk
243+
https://help.expensify.com/articles/expensify-classic/integrations/travel-integrations/Uber,https://help.expensify.com/articles/expensify-classic/connections/Uber
244+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/Workday,https://help.expensify.com/articles/expensify-classic/connections/Workday
245+
https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Xero,https://help.expensify.com/expensify-classic/hubs/connections/xero
246+
https://help.expensify.com/articles/expensify-classic/integrations/HR-integrations/Zenefits,https://help.expensify.com/articles/expensify-classic/connections/Zenefits
220247
https://help.expensify.com/articles/expensify-classic/workspaces/tax-tracking,https://help.expensify.com/articles/expensify-classic/workspaces/Tax-Tracking
221248
https://help.expensify.com/articles/expensify-classic/copilots-and-delegates/Approval-Workflows,https://help.expensify.com/articles/expensify-classic/reports/Assign-report-approvers-to-specific-employees
222249
https://help.expensify.com/articles/expensify-classic/settings/Notification-Troubleshooting,https://help.expensify.com/articles/expensify-classic/settings/account-settings/Set-Notifications

0 commit comments

Comments
 (0)