Skip to content

Commit

Permalink
Merge pull request #2588 from Leantime/fixesFromCore
Browse files Browse the repository at this point in the history
Fixes from core
  • Loading branch information
marcelfolaron authored Jul 25, 2024
2 parents 9f83779 + b300219 commit 34a98b5
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 89 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ jobs:
changelog_filename: CHANGELOG.md
release_version: ${{ steps.version.outputs.version }}
config_file: .github/workflows/changelogConfig.yml
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Repo Attributes
id: attrs
uses: ibnesayeed/repo-attrs@master
- name: release
uses: ncipollo/release-action@v1
id: create_release
Expand All @@ -44,7 +47,24 @@ jobs:
tag: v${{ steps.version.outputs.version }}
generateReleaseNotes: false
makeLatest: true
body: ${{ steps.changelog_ci.outputs.changelog }}
body: |
## Changes in this Release
History from `${{ steps.attrs.outputs.tail }}` to `${{ steps.attrs.outputs.head }}`
### Commits
${{ steps.attrs.outputs.commits }}
### Contributors
${{ steps.attrs.outputs.contributors }}
### Files
```
${{ steps.attrs.outputs.files }}
```
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload zip
Expand Down
2 changes: 2 additions & 0 deletions .idea/leantime-oss.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/Core/AppSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppSettings
public string $appVersion = "3.2.0-beta-2";


public string $dbVersion = "3.0.2";
public string $dbVersion = "3.0.3";

/**
* __construct
Expand Down
13 changes: 8 additions & 5 deletions app/Core/Fileupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ public function displayImageFile(string $imageName, string $fullPath = ''): Resp
);

$responseFailure = new Response(file_get_contents(ROOT . '/dist/images/doc.png'));
$sLastModified = filemtime(ROOT . '/dist/images/doc.png');
$responseFailure->headers->set('Content-Type', 'image/png');
$responseFailure->headers->set("Cache-Control", 'max-age=86400');
$responseFailure->headers->set("Last-Modified", gmdate("D, d M Y H:i:s", $sLastModified) . " GMT");

if ($this->config->useS3 && $fullPath == '') {
try {
Expand All @@ -392,11 +395,11 @@ public function displayImageFile(string $imageName, string $fullPath = ''): Resp

foreach (
[
'Content-Type' => $result['ContentType'],
'Pragma' => 'public',
'Cache-Control' => 'max-age=86400',
'Expires' => gmdate('D, d M Y H:i:s \G\M\T', time() + 86400),
'Content-disposition' => 'inline; filename="' . $imageName . '";',
'Content-Type' => $result['ContentType'],
'Pragma' => 'public',
'Cache-Control' => 'max-age=86400',
'Expires' => gmdate('D, d M Y H:i:s \G\M\T', time() + 86400),
'Content-disposition' => 'inline; filename="' . $imageName . '";',
] as $header => $value
) {
$response->headers->set($header, $value);
Expand Down
15 changes: 9 additions & 6 deletions app/Core/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,10 @@ public function displayNotification(): string
if (session()->exists("confettiInYourFace") && session("confettiInYourFace") === true) {
$notification .= app('blade.compiler')::render(
'<script type="text/javascript">confetti({
spread: 70,
origin: { y: 1.2 },
});
spread: 70,
origin: { y: 1.2 },
disableForReducedMotion: true
});
</script>',
[]
);
Expand Down Expand Up @@ -759,9 +760,11 @@ public function displayInlineNotification(): string
if (session()->exists("confettiInYourFace") && session("confettiInYourFace") === true) {
$notification .= app('blade.compiler')::render(
'<script type="text/javascript">confetti({
spread: 70,
origin: { y: 1.2 },
});</script>',
spread: 70,
origin: { y: 1.2 },
disableForReducedMotion: true
});
</script>',
[]
);

Expand Down
4 changes: 2 additions & 2 deletions app/Core/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ public function setActive(string $id): void
{

if ($id == '') {
$id = 'default';
$id = static::DEFAULT;
}

//not a valid theme. Use default
if (!is_dir(ROOT . '/theme/' . $id) || !file_exists(ROOT . '/theme/' . $id . '/' . static::DEFAULT_INI . '.ini')) {
$id = 'default';
$id = static::DEFAULT;
}

//Only set if user is logged in
Expand Down
12 changes: 12 additions & 0 deletions app/Domain/Connector/Models/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,40 @@
*/
class Integration
{
#[DbColumn('id')]
public int $id;

#[DbColumn('providerId')]
public ?string $providerId;

#[DbColumn('method')]
public ?string $method;

#[DbColumn('entity')]
public ?string $entity;

#[DbColumn('fields')]
public ?string $fields;

#[DbColumn('schedule')]
public ?string $schedule;

#[DbColumn('notes')]
public ?string $notes;

#[DbColumn('auth')]
public ?string $auth;

#[DbColumn('meta')]
public ?string $meta;

#[DbColumn('createdOn')]
public ?string $createdOn;

#[DbColumn('createdBy')]
public ?string $createdBy;

#[DbColumn('lastSync')]
public ?string $lastSync;


Expand Down
2 changes: 1 addition & 1 deletion app/Domain/CsvImport/Services/CsvImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct()
$this->id = "csv_importer";
$this->name = "CSV Import";
$this->image = "/dist/images/svg/csv-icon.svg";
$this->description = "Impport data from a CSV file. To learn more about the CSV format, please visit our <a href='https://support.leantime.io/support/solutions/articles/154000063304-importing-data-via-csv' target='_blank'>documentation</a>";
$this->description = "Impport data from a CSV file. To learn more about the CSV format, please visit our <a href='https://support.leantime.io/en/article/importing-data-via-csv-1v941gy' target='_blank'>documentation</a>";

$this->methods[] = "import, update";

Expand Down
1 change: 1 addition & 0 deletions app/Domain/Help/Js/helperController.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ leantime.helperController = (function () {
confetti({
spread: 70,
origin: { y: 1.2 },
disableForReducedMotion: true
});
}
},
Expand Down
4 changes: 2 additions & 2 deletions app/Domain/Help/Services/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public function getFirstLoginSteps(): array
{

$steps = array(
0 => array("class" => "Leantime\Domain\Help\Services\ProjectIntroStep", "next" => 10),
10 => array("class" => "Leantime\Domain\Help\Services\ProjectDefinitionStep", "next" => 20),
0 => array("class" => "Leantime\Domain\Help\Services\ProjectIntroStep", "next" => 20),
//10 => array("class" => "Leantime\Domain\Help\Services\ProjectDefinitionStep", "next" => 20),
20 => array("class" => "Leantime\Domain\Help\Services\InviteTeamStep", "next" => "end"),
);

Expand Down
32 changes: 32 additions & 0 deletions app/Domain/Install/Repositories/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class Install
20406,
20407,
30002,
30003,
);

/**
Expand Down Expand Up @@ -386,6 +387,7 @@ private function sqlPrep(): string
`projectId` INT NULL,
`type` VARCHAR(45) NULL,
`description` TEXT,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ProjectIdType` (`projectId` ASC, `type` ASC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Expand Down Expand Up @@ -459,6 +461,7 @@ private function sqlPrep(): string
`published` int(1) DEFAULT NULL,
`age` int(3) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Expand Down Expand Up @@ -606,6 +609,7 @@ private function sqlPrep(): string
`retrospectiveid` INT NULL,
`ideaid` INT NULL,
`zp_ticketscol` VARCHAR(45) NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ProjectUserId` (`projectId`,`userId`),
KEY `StatusSprint` (`status`,`sprint`),
Expand All @@ -630,6 +634,7 @@ private function sqlPrep(): string
`rate` varchar(255) DEFAULT NULL,
`paid` int(2) DEFAULT NULL,
`paidDate` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `Unique` (`userId`,`ticketId`,`workDate`,`kind`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Expand Down Expand Up @@ -680,6 +685,7 @@ private function sqlPrep(): string
`name` VARCHAR(45) NULL,
`startDate` DATETIME NULL,
`endDate` DATETIME NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Expand Down Expand Up @@ -1922,6 +1928,32 @@ public function update_sql_30002(): bool|array {
}
}

return true;
}

public function update_sql_30003(): bool|array {

$errors = array();

$sql = [
"ALTER TABLE `zp_canvas` ADD COLUMN `modified` datetime NULL DEFAULT NULL",
"ALTER TABLE `zp_clients` ADD COLUMN `modified` datetime NULL DEFAULT NULL",
"ALTER TABLE `zp_sprints` ADD COLUMN `modified` datetime NULL DEFAULT NULL",
"ALTER TABLE `zp_projects` ADD COLUMN `modified` datetime NULL DEFAULT NULL",
"ALTER TABLE `zp_timesheets` ADD COLUMN `modified` datetime NULL DEFAULT NULL",
"ALTER TABLE `zp_tickets` ADD COLUMN `modified` datetime NULL DEFAULT NULL",
];

foreach ($sql as $statement) {
try {
$stmn = $this->database->prepare($statement);
$stmn->execute();
} catch (PDOException $e) {
//Just swallow your pride
//One day we'll get ALTER IF EXISTS
}
}


return true;

Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Users/Repositories/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function getAll($activeOnly = false): array
jobTitle,
jobLevel,
department,
modified
zp_user.modified
FROM `zp_user`
LEFT JOIN zp_clients ON zp_clients.id = zp_user.clientId
WHERE !(source <=> 'api')";
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ parameters:
- config
ignoreErrors:
# Rules for level 1. Templates use variables through include which are not detected by phpstan
#-
# messages:
# - '#Variable \$tpl might not be defined\.#'
-
messages:
- '#Attribute class Leantime\\Domain\\Connector\\Models\\DbColumn does not exist\.#'
# - '#Variable \$__data might not be defined\.#'
# - '#Constant BASE_URL not found\.#'
# - '#Constant CURRENT_URL not found\.#'
Expand Down
2 changes: 1 addition & 1 deletion public/assets/css/components/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ body {
top: 0px;
width: 100%;
background-size:cover;
background-image:url(/dist/images/backgrounds/bg1.png);
background-image:url(/dist/images/backgrounds/bg5.png);
background-repeat:no-repeat;
background-position:center;
}
Expand Down
9 changes: 7 additions & 2 deletions public/assets/js/app/core/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ leantime.modals = (function () {
tippy('[data-tippy-content]');
},
beforeClose: function () {
history.pushState("", document.title, window.location.pathname + window.location.search);
console.log(window.globalModalCallback);
try{
history.pushState("", document.title, window.location.pathname + window.location.search);

}catch(error){
//Code to handle error comes here
console.log("Issue pushing history");
}

if(typeof window.globalModalCallback === 'function') {
window.globalModalCallback();
Expand Down
Loading

0 comments on commit 34a98b5

Please sign in to comment.