Skip to content

Commit

Permalink
feat(970): moves notices for joining to its own component
Browse files Browse the repository at this point in the history
We were copying the same notice for joining in two places. This moves it to its own component, so future changes are easier.
  • Loading branch information
ankushdharkar committed Jan 6, 2025
1 parent 4000f23 commit 84ba5d2
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
17 changes: 14 additions & 3 deletions app/components/join-section.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,19 @@
@route='index'
class='join__link join__link--new'
@disabled={{true}}
>Join the Squad</LinkTo>
>
Join the Squad
</LinkTo>

{{!-- NOTE: This has the new code on feature flag off --}}
{{!-- If something goes wrong, we can enable a flag to restore previous behaviour --}}
{{!-- TODO: Clean up by Jan, 2025 --}}
<p data-test-join-later-text class='join__later-text'>
We're currently not accepting new applications. Please check back in 2024.</p>
{{#if this.isDevMode}}
We're currently not accepting new applications. Please check back in 2024.
{{else}}
<NoticeForJoining />
{{/if}}
</p>
</section>
{{/if}}
{{/if}}
1 change: 1 addition & 0 deletions app/components/notice-for-joining.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We're currently not accepting new applications. Please check back in 2024.
5 changes: 5 additions & 0 deletions app/controllers/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default class SubscribeController extends Controller {
@tracked isLoading = false;
@tracked showSubscribedMessage = false;
@service toast;
@service featureFlag;
@tracked isPhoneValid = true;

RDS_TWITTER = RDS_TWITTER;
Expand All @@ -24,6 +25,10 @@ export default class SubscribeController extends Controller {
this.userData = this.login.userData;
}

get isDevMode() {
return this.featureFlag.isDevMode;
}

get isLoggedIn() {
return this.login.isLoggedIn;
}
Expand Down
12 changes: 11 additions & 1 deletion app/templates/subscribe.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@
</div>
{{else}}
<h1>Join the Real Dev Squad Community</h1>
<p class="notification__text">We're currently not accepting new applications. Please check back in 2024.</p>
<p class="notification__text">
{{!-- NOTE: This has the new code on feature flag off. --}}
{{!-- If something goes wrong, we can enable a flag to restore previous behaviour --}}
{{!-- TODO: Clean up by Jan, 2025 --}}
{{#if this.isDevMode}}
We're currently not accepting new applications. Please check back in 2024.
{{else}}
<NoticeForJoining />
{{/if}}
</p>

<p class="sub__text">Be the first to know when applications open!</p>
<button class="notify__btn" type="button" {{on "click" this.toggleFormModal}}>Notify Me When Applications Open</button>
{{/if}}
Expand Down
17 changes: 17 additions & 0 deletions tests/integration/components/notice-for-joining-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'website-www/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | notice-for-joining', function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });

await render(hbs`<NoticeForJoining />`);
assert.dom().includesText('not accepting new');
assert.dom().includesText('check back in 2024');
});
});

0 comments on commit 84ba5d2

Please sign in to comment.