diff --git a/.github/workflows/build-audit.yml b/.github/workflows/build-audit.yml index 35e4a82da4..164f6af302 100644 --- a/.github/workflows/build-audit.yml +++ b/.github/workflows/build-audit.yml @@ -2,27 +2,25 @@ name: Audit 3rd Party Libs on: - push: - branches: - - 'master' schedule: - cron: '0 9 * * 6' -env: - node_version: 18 - jobs: audit: runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['20.x'] steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 with: # fetch full history so things like auto-changelog work properly fetch-depth: 0 - - name: Use Node.js ${{ env.node_version }} - uses: actions/setup-node@v2-beta + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 with: - node-version: ${{ env.node_version }} + node-version: ${{ matrix.node-version }} + cache: 'npm' # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test-package.yml similarity index 86% rename from .github/workflows/build-test.yml rename to .github/workflows/build-test-package.yml index a517b5e323..4988a2f0ed 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test-package.yml @@ -1,4 +1,4 @@ -name: Integration Tests +name: Build, Test and Package on: pull_request: @@ -9,7 +9,7 @@ on: - master jobs: - Test: + test-n-package: runs-on: ubuntu-latest strategy: matrix: @@ -55,7 +55,7 @@ jobs: - name: Build App run: | - npm run build + npm run package - name: Run Docker run: | @@ -72,4 +72,9 @@ jobs: - name: Stop Docker run: | npm run ci-docker-test-down - \ No newline at end of file + + - name: Upload zip file + uses: actions/upload-artifact@v3 + with: + name: ChurchCRM-${{ steps.package-version.outputs.current-version}} + path: target/ChurchCRM-*.zip \ No newline at end of file diff --git a/.github/workflows/package-build.yml b/.github/workflows/package-build.yml deleted file mode 100644 index 20791bc03a..0000000000 --- a/.github/workflows/package-build.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Create A Release - -on: - push: - branches: - - 'master' - -env: - node_version: 18 - -jobs: - build_n_deploy: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['20.x'] - steps: - - uses: actions/checkout@v4 - with: - # fetch full history so things like auto-changelog work properly - fetch-depth: 0 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED - registry-url: 'https://registry.npmjs.org' - - - name: Install & Build Source - run: npm run deploy - - - name: Package - run: npm run package - - - uses: actions/upload-artifact@v3 - with: - name: ChurchCRM - path: target/ChurchCRM-*.zip \ No newline at end of file diff --git a/.github/workflows/poeditor.yml b/.github/workflows/poeditor.yml index 25b81dc6cf..98a016dd41 100644 --- a/.github/workflows/poeditor.yml +++ b/.github/workflows/poeditor.yml @@ -11,15 +11,19 @@ jobs: Download: runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['20.x'] steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 with: # fetch full history so things like auto-changelog work properly fetch-depth: 0 - - name: Use Node.js ${{ env.node_version }} - uses: actions/setup-node@v2-beta + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 with: - node-version: ${{ env.node_version }} + node-version: ${{ matrix.node-version }} + cache: 'npm' # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index abf71f08d6..844297498b 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -8,7 +8,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Create Release Notes uses: docker://decathlon/release-notes-generator-action:2.1.0 env: diff --git a/cypress/e2e/ui/standard/standard.calendar.spec.js b/cypress/e2e/ui/events/standard.calendar.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.calendar.spec.js rename to cypress/e2e/ui/events/standard.calendar.spec.js diff --git a/cypress/e2e/ui/standard/standard.events.spec.js b/cypress/e2e/ui/events/standard.events.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.events.spec.js rename to cypress/e2e/ui/events/standard.events.spec.js diff --git a/cypress/e2e/ui/standard/standard.group.spec.js b/cypress/e2e/ui/groups/standard.group.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.group.spec.js rename to cypress/e2e/ui/groups/standard.group.spec.js diff --git a/cypress/e2e/ui/standard/standard.sundayschool.spec.js b/cypress/e2e/ui/groups/standard.sundayschool.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.sundayschool.spec.js rename to cypress/e2e/ui/groups/standard.sundayschool.spec.js diff --git a/cypress/e2e/ui/standard/standard.family.spec.js b/cypress/e2e/ui/people/standard.family.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.family.spec.js rename to cypress/e2e/ui/people/standard.family.spec.js diff --git a/cypress/e2e/ui/standard/standard.members.del.spec.js b/cypress/e2e/ui/people/standard.members.del.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.members.del.spec.js rename to cypress/e2e/ui/people/standard.members.del.spec.js diff --git a/cypress/e2e/ui/standard/standard.person.list.spec.js b/cypress/e2e/ui/people/standard.person.list.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.person.list.spec.js rename to cypress/e2e/ui/people/standard.person.list.spec.js diff --git a/cypress/e2e/ui/standard/standard.person.new.spec.js b/cypress/e2e/ui/people/standard.person.new.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.person.new.spec.js rename to cypress/e2e/ui/people/standard.person.new.spec.js diff --git a/cypress/e2e/ui/standard/standard.reports.spec.js b/cypress/e2e/ui/reports/standard.reports.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.reports.spec.js rename to cypress/e2e/ui/reports/standard.reports.spec.js diff --git a/cypress/e2e/ui/standard/standard.user.password.spec.js b/cypress/e2e/ui/user/standard.user.password.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.user.password.spec.js rename to cypress/e2e/ui/user/standard.user.password.spec.js diff --git a/cypress/e2e/ui/standard/standard.user.settings.spec.js b/cypress/e2e/ui/user/standard.user.settings.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.user.settings.spec.js rename to cypress/e2e/ui/user/standard.user.settings.spec.js diff --git a/cypress/e2e/ui/standard/standard.user.spec.js b/cypress/e2e/ui/user/standard.user.spec.js similarity index 100% rename from cypress/e2e/ui/standard/standard.user.spec.js rename to cypress/e2e/ui/user/standard.user.spec.js diff --git a/src/ChurchCRM/utils/MiscUtils.php b/src/ChurchCRM/utils/MiscUtils.php index 3322320b3b..392f1eb355 100644 --- a/src/ChurchCRM/utils/MiscUtils.php +++ b/src/ChurchCRM/utils/MiscUtils.php @@ -58,8 +58,6 @@ public static function getRandomCache($baseCacheTime,$variability){ public static function getPhotoCacheExpirationTimestamp() { $cacheLength = SystemConfig::getValue("iPhotoClientCacheDuration"); $cacheLength = MiscUtils::getRandomCache($cacheLength,0.5*$cacheLength); - //echo time() + $cacheLength; - //die(); return time() + $cacheLength ; } diff --git a/src/api/routes/people/people-family.php b/src/api/routes/people/people-family.php index d739148c6a..ac4aaa3d73 100644 --- a/src/api/routes/people/people-family.php +++ b/src/api/routes/people/people-family.php @@ -15,9 +15,9 @@ $app->group('/family/{familyId:[0-9]+}', function () use ($app) { $app->get('/photo', function ($request, $response, $args) use ($app) { - $res = $app->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); + $this->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); $photo = new Photo("Family", $args['familyId']); - return $res->write($photo->getPhotoBytes())->withHeader('Content-type', $photo->getPhotoContentType()); + return $response->write($photo->getPhotoBytes())->withHeader('Content-type', $photo->getPhotoContentType()); }); $app->post('/photo', function ($request, $response, $args) { @@ -33,9 +33,9 @@ })->add(new EditRecordsRoleAuthMiddleware()); $app->get('/thumbnail', function ($request, $response, $args) use ($app) { - $res = $app->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); + $this->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); $photo = new Photo("Family", $args['familyId']); - return $res->write($photo->getThumbnailBytes())->withHeader('Content-type', $photo->getThumbnailContentType()); + return $response->write($photo->getThumbnailBytes())->withHeader('Content-type', $photo->getThumbnailContentType()); }); $app->get('', function ($request, $response, $args) { diff --git a/src/api/routes/people/people-person.php b/src/api/routes/people/people-person.php index 9873df3e12..bb1776e4ab 100644 --- a/src/api/routes/people/people-person.php +++ b/src/api/routes/people/people-person.php @@ -14,27 +14,27 @@ // This group does not load the person via middleware (to speed up the page loads) $app->group('/person/{personId:[0-9]+}', function () use ($app) { - $app->get('/thumbnail', function ($request, $response, $args) use ($app) { - $res = $app->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); + $app->get('/thumbnail', function (Request $request, Response $response, array $args) use ($app) { + $this->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); $photo = new Photo("Person", $args['personId']); - return $res->write($photo->getThumbnailBytes())->withHeader('Content-type', $photo->getThumbnailContentType()); + return $response->write($photo->getThumbnailBytes())->withHeader('Content-type', $photo->getThumbnailContentType()); }); - $app->get('/photo', function ($request, $response, $args) use ($app) { - $res = $app->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); + $app->get('/photo', function (Request $request, Response $response, array $args) use ($app) { + $this->cache->withExpires($response, MiscUtils::getPhotoCacheExpirationTimestamp()); $photo = new Photo("Person", $args['personId']); - return $res->write($photo->getPhotoBytes())->withHeader('Content-type', $photo->getPhotoContentType()); + return $response->write($photo->getPhotoBytes())->withHeader('Content-type', $photo->getPhotoContentType()); }); }); $app->group('/person/{personId:[0-9]+}', function () use ($app) { - $app->get('', function ($request, $response, $args) { + $app->get('', function (Request $request, Response $response, array $args) { $person = $request->getAttribute("person"); return $response->withHeader('Content-Type', 'application/json')->write($person->exportTo('JSON')); }); - $app->delete('', function ($request, $response, $args) { + $app->delete('', function (Request $request, Response $response, array $args) { $person = $request->getAttribute("person"); if (AuthenticationManager::GetCurrentUser()->getId() == $person->getId()) { return $response->withStatus(403, gettext("Can't delete yourself")); @@ -45,18 +45,18 @@ $app->post('/role/{roleId:[0-9]+}', 'setPersonRoleAPI')->add(new EditRecordsRoleAuthMiddleware()); - $app->post('/addToCart', function ($request, $response, $args) { + $app->post('/addToCart', function (Request $request, Response $response, array $args) { Cart::AddPerson($args['personId']); }); - $app->post('/photo', function ($request, $response, $args) { + $app->post('/photo', function (Request $request, Response $response, array $args) { $person = $request->getAttribute("person"); $input = (object)$request->getParsedBody(); $person->setImageFromBase64($input->imgBase64); $response->withJson(["status" => "success"]); })->add(new EditRecordsRoleAuthMiddleware()); - $app->delete('/photo', function ($request, $response, $args) { + $app->delete('/photo', function (Request $request, Response $response, array $args) { $person = $request->getAttribute("person"); return $response->withJson(['success' => $person->deletePhoto()]); })->add(new DeleteRecordRoleAuthMiddleware());