Skip to content

Commit

Permalink
add register call to action
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni009 committed Dec 30, 2023
1 parent 6371d7f commit 9667cd2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 22 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
target-branch: 'dev'
schedule:
interval: 'weekly'
10 changes: 5 additions & 5 deletions .github/workflows/announcements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
schedule:
# the time here is kinda random to dodge high load time on GH that may block cron jobs
# if cron jobs are delayed for too long, they might be dropped -> bad
- cron: '43 4 1 1 *'
- cron: '20 0 1 1 *'
# - cron: '43 4 1 2 *'
- cron: '43 4 29 1 *'
- cron: '20 0 29 1 *'

jobs:
set-visibility:
Expand All @@ -17,7 +17,7 @@ jobs:
steps:
# set to public at the start of the year
- name: 'Show Repo'
if: github.event.schedule == '43 4 1 1 *'
if: github.event.schedule == '20 0 1 1 *'
run: gh repo edit ${{ github.repository }} --visibility public
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand All @@ -43,13 +43,13 @@ jobs:

- name: 'Send Announcement'
run: |
if [ "${{github.event.schedule}}" == '43 4 1 1 *' ]
if [ "${{github.event.schedule}}" == '20 0 1 1 *' ]
then
message='The Census has reset! Renew your citizen status now: https://lenni009.github.io/Eisvana-Census-Renew/'
elif [ "${{github.event.schedule}}" == '43 4 1 2 *' ]
then
message='The Census Renewal Website has closed! It will reopen next year on the 1st of January. Contact Lenni if you want to renew your entry.'
elif [ "${{github.event.schedule}}" == '43 4 29 1 *' ]
elif [ "${{github.event.schedule}}" == '20 0 29 1 *' ]
then
message='Non-renewed citizens will lose the citizen role in 3 days. Renew your status now: https://lenni009.github.io/Eisvana-Census-Renew/'
fi
Expand Down
43 changes: 26 additions & 17 deletions src/components/UserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const query = {
limit: '500',
tables: 'Bases',
fields: ['Name', 'CensusPlayer', 'CensusRenewal'],
civilized,
where: `CensusShow IS NOT NULL AND Civilized="${civilized}"`,
orderBy: 'CensusRenewal',
};
Expand Down Expand Up @@ -75,27 +74,32 @@ function incrementData(userName: string) {
localStorage.setItem(currentYear, localStorageDataString);
}
const maximumAllowedTries = 3;
watchEffect(() => {
if (tries.value >= 3) emit('exceeded');
if (tries.value >= maximumAllowedTries) emit('exceeded');
});
</script>

<template>
<div
v-if="censusData.length"
class="table"
>
<UserRow
v-for="dataObj in filteredCensusData"
:already-requested="getLocalStorageSet().has(dataObj.title.CensusPlayer)"
:current-year="currentYear"
:key="dataObj.title.CensusPlayer"
:tries="tries"
:user-object="dataObj"
@renew="incrementData"
/>
</div>

<template v-if="censusData.length">
<div class="table">
<UserRow
v-for="dataObj in filteredCensusData"
:already-requested="getLocalStorageSet().has(dataObj.title.CensusPlayer)"
:current-year="currentYear"
:key="dataObj.title.CensusPlayer"
:tries="tries"
:user-object="dataObj"
@renew="incrementData"
/>
</div>
<div
v-if="!filteredCensusData.length"
class="register-cta"
>
Not on the census?<br /><a href="https://forms.gle/A85N3NkYXkM5XXjx5">Register now!</a>
</div>
</template>
<div
v-else-if="!requestFailed"
aria-busy="true"
Expand All @@ -110,4 +114,9 @@ watchEffect(() => {
grid-template-columns: repeat(2, auto);
align-items: center;
}
.register-cta {
text-align: center;
font-size: 1.5rem;
}
</style>

0 comments on commit 9667cd2

Please sign in to comment.