Merge branch 'main' into create-chat-button-edits
This commit is contained in:
commit
3ab2d5e7ca
4 changed files with 75 additions and 15 deletions
34
.github/workflows/issue_closed.yaml
vendored
34
.github/workflows/issue_closed.yaml
vendored
|
|
@ -17,3 +17,37 @@ jobs:
|
|||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
- name: Get project ID from project number
|
||||
id: get_project_id
|
||||
run: |
|
||||
PROJECT_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { projectV2(number: 1) { id } } }' --jq '.data.repository.projectV2.id')
|
||||
echo "PROJECT_ID=$PROJECT_ID" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get item ID for issue in project
|
||||
id: get_item_id
|
||||
run: |
|
||||
ITEM_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { issue(number: ${{ github.event.issue.number }}) { projectItems(first: 10) { nodes { id project { id } } } } }' --jq '.data.repository.issue.projectItems.nodes[] | select(.project.id==env.PROJECT_ID) | .id')
|
||||
echo "ITEM_ID=$ITEM_ID" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get status field and Done option IDs
|
||||
id: get_status_ids
|
||||
run: |
|
||||
STATUS_FIELD_ID=$(gh api graphql -f query='query { node(id: "'$PROJECT_ID'") { ... on ProjectV2 { fields(first: 20) { nodes { id name } } } } }' --jq '.data.node.fields.nodes[] | select(.name=="Status") | .id')
|
||||
DONE_OPTION_ID=$(gh api graphql -f query='query { node(id: "'$STATUS_FIELD_ID'") { ... on ProjectV2Field { options { id name } } } }' --jq '.data.node.options[] | select(.name=="Done") | .id')
|
||||
echo "STATUS_FIELD_ID=$STATUS_FIELD_ID" >> $GITHUB_ENV
|
||||
echo "DONE_OPTION_ID=$DONE_OPTION_ID" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Set status to Done in project
|
||||
run: |
|
||||
gh api graphql -f query='mutation($project:ID!, $item:ID!, $field:ID!, $option:ID!) { updateProjectV2ItemFieldValue(input: {projectId: $project, itemId: $item, fieldId: $field, value: { singleSelectOptionId: $option } }) { projectV2Item { id } } }' -f project=$PROJECT_ID -f item=$ITEM_ID -f field=$STATUS_FIELD_ID -f option=$DONE_OPTION_ID
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PROJECT_ID: ${{ env.PROJECT_ID }}
|
||||
ITEM_ID: ${{ env.ITEM_ID }}
|
||||
STATUS_FIELD_ID: ${{ env.STATUS_FIELD_ID }}
|
||||
DONE_OPTION_ID: ${{ env.DONE_OPTION_ID }}
|
||||
# To get your project, field, and option IDs, see the instructions in the new issue_opened_project.yaml file.
|
||||
# You must replace the placeholders with your actual project and field IDs.
|
||||
|
|
|
|||
24
.github/workflows/issue_opened_project.yaml
vendored
Normal file
24
.github/workflows/issue_opened_project.yaml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Auto-add new issues to a GitHub project (replace PROJECT_ID and COLUMN_ID with your values)
|
||||
name: Add new issues to project
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
jobs:
|
||||
add_to_project:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project ID from project number
|
||||
id: get_project_id
|
||||
run: |
|
||||
PROJECT_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { projectV2(number: 1) { id } } }' --jq '.data.repository.projectV2.id')
|
||||
echo "PROJECT_ID=$PROJECT_ID" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Add issue to project
|
||||
run: |
|
||||
gh api graphql -f query='mutation($project:ID!, $contentId:ID!) { addProjectV2ItemById(input: {projectId: $project, contentId: $contentId}) { item { id } } }' -f project=$PROJECT_ID -f contentId=$ISSUE_ID
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
# To get your project ID, use: gh api graphql -f query='query { organization(login: "<ORG>") { projectV2(number: <PROJECT_NUMBER>) { id } } }'
|
||||
|
|
@ -624,7 +624,7 @@ class RoomDetailsButton extends StatelessWidget {
|
|||
: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
padding: EdgeInsets.all(mini ? 6 : 12.0),
|
||||
child: mini
|
||||
? buttonDetails.icon
|
||||
: Column(
|
||||
|
|
|
|||
|
|
@ -296,13 +296,14 @@ class MessageTokenButtonContent extends StatelessWidget {
|
|||
BorderRadius.circular(AppConfig.borderRadius - 4);
|
||||
|
||||
Color _color(BuildContext context) {
|
||||
if (activity == null) {
|
||||
return Theme.of(context).colorScheme.primary;
|
||||
}
|
||||
if (isActivityCompleteOrNullForToken) {
|
||||
return AppConfig.gold;
|
||||
}
|
||||
return Theme.of(context).colorScheme.primary;
|
||||
final bool isLight = Theme.of(context).brightness == Brightness.light;
|
||||
final defaultColor = isLight
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.primaryContainer;
|
||||
|
||||
return activity != null && isActivityCompleteOrNullForToken
|
||||
? AppConfig.gold
|
||||
: defaultColor;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -377,6 +378,8 @@ class MessageTokenButtonContent extends StatelessWidget {
|
|||
(selectedChoice != null ? 0.4 : 0.0) +
|
||||
(accepted.isNotEmpty ? 0.3 : 0.0);
|
||||
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return InkWell(
|
||||
onTap: selectedChoice != null
|
||||
? () => onMatch?.call(selectedChoice!)
|
||||
|
|
@ -384,10 +387,11 @@ class MessageTokenButtonContent extends StatelessWidget {
|
|||
borderRadius: _borderRadius,
|
||||
child: CustomPaint(
|
||||
painter: DottedBorderPainter(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
.withAlpha((colorAlpha * 255).toInt()),
|
||||
color: theme.brightness == Brightness.light
|
||||
? theme.colorScheme.primary
|
||||
.withAlpha((colorAlpha * 255).toInt())
|
||||
: theme.colorScheme.primaryContainer
|
||||
.withAlpha((colorAlpha * 255).toInt()),
|
||||
borderRadius: _borderRadius,
|
||||
),
|
||||
child: Container(
|
||||
|
|
@ -396,9 +400,7 @@ class MessageTokenButtonContent extends StatelessWidget {
|
|||
width: max(width, 24.0),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
color: theme.colorScheme.primary
|
||||
.withAlpha((max(0, colorAlpha - 0.7) * 255).toInt()),
|
||||
borderRadius: _borderRadius,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue