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
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

# Describe the bug
A clear and concise description of what the bug is.

# Expected behavior
A clear and concise description of what you expected to happen.

# How does this bug make you feel?
_Share a gif from [giphy](https://giphy.com/) to tells us how you'd feel_

---

# Debugging information

## Steps to reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Screenshots
If applicable, add screenshots to help explain your problem.

## Logs

If applicable, add logs to help the engineer debug the problem.

---

# Tasks

_To be filled in by the engineer picking up the issue_

- [ ] Task 1
- [ ] Task 2
- [ ] ...
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

# Motivation

A clear and concise description of why this feature would be useful and the value it would bring.
Explain any alternatives considered and why they are not sufficient.

# How would you feel if this feature request was implemented?

_Share a gif from [giphy](https://giphy.com/) to tells us how you'd feel. Format: ![alt_text](https://media.giphy.com/media/xxx/giphy.gif)_

# Requirements

A list of requirements to consider this feature delivered
- Requirement 1
- Requirement 2
- ...

# Tasks

_To be filled in by the engineer picking up the issue_

- [ ] Task 1
- [ ] Task 2
- [ ] ...
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/subtask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Sub task
about: A sub task
title: ''
labels: subtask
assignees: ''

---

Required by <link to parent issue>

# Description

A clear and concise description of what this subtask is.

# Tasks

_To be filled in by the engineer picking up the subtask

- [ ] Task 1
- [ ] Task 2
- [ ] ...
38 changes: 38 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Purpose
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
* ...

## Does this introduce a breaking change?
<!-- Mark one with an "x". -->

- [ ] Yes
- [ ] No

<!-- Please prefix your PR title with one of the following:
* `feat`: A new feature
* `fix`: A bug fix
* `docs`: Documentation only changes
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* `refactor`: A code change that neither fixes a bug nor adds a feature
* `perf`: A code change that improves performance
* `test`: Adding missing tests or correcting existing tests
* `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* `chore`: Other changes that don't modify src or test files
* `revert`: Reverts a previous commit
* !: A breaking change is indicated with a `!` after the listed prefixes above, e.g. `feat!`, `fix!`, `refactor!`, etc.
-->

## Golden Path Validation
- [ ] I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

## Deployment Validation
- [ ] I have validated the deployment process successfully and all services are running as expected with this change.

## What to Check
Verify that the following are valid
* ...

## Other Information

<!-- Add any other helpful information that may be needed here. -->
22 changes: 22 additions & 0 deletions .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "PR Title Checker"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
merge_group:

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
if: ${{ github.event_name != 'merge_group' }}
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 20 additions & 24 deletions content-gen/src/app/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ import { ChatHistory } from './components/ChatHistory';
import type { ChatMessage, CreativeBrief, Product, GeneratedContent } from './types';
import ContosoLogo from './styles/images/contoso.svg';

interface UserInfo {
user_principal_id: string;
user_name: string;
auth_provider: string;
is_authenticated: boolean;
}


function App() {
const [conversationId, setConversationId] = useState<string>(() => uuidv4());
const [userId, setUserId] = useState<string>('');
const [userName, setUserName] = useState<string>('');
const [messages, setMessages] = useState<ChatMessage[]>([]);
const [isLoading, setIsLoading] = useState(false);
const [generationStatus, setGenerationStatus] = useState<string>('');
Expand Down Expand Up @@ -72,18 +66,32 @@ function App() {
fetchConfig();
}, []);

// Fetch current user on mount
// Fetch current user on mount - using /.auth/me (Azure App Service built-in auth endpoint)
useEffect(() => {
const fetchUser = async () => {
try {
const response = await fetch('/api/user');
const response = await fetch('/.auth/me');
if (response.ok) {
const user: UserInfo = await response.json();
setUserId(user.user_principal_id || 'anonymous');
const payload = await response.json();

// Extract user ID from objectidentifier claim
const userClaims = payload[0]?.user_claims || [];
const objectIdClaim = userClaims.find(
(claim: { typ: string; val: string }) =>
claim.typ === 'http://schemas.microsoft.com/identity/claims/objectidentifier'
);
setUserId(objectIdClaim?.val || 'anonymous');

// Extract display name from 'name' claim
const nameClaim = userClaims.find(
(claim: { typ: string; val: string }) => claim.typ === 'name'
);
setUserName(nameClaim?.val || '');
}
} catch (err) {
console.error('Error fetching user:', err);
setUserId('anonymous');
setUserName('');
}
};
fetchUser();
Expand Down Expand Up @@ -725,17 +733,6 @@ function App() {
}
}, [confirmedBrief, selectedProducts, conversationId]);

// Get user initials for avatar
const getUserInitials = () => {
if (!userId) return 'U';
// If we have a name, use first letter of first and last name
const parts = userId.split('@')[0].split('.');
if (parts.length >= 2) {
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
}
return userId[0].toUpperCase();
};

return (
<div className="app-container">
{/* Header */}
Expand Down Expand Up @@ -764,8 +761,7 @@ function App() {
/>
</Tooltip>
<Avatar
name={userId || 'User'}
initials={getUserInitials()}
name={userName || undefined}
color="colorful"
size={36}
/>
Expand Down
13 changes: 0 additions & 13 deletions content-gen/src/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ async def health_check():
})


# ==================== User Info Endpoint ====================

@app.route("/api/user", methods=["GET"])
async def get_current_user():
"""
Get the current authenticated user info.

Returns user details from EasyAuth headers, or empty values if not authenticated.
"""
user = get_authenticated_user()
return jsonify(user)


# ==================== Chat Endpoints ====================

@app.route("/api/chat", methods=["POST"])
Expand Down