Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions src/frontend/src/components/FooterLegal.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ const t = Astro.locals.t as unknown as (key: string) => string;
{t('footer.legal') || 'Legal'}
</p>
<ul class="footer-links">
<li>
<a
href="https://github.com/microsoft/aspire/blob/main/LICENSE.TXT"
target="_blank"
rel="noopener noreferrer"
>
{t('footer.aspireLicense')}
</a>
</li>
<li>
<a
href="https://aka.ms/yourcaliforniaprivacychoices"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Aside, Steps, Tabs, TabItem } from '@astrojs/starlight/components';
import { Kbd } from 'starlight-kbd/components'
import LearnMore from '@components/LearnMore.astro';

Aspire is a code-first orchestration and observability layer for distributed applications.
Aspire is a code-first orchestration and observability layer for distributed applications. It is open-source software licensed under the [MIT License](https://github.com/microsoft/aspire/blob/main/LICENSE.TXT).

Use Aspire to model the services, frontends, databases, queues, caches, containers, and cloud dependencies that make up your app. In production they work together as one system, but during development they often need to be started separately, configured by hand, and debugged across multiple terminals and dashboards. Aspire gives you one place to define that system, one command to run it, and one toolchain to observe it.

Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/content/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"privacy": "Privacy",
"resources": "Resources",
"legal": "Legal",
"aspireLicense": "Aspire software: MIT License",
"privacyChoices": "Your Privacy Choices",
"consumerHealthPrivacy": "Consumer Health Privacy",
"contact": "Contact",
Expand Down
42 changes: 42 additions & 0 deletions src/frontend/tests/e2e/licensing.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { expect, test } from '@playwright/test';
import { dismissCookieConsentIfVisible } from './helpers';

const licenseUrl = 'https://github.com/microsoft/aspire/blob/main/LICENSE.TXT';

for (const path of ['/', '/get-started/what-is-aspire/']) {
test(`Aspire's MIT software license is discoverable on ${path}`, async ({ page }) => {
await page.goto(path);
await dismissCookieConsentIfVisible(page);

const legal = page.getByRole('navigation', { name: 'Legal', exact: true });
const license = legal.getByRole('link', { name: 'Aspire software: MIT License', exact: true });
await expect(license).toHaveAttribute('href', licenseUrl);
await license.scrollIntoViewIfNeeded();
await expect(license).toBeVisible();
await license.focus();
await expect(license).toBeFocused();
await license.click({ trial: true });
const bounds = await license.boundingBox();
expect(bounds).not.toBeNull();
expect(bounds!.x).toBeGreaterThanOrEqual(0);
expect(bounds!.x + bounds!.width).toBeLessThanOrEqual(page.viewportSize()!.width);

await expect(legal.getByRole('link', { name: 'Terms of Use', exact: true })).toHaveAttribute(
'href',
'https://go.microsoft.com/fwlink/?LinkID=206977'
);
await expect(legal.getByRole('link', { name: 'Privacy & Cookies', exact: true })).toBeVisible();
await expect(legal.getByRole('link', { name: 'Trademarks', exact: true })).toBeVisible();

if (path !== '/') {
const content = page.locator('.sl-markdown-content');
await expect(content).toContainText(
'It is open-source software licensed under the MIT License.'
);
await expect(content.getByRole('link', { name: 'MIT License', exact: true })).toHaveAttribute(
'href',
licenseUrl
);
}
});
}
22 changes: 22 additions & 0 deletions src/frontend/tests/unit/custom-components.vitest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,28 @@ describe('custom Astro component render coverage', () => {
expect(html).not.toContain('data-open-install-modal');
});

it('links Aspire software to its MIT license without replacing website legal links', async () => {
const html = normalizeHtml(
await renderComponent(FooterLegal, {
locals: { t: createTestTranslator(enTranslations) },
})
);

expect(html).toMatch(
/<a[^>]*href="https:\/\/github\.com\/microsoft\/aspire\/blob\/main\/LICENSE\.TXT"[^>]*>\s*Aspire software: MIT License\s*<\/a>/
);
for (const href of [
'https://aka.ms/yourcaliforniaprivacychoices',
'https://go.microsoft.com/fwlink/?LinkId=521839',
'https://go.microsoft.com/fwlink/?LinkID=206977',
'https://go.microsoft.com/fwlink/?linkid=2196228',
'/support/',
]) {
expect(html).toContain(`href="${href}"`);
}
expect(html).toContain('Terms of Use');
});

it('renders a unique scanner-addressable Manage Cookies action under Legal', async () => {
const html = normalizeHtml(
await renderComponent(FooterLegal, {
Expand Down
Loading