[chore] added feature flag for linking files

pull/11582/head
Eric Schubert 2 years ago
parent 5fc1bd5ce7
commit 722a964164
No known key found for this signature in database
GPG Key ID: 1D346C019BD4BAA2
  1. 5
      frontend/src/app/core/config/configuration.service.ts
  2. 10
      frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
  3. 1
      frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
  4. 2
      lib_static/open_project/feature_decisions.rb
  5. 4
      modules/storages/lib/open_project/storages/engine.rb

@ -30,7 +30,6 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ConfigurationResource } from 'core-app/features/hal/resources/configuration-resource';
import * as moment from 'moment';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { WeekdayService } from 'core-app/core/days/weekday.service';
@Injectable({ providedIn: 'root' })
export class ConfigurationService {
@ -118,6 +117,10 @@ export class ConfigurationService {
return this.systemPreference('hostName');
}
public get activeFeatureFlags():string[] {
return this.systemPreference<string[]>('activeFeatureFlags');
}
private loadConfiguration() {
return this
.apiV3Service

@ -60,6 +60,7 @@ import {
StorageInformationBox,
} from 'core-app/shared/components/file-links/storage-information/storage-information-box';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import {
FilePickerModalComponent,
} from 'core-app/shared/components/file-links/file-picker-modal/file-picker-modal.component';
@ -108,16 +109,21 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
},
};
public get storageFileLinkingEnabled():boolean {
return this.configurationService.activeFeatureFlags.includes('storageFileLinking');
}
private get storageFilesLocation():string {
return this.storage._links.open.href;
}
constructor(
private readonly i18n:I18nService,
private readonly cookieService:CookieService,
private readonly opModalService:OpModalService,
private readonly fileLinkResourceService:FileLinksResourceService,
private readonly currentUserService:CurrentUserService,
private readonly cookieService:CookieService,
private readonly configurationService:ConfigurationService,
private readonly fileLinkResourceService:FileLinksResourceService,
) {
super();
}

@ -37,6 +37,7 @@
<span [textContent]="text.actions.linkFile(storageType)"></span>
</button>
<button
*ngIf="storageFileLinkingEnabled"
type="button"
class="spot-link op-file-list--action-button"
data-qa-selector="op-file-list--link-existing-file-button"

@ -40,7 +40,7 @@ module OpenProject
# * the method `.the_name_of_the_flag_active?` for querying the state
# of the flag. By default, it is false.
# * fetching the overwritten value from
# * ENV variable (`OPENPROJECT_THE_NAME_OF_THE_FLAG_ACTIVE = 'true'`)
# * ENV variable (`OPENPROJECT_FEATURE_THE_NAME_OF_THE_FLAG_ACTIVE = 'true'`)
# * configuration.yml file (`the_name_of_the_flag_active: true`)
# * from the settings database table (`Setting.feature_the_name_of_the_flag_active = true)
# * including the flag in the `.active` array in case it is enabled

@ -40,6 +40,10 @@ module OpenProject::Storages
# please see comments inside ActsAsOpEngine class
include OpenProject::Plugins::ActsAsOpEngine
initializer 'openproject_storages.feature_decisions' do
OpenProject::FeatureDecisions.add :storage_file_linking
end
# For documentation see the definition of register in "ActsAsOpEngine"
# This corresponds to the openproject-storage.gemspec
# Pass a block to the plugin (for defining permissions, menu items and the like)

Loading…
Cancel
Save