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

refactor(970): moves notices for joining to its own component #972

Merged
merged 5 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions app/components/join-section.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,21 @@
@route='index'
class='join__link join__link--new'
@disabled={{true}}
>Join the Squad</LinkTo>
>
Join the Squad
</LinkTo>
tejaskh3 marked this conversation as resolved.
Show resolved Hide resolved

{{!-- 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 come back later.</p>

{{#if this.isDevMode}}
We're currently not accepting new applications. Please check back in 2025.
ankushdharkar marked this conversation as resolved.
Show resolved Hide resolved
{{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.
ankushdharkar marked this conversation as resolved.
Show resolved Hide resolved
ankushdharkar marked this conversation as resolved.
Show resolved Hide resolved
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
13 changes: 12 additions & 1 deletion app/templates/subscribe.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@
</div>
{{else}}
<h1>Join the Real Dev Squad Community</h1>
<p class="notification__text">We're currently not accepting new applications. Please come back later.</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');
});
});
Loading