Compare commits

...

3 Commits

Author SHA1 Message Date
Prabhat Khera
f65698cae3 fix(ui): show pull and reploy button for docker git repo 2021-10-14 17:59:25 +13:00
ArrisLee
0fb2278fe4 Merge branch 'develop' of github.com:portainer/portainer into feat/EE-1611/support-enforced-deployment-from-git 2021-10-12 12:39:37 +13:00
Prabhat Khera
fc74e732e4 feat(ui): add enforce update toggle in git deployment (#5860)
add force redeployment BE feature flag and corrected the label
2021-10-11 14:07:20 +13:00
5 changed files with 17 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
import { FORCE_REDEPLOYMENT } from '@/portainer/feature-flags/feature-ids';
class GitFormAutoUpdateFieldsetController {
/* @ngInject */
constructor(clipboard) {
@@ -5,6 +7,8 @@ class GitFormAutoUpdateFieldsetController {
this.onChangeMechanism = this.onChangeField('RepositoryMechanism');
this.onChangeInterval = this.onChangeField('RepositoryFetchInterval');
this.clipboard = clipboard;
this.limitedFeature = FORCE_REDEPLOYMENT;
}
copyWebhook() {

View File

@@ -1,12 +1,12 @@
<ng-form name="autoUpdateForm">
<div class="form-group">
<div class="col-sm-12">
<por-switch-field name="autoUpdate" ng-model="$ctrl.model.RepositoryAutomaticUpdates" label="Automatic updates" on-change="($ctrl.onChangeAutoUpdate)"></por-switch-field>
<por-switch-field name="autoUpdate" ng-model="$ctrl.model.RepositoryAutomaticUpdates" label="Automatic Updates" on-change="($ctrl.onChangeAutoUpdate)"></por-switch-field>
</div>
</div>
<div class="small text-warning" style="margin: 5px 0 10px 0;" ng-if="$ctrl.model.RepositoryAutomaticUpdates">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
<span class="text-muted">Any changes to this stack made locally in Portainer will be overriden by the definition in git and may cause service interruption.</span>
<span class="text-muted">Any changes to this stack made locally in Portainer will be overriden by an updated git definition, which may cause service interruption.</span>
</div>
<div class="form-group" ng-if="$ctrl.model.RepositoryAutomaticUpdates">
<label for="repository_mechanism" class="col-sm-1 control-label text-left">
@@ -57,6 +57,15 @@
/>
</div>
</div>
<div class="form-group" ng-if="$ctrl.model.RepositoryAutomaticUpdates">
<div class="col-sm-12">
<por-switch-field name="forceUpdate" feature="$ctrl.limitedFeature" ng-model="$ctrl.model.RepositoryAutomaticUpdatesForce" label="Force Redeployment"></por-switch-field>
</div>
</div>
<div class="small text-warning" style="margin: 5px 0 10px 0;" ng-if="$ctrl.model.RepositoryAutomaticUpdates">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
<span class="text-muted">Any changes to this stack made locally in Portainer will be overriden by the current git definition and may cause service interruption.</span>
</div>
<div class="form-group col-md-12" ng-show="autoUpdateForm.repository_fetch_interval.$touched && autoUpdateForm.repository_fetch_interval.$invalid">
<div class="small text-warning">
<div ng-messages="autoUpdateForm.repository_fetch_interval.$error">

View File

@@ -37,7 +37,6 @@
<button
class="btn btn-sm btn-primary"
ng-click="$ctrl.submit()"
ng-if="!$ctrl.formValues.AutoUpdate.RepositoryAutomaticUpdates"
ng-disabled="$ctrl.isSubmitButtonDisabled() || $ctrl.state.hasUnsavedChanges || !$ctrl.redeployGitForm.$valid"
style="margin-top: 7px; margin-left: 0;"
button-spinner="$ctrl.state.redeployInProgress"

View File

@@ -29,6 +29,7 @@ export function featureService() {
[FEATURE_IDS.REGISTRY_MANAGEMENT]: EDITIONS.BE,
[FEATURE_IDS.S3_BACKUP_SETTING]: EDITIONS.BE,
[FEATURE_IDS.TEAM_MEMBERSHIP]: EDITIONS.BE,
[FEATURE_IDS.FORCE_REDEPLOYMENT]: EDITIONS.BE,
};
state.currentEdition = currentEdition;

View File

@@ -9,3 +9,4 @@ export const TEAM_MEMBERSHIP = 'team-membership';
export const HIDE_INTERNAL_AUTH = 'hide-internal-auth';
export const EXTERNAL_AUTH_LDAP = 'external-auth-ldap';
export const ACTIVITY_AUDIT = 'activity-audit';
export const FORCE_REDEPLOYMENT = 'force-redeployment';