-
Notifications
You must be signed in to change notification settings - Fork 2
[CORE-8130] 2.4.y/project brief #2656
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
Open
trtshen
wants to merge
10
commits into
prerelease
Choose a base branch
from
2.4.y/CORE-8130/project-brief
base: prerelease
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
07fe1d1
[CORE-8130] initial-flow-design
trtshen cdb1775
[CORE-8130] projectbrief-workflow
trtshen 87d4950
[CORE-8130] featuretoggle: projecthub
trtshen 30a1a54
[CORE-8130] update project brief logic in home page
trtshen 6909a45
[CORE-8130] fixed unresponsive click
trtshen 8c61760
[CORE-8148] client's review projectbrief
trtshen fc31650
Merge remote-tracking branch 'origin/release/live' into 2.4.y/CORE-81…
trtshen 1d07a57
Merge remote-tracking branch 'origin/prerelease' into 2.4.y/CORE-8130…
trtshen 990eec0
Merge remote-tracking branch 'origin/prerelease' into 2.4.y/CORE-8148…
trtshen 14a7827
Merge pull request #2619 from intersective/2.4.y/CORE-8148/client-pro…
trtshen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,255 @@ | ||
| # Project Brief Feature | ||
|
|
||
| ## Overview | ||
|
|
||
| The Project Brief feature displays team project information to users on the home page. When a user's team has a project brief configured, a "Project Brief" button appears next to the experience name. Clicking this button opens a modal that displays structured project details. | ||
|
|
||
| ## Data Flow | ||
|
|
||
| ``` | ||
| GraphQL API (teams.projectBrief as stringified JSON) | ||
| ↓ | ||
| SharedService.getTeamInfo() | ||
| ↓ parseProjectBrief() - safely parses JSON | ||
| BrowserStorageService.setUser({ projectBrief: parsedObject }) | ||
| ↓ | ||
| HomePage.updateDashboard() | ||
| ↓ reads from storage | ||
| this.projectBrief = this.storageService.getUser().projectBrief | ||
| ↓ | ||
| Template: *ngIf="projectBrief" shows button | ||
| ↓ | ||
| showProjectBrief() → opens ProjectBriefModalComponent | ||
| ``` | ||
|
|
||
| ## Components | ||
|
|
||
| ### ProjectBriefModalComponent | ||
|
|
||
| **Location:** `projects/v3/src/app/components/project-brief-modal/` | ||
|
|
||
| **Files:** | ||
| - `project-brief-modal.component.ts` - Component logic | ||
| - `project-brief-modal.component.html` - Template with sections for each field | ||
| - `project-brief-modal.component.scss` - Component-specific styles | ||
| - `project-brief-modal.component.spec.ts` - Unit tests | ||
|
|
||
| **Input:** | ||
| ```typescript | ||
| @Input() projectBrief: ProjectBrief = {}; | ||
| ``` | ||
|
|
||
| **Interface:** | ||
| ```typescript | ||
| interface ProjectBrief { | ||
| id?: string; | ||
| title?: string; | ||
| description?: string; | ||
| industry?: string[]; | ||
| projectType?: string; | ||
| technicalSkills?: string[]; | ||
| professionalSkills?: string[]; | ||
| deliverables?: string; | ||
| } | ||
| ``` | ||
|
|
||
| **Display Sections:** | ||
| - Title (headline) | ||
| - Description | ||
| - Project Type | ||
| - Industry (as chips) | ||
| - Technical Skills (as chips) | ||
| - Professional Skills (as chips) | ||
| - Deliverables | ||
|
|
||
| **Empty Field Handling:** | ||
| - All sections show "None specified" when the field is empty or undefined | ||
| - Uses `hasValue()` for string fields and `hasItems()` for array fields | ||
|
|
||
| ## Integration Points | ||
|
|
||
| ### SharedService | ||
|
|
||
| **Method:** `parseProjectBrief(briefString: string): object | null` | ||
|
|
||
| Safely parses the stringified JSON from the API: | ||
| - Returns `null` if input is falsy or not a string | ||
| - Uses try-catch to handle malformed JSON | ||
| - Logs errors to console for debugging | ||
|
|
||
| **Usage in getTeamInfo():** | ||
| ```typescript | ||
| this.storage.setUser({ | ||
| teamId: teams[0].id, | ||
| teamName: teams[0].name, | ||
| projectBrief: this.parseProjectBrief(teams[0].projectBrief), | ||
| teamUuid: teams[0].uuid | ||
| }); | ||
| ``` | ||
|
|
||
| ### HomePage | ||
|
|
||
| **Property:** | ||
| ```typescript | ||
| projectBrief: ProjectBrief | null = null; | ||
| ``` | ||
|
|
||
| **Loading (in updateDashboard):** | ||
| ```typescript | ||
| this.projectBrief = this.storageService.getUser().projectBrief || null; | ||
| ``` | ||
|
|
||
| **Modal Display:** | ||
| ```typescript | ||
| async showProjectBrief(): Promise<void> { | ||
| if (!this.projectBrief) { | ||
| return; | ||
| } | ||
|
|
||
| const modal = await this.modalController.create({ | ||
| component: ProjectBriefModalComponent, | ||
| componentProps: { | ||
| projectBrief: this.projectBrief | ||
| }, | ||
| cssClass: 'project-brief-modal' | ||
| }); | ||
|
|
||
| await modal.present(); | ||
| } | ||
| ``` | ||
|
|
||
| ### Template (home.page.html) | ||
|
|
||
| Button placement - next to experience name: | ||
| ```html | ||
| <div class="exp-header"> | ||
| <h2 class="headline-2" [innerHTML]="experience.name"></h2> | ||
| <ion-button *ngIf="projectBrief" | ||
| fill="clear" | ||
| size="small" | ||
| class="project-brief-btn" | ||
| (click)="showProjectBrief()" | ||
| (keydown.enter)="showProjectBrief()" | ||
| (keydown.space)="showProjectBrief(); $event.preventDefault()" | ||
| aria-label="View project brief" i18n-aria-label> | ||
| <ion-icon name="document-text-outline" slot="start" aria-hidden="true"></ion-icon> | ||
| <span i18n>Project Brief</span> | ||
| </ion-button> | ||
| </div> | ||
| ``` | ||
|
|
||
| ## Styling | ||
|
|
||
| ### Button (home.page.scss) | ||
|
|
||
| ```scss | ||
| .exp-header { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| align-items: center; | ||
| gap: 8px; | ||
| } | ||
|
|
||
| .project-brief-btn { | ||
| --padding-start: 8px; | ||
| --padding-end: 8px; | ||
| font-size: 0.875rem; | ||
| text-transform: none; | ||
| letter-spacing: normal; | ||
| } | ||
| ``` | ||
|
|
||
| ### Modal (styles.scss) | ||
|
|
||
| ```scss | ||
| .project-brief-modal { | ||
| --width: 90%; | ||
| --max-width: 500px; | ||
| --height: auto; | ||
| --max-height: 80vh; | ||
| --border-radius: 12px; | ||
|
|
||
| @media (min-width: 768px) { | ||
| --width: 500px; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Accessibility | ||
|
|
||
| - Button includes `aria-label="View project brief"` with i18n support | ||
| - Keyboard navigation with `(keydown.enter)` and `(keydown.space)` handlers | ||
| - Modal has proper semantic structure with `<main>`, `<section>`, and heading hierarchy | ||
| - Close button includes `aria-label="Close project brief"` | ||
| - Ion-chips for industry/skills are visually distinct with color coding | ||
|
|
||
| ## Sample Data | ||
|
|
||
| API returns stringified JSON: | ||
| ```json | ||
| "{\"id\":\"fdcdf0d1-2148-4bab-a02a-62a2ae535fbe\",\"title\":\"Project Title\",\"description\":\"Project description text\",\"industry\":[\"Health & Medical Science\",\"Communications, Media, Digital & Creative\"],\"projectType\":\"Growth Strategy\",\"technicalSkills\":[],\"professionalSkills\":[],\"deliverables\":\"Deliverables description\",\"timeline\":12}" | ||
| ``` | ||
|
|
||
| After parsing: | ||
| ```typescript | ||
| { | ||
| id: "fdcdf0d1-2148-4bab-a02a-62a2ae535fbe", | ||
| title: "Project Title", | ||
| description: "Project description text", | ||
| industry: ["Health & Medical Science", "Communications, Media, Digital & Creative"], | ||
| projectType: "Growth Strategy", | ||
| technicalSkills: [], | ||
| professionalSkills: [], | ||
| deliverables: "Deliverables description", | ||
| timeline: 12 | ||
| } | ||
| ``` | ||
|
|
||
| **Note:** The `timeline` field is not displayed in the UI as per requirements. | ||
|
|
||
| ## Testing | ||
|
|
||
| ### Unit Tests | ||
|
|
||
| **ProjectBriefModalComponent tests:** | ||
| - Component creation | ||
| - `close()` method dismisses modal | ||
| - `hasItems()` correctly identifies empty/populated arrays | ||
| - `hasValue()` correctly identifies empty/populated strings | ||
| - Template renders title when provided | ||
| - Template shows "None specified" for empty fields | ||
| - Template renders chips for industry and skills | ||
|
|
||
| **HomePage tests (additions needed):** | ||
| - Button visible when `projectBrief` is set | ||
| - Button hidden when `projectBrief` is null | ||
| - `showProjectBrief()` creates and presents modal | ||
|
|
||
| **SharedService tests (additions needed):** | ||
| - `parseProjectBrief()` returns parsed object for valid JSON | ||
| - `parseProjectBrief()` returns null for invalid JSON | ||
| - `parseProjectBrief()` returns null for empty string | ||
| - `parseProjectBrief()` returns null for null/undefined input | ||
|
|
||
| ## Module Registration | ||
|
|
||
| The component is registered in `ComponentsModule`: | ||
|
|
||
| ```typescript | ||
| // Import | ||
| import { ProjectBriefModalComponent } from './project-brief-modal/project-brief-modal.component'; | ||
|
|
||
| // Declarations | ||
| declarations: [ | ||
| // ... | ||
| ProjectBriefModalComponent, | ||
| // ... | ||
| ], | ||
|
|
||
| // Exports | ||
| exports: [ | ||
| // ... | ||
| ProjectBriefModalComponent, | ||
| // ... | ||
| ], | ||
| ``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shawnm0705 @Sunilsbcloud do we need setup "prerelease" version of project-hub? or just use back stage?