Skip to content

Commit

Permalink
Merge pull request #284 from rimorin/staging
Browse files Browse the repository at this point in the history
Staging -> Master
  • Loading branch information
rimorin authored May 3, 2024
2 parents a749bdd + f98b687 commit 6059fa2
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/mm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,26 @@ jobs:
}
]
}
publish_chromatic:
name: Publish to chromatic
if: github.event_name == 'pull_request' && github.base_ref == 'master'
needs: verify
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
# publish_chromatic:
# name: Publish to chromatic
# if: github.event_name == 'pull_request' && github.base_ref == 'master'
# needs: verify
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# - name: Install dependencies
# run: npm ci
# - name: Publish to Chromatic
# uses: chromaui/action@v1
# with:
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# exitZeroOnChanges: true
staging_deployment:
name: Deploy to Staging
if: contains(github.event_name, 'push') && contains(github.ref, 'refs/heads/staging')
Expand Down
35 changes: 29 additions & 6 deletions src/pages/dashboard/admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,22 @@ function Admin({ user }: adminProps) {
congregation: code,
territoryCode: selectedTerritoryCode
}
).then((updatedCode) =>
processSelectedTerritory(updatedCode as string)
)
).then((updatedCode) => {
processSelectedTerritory(updatedCode as string);
const updatedTerritories = new Map();
for (const [key, value] of territories) {
if (key === selectedTerritoryCode && value) {
value.code = updatedCode as string;
updatedTerritories.set(
updatedCode as string,
value
);
} else {
updatedTerritories.set(key, value);
}
}
setTerritories(updatedTerritories);
})
}
>
Change Code
Expand Down Expand Up @@ -1041,9 +1054,19 @@ function Admin({ user }: adminProps) {
territoryCode: selectedTerritoryCode,
name: selectedTerritoryName
}
).then((updatedName) =>
setSelectedTerritoryName(updatedName as string)
)
).then((updatedName) => {
setSelectedTerritoryName(updatedName as string);
setTerritories(
new Map<string, territoryDetails>(
Array.from(territories).map(([key, value]) => {
if (key === selectedTerritoryCode) {
value.name = updatedName as string;
}
return [key, value];
})
)
);
})
}
>
Edit Current Name
Expand Down

0 comments on commit 6059fa2

Please sign in to comment.