Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tbt 137 account env vars #2954

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
TBT-137 Apply changes for organization type
tonoyansergey-devt committed Jan 17, 2025
commit 0b99d8c0ef3ae13197ac24e77742b9de9eb50104
1 change: 1 addition & 0 deletions app/models/owner.js
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ export default VcsEntity.extend({
isOrganization: equal('type', 'organization'),
isAssembla: match('vcsType', /Assembla\S+$/),
trialAllowed: attr('boolean', { defaultValue: false}),
accountEnvVars: attr(),

allowance: belongsTo('allowance', { async: true, inverse: 'owner', polymorphic: true, as: 'owner' }),

1 change: 0 additions & 1 deletion app/models/user.js
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@ export default Owner.extend({
confirmedAt: attr('date'),
customKeys: attr(),
collaborator: attr('boolean'),
accountEnvVars: attr(),

type: 'user',

1 change: 0 additions & 1 deletion app/templates/account/settings.hbs
Original file line number Diff line number Diff line change
@@ -172,7 +172,6 @@
<AccountEnvVar @envVar={{envVar}} />
{{/each}}
</ul>

</section>


27 changes: 27 additions & 0 deletions app/templates/organization/settings.hbs
Original file line number Diff line number Diff line change
@@ -57,4 +57,31 @@
</Modal>
{{/unless}}
</section>
<section class="settings-section account-env-vars-section">
<h2 class="small-title">
Account Environment Variables
</h2>
<p>
Customize your build using environment variables. For secure tips on generating private keys
<ExternalLinkTo @href={{config-get "urls.bestpracticessecurity"}}>
read our documentation
</ExternalLinkTo>
</p>
<div id="env-var-secrecy">
<p>
<span class="label-align">
If your secret variable has special characters like <code>&amp;</code>,
escape them by adding <code>\</code> in front of each special character.
For example, <code>ma&amp;w!doc</code> would be entered as <code>ma\&amp;w\!doc</code>.
</span>
</p>
</div>
<AddAccountEnvVar @owner={{this.account}} @ownerType='Organization' @repo={{this.repo}} />

<ul class="settings-list--envvars">
{{#each this.envVars as |envVar|}}
<AccountEnvVar @envVar={{envVar}} />
{{/each}}
</ul>
</section>
</section>
3 changes: 2 additions & 1 deletion mirage/models/organization.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Model, belongsTo } from 'miragejs';
import {Model, belongsTo, hasMany} from 'miragejs';

export default Model.extend({
allowance: belongsTo(),
installation: belongsTo(),
subscription: belongsTo(),
envVars: hasMany(),
});